Skip to main content

File-metadata primitive for Flametrench: storage-agnostic metadata, lifecycle, and authz-mediated access (ADR 0020).

Project description

flametrench-file

File-metadata primitive for the Flametrench v0.4 platform (ADR 0020).

What this is

Metadata and lifecycle for files — no blob bytes in the contract. storage_ref is an opaque adopter pointer (S3 key, GCS path, URL) stored verbatim; the primitive never dereferences it. Access is mediated by authz (ADR 0001); a file_ record is an authz object.

Lifecycle: pendingactive (freezes size_bytes/checksum/storage_ref) → deleted (soft — record retained). Deleted files remain fetchable.

Install

pip install flametrench-file

Requires Python ≥ 3.11 and flametrench-ids >= 0.4.0.

Quick start

from flametrench_file import InMemoryFileStore

store = InMemoryFileStore()

# Register directly as active
f = store.create_file_metadata(
    scope="org_...",
    owner_usr_id="usr_...",
    name="q3-report.pdf",
    content_type="application/pdf",
    size_bytes=184320,
    checksum={"algo": "sha-256", "value": "e3b0c44..."},
    storage_ref="s3://bucket/q3-report.pdf",
    status="active",
)

# Or: pending handshake → activate on upload complete
p = store.create_file_metadata(
    scope="org_...", owner_usr_id="usr_...",
    name="upload.bin", content_type="application/octet-stream",
    status="pending",
)
store.update_file_metadata(
    p.id, status="active",
    size_bytes=4096,
    checksum={"algo": "sha-256", "value": "9f86d08..."},
    storage_ref="s3://bucket/upload.bin",
)

License

Apache-2.0 © NDC Digital, LLC

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

flametrench_file-0.4.0.tar.gz (10.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

flametrench_file-0.4.0-py3-none-any.whl (6.8 kB view details)

Uploaded Python 3

File details

Details for the file flametrench_file-0.4.0.tar.gz.

File metadata

  • Download URL: flametrench_file-0.4.0.tar.gz
  • Upload date:
  • Size: 10.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for flametrench_file-0.4.0.tar.gz
Algorithm Hash digest
SHA256 964ecc8d99b8f49aabc74c62fe4450306744d1531c7dba062d2e5562e3b4b101
MD5 49fc6dd144783cc35390ea5c967bb184
BLAKE2b-256 1fbef3488327017df0680a0a51ab0dcd47d5a330e466526216eee24416b1ce35

See more details on using hashes here.

Provenance

The following attestation bundles were made for flametrench_file-0.4.0.tar.gz:

Publisher: publish.yml on flametrench/file-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file flametrench_file-0.4.0-py3-none-any.whl.

File metadata

File hashes

Hashes for flametrench_file-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ee8a7d0e12744b212bb0f7b883d85b83750301b81fa71d3e004d426ec9e3775d
MD5 ec1ac86b50383eeb98a69a6018c91aba
BLAKE2b-256 80945c0b019baa44650f4f3ff3d9ad4a078ea7f274548496a15d49992a53f70d

See more details on using hashes here.

Provenance

The following attestation bundles were made for flametrench_file-0.4.0-py3-none-any.whl:

Publisher: publish.yml on flametrench/file-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page