wfexs_backend.fetchers.swh#

Module Contents#

Classes#

API#

class wfexs_backend.fetchers.swh.SoftwareHeritageFetcher(progs: wfexs_backend.common.ProgsMapping = dict(), setup_block: Mapping[str, Any] | None = None)#

Bases: wfexs_backend.fetchers.AbstractRepoFetcher

SOFTWARE_HERITAGE_SCHEME: Final[str] = 'swh'#
SWH_API_REST: Final[str] = 'https://archive.softwareheritage.org/api/1/'#
SWH_API_REST_KNOWN: Final[URIType] = 'cast(...)'#
SWH_API_REST_RESOLVE: Final[str] = 'urljoin(...)'#
SWH_API_REST_RELEASE: Final[str] = 'urljoin(...)'#
SWH_API_REST_REVISION: Final[str] = 'urljoin(...)'#
SWH_API_REST_VAULT_FLAT: Final[str] = 'urljoin(...)'#
SWH_API_REST_CONTENT: Final[str] = 'urljoin(...)'#
DIR_RETRIES: Final[int] = 60#
WAIT_SECS: Final[int] = 60#
classmethod GetSchemeHandlers() Mapping[str, DocumentedStatefulProtocolFetcher]#
property description: str#
classmethod GetNeededPrograms() Sequence[SymbolicName]#
classmethod _resolve_swh_id(the_id: wfexs_backend.common.URIType) Tuple[Mapping[str, Any], MutableSequence[URIWithMetadata]]#
classmethod GuessRepoParams(orig_wf_url: URIType | parse.ParseResult, logger: logging.Logger | None = None, fail_ok: bool = False) RemoteRepo | None#
build_pid_from_repo(remote_repo: wfexs_backend.fetchers.RemoteRepo) str | None#

This method is required to generate a PID which usually represents an element (usually a workflow) in a repository. If the fetcher does not recognize the type of repo, it should return None

materialize_repo(repoURL: wfexs_backend.common.RepoURL, repoTag: RepoTag | None = None, repo_tag_destdir: PathLikePath | None = None, base_repo_destdir: PathLikePath | None = None, doUpdate: bool | None = True) Tuple[pathlib.Path, RemoteRepo, Sequence[URIWithMetadata]]#
fetch(remote_file: wfexs_backend.common.URIType, cachedFilename: wfexs_backend.common.PathLikePath, secContext: SecurityContextConfig | None = None) wfexs_backend.fetchers.ProtocolFetcherReturn#