pyswh.swh

Module Contents

Functions

save(origin_url, post_only, auth_token)

Attempts to save code in the Software Heritage Archive.

pyswh.swh.save(origin_url: str, post_only: bool, auth_token: str)

Attempts to save code in the Software Heritage Archive.

This method wraps the /api/1/origin/save/ endpoint.

Parameters
  • origin_url (str) – The URL of the origin (source code repository) that should be saved in the archive.

  • post_only (bool) – Whether the URL should simply be posted to the API and return, without checking for the success of the save operation.

  • auth_token (str) – An optional Software Heritage API authentication token.

Raises

SwhSaveError – if an error occurred during the save task, or if the save task was unsuccessful.