httk.core.files¶
Stdlib-only storage records for OPTIMADE files entries.
FileRecord stores file metadata and a flat sha256 digest. The URL is
part of identity deliberately: two paths to the same bytes are two entries.
The mapping-valued checksums field is skipped because SQL storage cannot
persist mappings; use sha256 for the storable digest.
Attributes¶
Classes¶
Store one OPTIMADE |
|
Logical entry family for served |
Module Contents¶
- httk.core.files.FILES_DEFINITION_ID = 'https://schemas.optimade.org/defs/v1.2/entrytypes/optimade/files'[source]¶
- class httk.core.files.FileRecord[source]¶
Bases:
httk.core.entry_types.FileStore one OPTIMADE
filesentry with a content identity.URL and name remain required positional fields. The URL is included in identity so separate paths to identical bytes remain separate entries. Metadata timestamps and immutable identifiers are excluded from identity.
checksumsis skipped because mapping fields are not SQL-storable; store the flatsha256value when a storable digest is needed.- Parameters:
url – The URL to get the contents of the file.
name – The base name of the file.
immutable_id – An optional provider-specific immutable identifier.
last_modified – The optional timezone-aware metadata timestamp.
url_stable_until – The optional URL stability deadline.
size – The file size in bytes, if known.
media_type – The file MIME type, if known.
version – The file version, if known.
modification_timestamp – The optional content modification timestamp.
description – An optional free-form file description.
checksums – Optional checksums, kept out of SQL storage.
atime – The optional POSIX access timestamp.
ctime – The optional POSIX status-change timestamp.
mtime – The optional POSIX modification timestamp.
sha256 – The optional flat SHA-256 digest.
- immutable_id: Annotated[str | None, IdentitySkip()] = None[source]¶
- last_modified: Annotated[datetime.datetime | None, IdentitySkip()] = None[source]¶
- url_stable_until: Annotated[datetime.datetime | None, IdentitySkip()] = None[source]¶
- modification_timestamp: Annotated[datetime.datetime | None, IdentitySkip()] = None[source]¶
- atime: Annotated[datetime.datetime | None, IdentitySkip()] = None[source]¶
- ctime: Annotated[datetime.datetime | None, IdentitySkip()] = None[source]¶
- mtime: Annotated[datetime.datetime | None, IdentitySkip()] = None[source]¶