Skip to main content

glyff-file-store

File-backed ExecutionRepository implementation for glyff.

This is the human-readable debug backend: JsonFileBackend bundles a file-backed execution repository and transaction provider, storing executions in a single pretty-printed JSON map that is rewritten atomically on each commit.

For the durable production backend, see glyff-sqlite.

Install

pip install glyff-file-store

This package depends on glyff>=0.14.0 and filelock>=3.15.

Public API

Name Description
JsonFileBackend Bundle exposing the store's collaborators.
FileExecutionRepository Debug repository writing pretty-printed JSON.
FileTransactionProvider Transaction provider for the file backend.

Construct it with a base_dir; it holds every session written under it:

from glyff_file_store import JsonFileBackend

backend = JsonFileBackend(base_dir=".sessions")

The underlying FileClient is internal and not part of the public API.

JSON debug format

Everything the store holds lives in one pretty-printed, key-sorted document at <base_dir>/glyff.json, nested by session id:

{
  "format_version": 1,
  "sessions": {
    "orders": {
      "domain_versions": {
        "com.example.payments": "3"
      },
      "executions": {}
    }
  }
}

format_version is glyff's own, so a store written by an incompatible build is refused rather than misread; domain_versions holds one version per domain the session has entered, each claimed by whichever process entered it first.

Execution results and metadata are stored as embedded JSON values, so serializers used with this backend must produce JSON text. Canonical arguments are stored as a JSON string instead: the execution's key is the digest of those exact bytes, so they are kept verbatim rather than re-encoded.

The whole document is read on access and rewritten on every commit, which is what keeps it readable and what makes it unsuitable for high-throughput or large-scale use.

Commit atomicity

A commit reads the document, applies the transaction's staged updates, and replaces the file in one os.replace, so it is all-or-nothing however many sessions it touched. A crash can only strand a temporary beside the document, never leave the document itself half-written; the next open clears it.

Concurrency

Commits and version claims are serialized across the processes sharing a base_dir, through a .glyff.lock file beside the document. Reads take no lock: a replacement is atomic, so a read sees either the whole old document or the whole new one.

Status

Pre-1.0 — the API is unstable and will change.

License

MIT

Download files

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

Source Distribution

glyff_file_store-0.16.0.tar.gz (14.2 kB view details)

Uploaded Source

Built Distribution

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

glyff_file_store-0.16.0-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

Details for the file glyff_file_store-0.16.0.tar.gz.

File metadata

  • Download URL: glyff_file_store-0.16.0.tar.gz
  • Upload date:
  • Size: 14.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for glyff_file_store-0.16.0.tar.gz
Algorithm Hash digest
SHA256 ec6ad8d8a4f8200ea5c29e26e31ba614a4dde5e93ff43e69259af80abee1b920
MD5 7d33ca790fbd545dbcc90b517b1a3a3a
BLAKE2b-256 37367dc0b0ba8b96844743a3b6a1b534ff668fe55bfa408be3ae5c09deaf21ee

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_file_store-0.16.0.tar.gz:

Publisher: publish-glyff-file-store.yml on nueruyu/glyff

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

File details

Details for the file glyff_file_store-0.16.0-py3-none-any.whl.

File metadata

File hashes

Hashes for glyff_file_store-0.16.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be765fa079beb782ad5f6e5ec09c1f1b24bd30358bf2beb08d92bfe896ff2320
MD5 4d3b72fb89ed7db60d46b0cb7192581e
BLAKE2b-256 6f34b902817ce9b0211c00a050d55af6f5cbcd262740257f29984336f9965942

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_file_store-0.16.0-py3-none-any.whl:

Publisher: publish-glyff-file-store.yml on nueruyu/glyff

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

Release history Release notifications | RSS feed

This release

0.16.0 This release

2 files

0.15.0

2 files

0.14.0

2 files

0.13.0

2 files

0.12.0

2 files

0.11.0

2 files

0.10.0

2 files

0.9.0

2 files

0.8.0

2 files

0.7.0

2 files

0.6.0

2 files

0.5.0

2 files

0.4.0

2 files

0.3.0

2 files

0.2.0

2 files

0.1.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page