Changeset View
Changeset View
Standalone View
Standalone View
docs/extrinsic-metadata-specification.rst
Show All 26 Lines | |||||
Metadata authorities are entities that provide metadata about an | Metadata authorities are entities that provide metadata about an | ||||
:term:`origin`. Metadata authorities include: code hosting places, | :term:`origin`. Metadata authorities include: code hosting places, | ||||
:term:`deposit` submitters, and registries (eg. Wikidata). | :term:`deposit` submitters, and registries (eg. Wikidata). | ||||
An authority is uniquely defined by these properties: | An authority is uniquely defined by these properties: | ||||
* its type, representing the kind of authority, which is one of these values: | * its type, representing the kind of authority, which is one of these values: | ||||
* `deposit`, for metadata pushed to Software Heritage at the same time | * `deposit`, for metadata pushed to Software Heritage at the same time | ||||
as a software artifact | as a software artifact | ||||
* `forge`, for metadata pulled from the same source as the one hosting | * `forge`, for metadata pulled from the same source as the one hosting | ||||
the software artifacts (which includes package managers) | the software artifacts (which includes package managers) | ||||
* `registry`, for metadata pulled from a third-party | * `registry`, for metadata pulled from a third-party | ||||
* its URL, which unambiguously identifies an instance of the authority type. | * its URL, which unambiguously identifies an instance of the authority type. | ||||
Examples: | Examples: | ||||
=============== ================================= | =============== ================================= | ||||
type url | type url | ||||
=============== ================================= | =============== ================================= | ||||
deposit https://hal.archives-ouvertes.fr/ | deposit https://hal.archives-ouvertes.fr/ | ||||
▲ Show 20 Lines • Show All 92 Lines • ▼ Show 20 Lines | * Getting latest metadata:: | ||||
origin_metadata_get_latest(origin_url, authority) | origin_metadata_get_latest(origin_url, authority) | ||||
where `authority` must be a dict containing keys `type` and `url`, | where `authority` must be a dict containing keys `type` and `url`, | ||||
which returns a dictionary corresponding to the latest metadata entry | which returns a dictionary corresponding to the latest metadata entry | ||||
added from this origin, in the format:: | added from this origin, in the format:: | ||||
{ | { | ||||
'origin_url': ..., | |||||
'authority': {'type': ..., 'url': ...}, | 'authority': {'type': ..., 'url': ...}, | ||||
'fetcher': {'name': ..., 'version': ...}, | 'fetcher': {'name': ..., 'version': ...}, | ||||
'discovery_date': ..., | 'discovery_date': ..., | ||||
'format': '...', | 'format': '...', | ||||
'metadata': b'...' | 'metadata': b'...' | ||||
} | } | ||||
Show All 29 Lines |