swh.loader.metadata.gitea module#

Metadata loader for Gitea and Gogs.

While both Gitea and Gogs currently return similar formats, they are implemented as separate classes, to avoid losing provenance information in case they diverge without notice in the future.

swh.loader.metadata.gitea.HTTP_ACCEPT = 'application/json'#

HTTP header sent on all API requests to GitHub.

class swh.loader.metadata.gitea.GiteaMetadataFetcher(origin: Origin, credentials: Dict[str, Dict[str, List[Dict[str, str]]]] | None, lister_name: str, lister_instance_name: str)[source]#

Bases: _BaseGiteaMetadataFetcher

FETCHER_NAME: str = 'gitea'#

The config-friendly name of this fetcher, used to retrieve the first level of credentials.

SUPPORTED_LISTERS: Set[str] = {'gitea'}#

Set of forge types this metadata fetcher supports. The type names are the same as the names used by listers themselves.

Generally, fetchers have a one-to-one matching with listers, in which case this is set of {FETCHER_NAME}.

METADATA_FORMAT: str = 'gitea-repository-json'#

Value of the format field of produced swh.model.model.RawExtrinsicMetadata objects.

on_anonymous_mode()[source]#
class swh.loader.metadata.gitea.GogsMetadataFetcher(origin: Origin, credentials: Dict[str, Dict[str, List[Dict[str, str]]]] | None, lister_name: str, lister_instance_name: str)[source]#

Bases: _BaseGiteaMetadataFetcher

FETCHER_NAME: str = 'gogs'#

The config-friendly name of this fetcher, used to retrieve the first level of credentials.

SUPPORTED_LISTERS: Set[str] = {'gogs'}#

Set of forge types this metadata fetcher supports. The type names are the same as the names used by listers themselves.

Generally, fetchers have a one-to-one matching with listers, in which case this is set of {FETCHER_NAME}.

METADATA_FORMAT: str = 'gogs-repository-json'#

Value of the format field of produced swh.model.model.RawExtrinsicMetadata objects.

on_anonymous_mode()[source]#