swh.model.identifiers module#

swh.model.identifiers.content_identifier(content: Dict[str, Any]) Dict[str, bytes][source]#

Deprecated, use swh.model.Content instead: content_identifier(d) is equivalent to: {k: hash_to_hex(v) for (k, v) in Content.from_data(d["data"]).hashes().items()}

swh.model.identifiers.directory_identifier(directory: Dict[str, Any]) str[source]#

Deprecated, use swh.model.Directory instead: directory_identifier(d) is equivalent to: hash_to_hex(Directory.from_dict(d).id).

See swh.model.git_objects.directory_git_object() for details of the format used to generate this identifier.

swh.model.identifiers.revision_identifier(revision: Dict[str, Any]) str[source]#

Deprecated, use swh.model.Revision instead: revision_identifier(d) is equivalent to: hash_to_hex(Revision.from_dict(d).id).

See swh.model.git_objects.revision_git_object() for details of the format used to generate this identifier.

swh.model.identifiers.release_identifier(release: Dict[str, Any]) str[source]#

Deprecated, use swh.model.Release instead: release_identifier(d) is equivalent to: hash_to_hex(Release.from_dict(d).id).

See swh.model.git_objects.release_git_object() for details of the format used to generate this identifier.

swh.model.identifiers.snapshot_identifier(snapshot: Dict[str, Any]) str[source]#

Deprecated, use swh.model.Snapshot instead: snapshot_identifier(d) is equivalent to: hash_to_hex(Snapshot.from_dict(d).id).

See swh.model.git_objects.snapshot_git_object() for details of the format used to generate this identifier.

swh.model.identifiers.origin_identifier(origin)[source]#

Deprecated, use swh.model.Origin instead: origin_identifier(url) is equivalent to: hash_to_hex(Origin(url=url).id).