archivebox.base_models.abid
Module Contents
Classes
e.g. ABID(‘obj_01HX9FPYTRE4A5CCD901ZYEBQE’) |
Functions
https://example.com -> ‘E4A5CCD9AF4ED2A6E0954DF19FD274E9CDDB4853051F033FD518BFC90AA1AC25’ (example.com) |
|
‘snp_’ |
|
‘E4A5CCD9’ # takes first 8 characters of sha256(url) |
|
‘01HX9FPYTR’ # produces 10 character Timestamp section of ulid based on added date |
|
Snapshots have 01 type, other objects have other subtypes like wget/media/etc. Also allows us to change the ulid spec later by putting special sigil values here. |
|
‘ZYEBQE’ # takes last 6 characters of randomness from existing legacy uuid db field |
|
Return a freshly derived ABID (assembled from attrs defined in ABIDModel.abid_*_src). |
Data
API
- archivebox.base_models.abid.DEFAULT_ABID_URI_SALT[source]
‘687c2fff14e3a7780faa5a40c237b19b5b51b089’
- class archivebox.base_models.abid.ABID[source]
Bases:
typing.NamedTuple
e.g. ABID(‘obj_01HX9FPYTRE4A5CCD901ZYEBQE’)
- classmethod parse(buffer: Union[str, uuid.UUID, ulid.ULID, typeid.TypeID, archivebox.base_models.abid.ABID], prefix=DEFAULT_ABID_PREFIX) archivebox.base_models.abid.ABID [source]
- archivebox.base_models.abid.uri_hash(uri: Union[str, bytes], salt: str = DEFAULT_ABID_URI_SALT) str [source]
https://example.com -> ‘E4A5CCD9AF4ED2A6E0954DF19FD274E9CDDB4853051F033FD518BFC90AA1AC25’ (example.com)
- archivebox.base_models.abid.abid_part_from_uri(uri: Any, salt: str = DEFAULT_ABID_URI_SALT) str [source]
‘E4A5CCD9’ # takes first 8 characters of sha256(url)
- archivebox.base_models.abid.abid_part_from_ts(ts: datetime.datetime) str [source]
‘01HX9FPYTR’ # produces 10 character Timestamp section of ulid based on added date
- archivebox.base_models.abid.abid_part_from_subtype(subtype: str | int) str [source]
Snapshots have 01 type, other objects have other subtypes like wget/media/etc. Also allows us to change the ulid spec later by putting special sigil values here.
- archivebox.base_models.abid.abid_part_from_rand(rand: Union[str, uuid.UUID, None, int]) str [source]
‘ZYEBQE’ # takes last 6 characters of randomness from existing legacy uuid db field
- archivebox.base_models.abid.abid_hashes_from_values(prefix: str, ts: datetime.datetime, uri: Any, subtype: str | int, rand: Union[str, uuid.UUID, None, int], salt: str = DEFAULT_ABID_URI_SALT) Dict[str, str] [source]
- archivebox.base_models.abid.abid_from_values(prefix: str, ts: datetime.datetime, uri: str, subtype: str, rand: Union[str, uuid.UUID, None, int], salt: str = DEFAULT_ABID_URI_SALT) archivebox.base_models.abid.ABID [source]
Return a freshly derived ABID (assembled from attrs defined in ABIDModel.abid_*_src).