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.15.0.tar.gz (14.0 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.15.0-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glyff_file_store-0.15.0.tar.gz
  • Upload date:
  • Size: 14.0 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.15.0.tar.gz
Algorithm Hash digest
SHA256 e4bf1ca691f11d5ca28e02e42b2697f7156a944746a56c6288be95c7770455ba
MD5 f17881aa5861e382f9a5b9b99a468862
BLAKE2b-256 ea3d5f0a895477846432a376baae5958cebdd13932da7c02c8c8c77893a2dc91

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_file_store-0.15.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.15.0-py3-none-any.whl.

File metadata

File hashes

Hashes for glyff_file_store-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be15df426b48f3227f1e2e758e9295f4c3f4d792c142cd5d49a97925540b8266
MD5 18807871f63728dd9869d832ac0de9a6
BLAKE2b-256 d00b4ca81df1a33252fc97b779eadad2b0800884c5c211337e58aa4f4c27b812

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff_file_store-0.15.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

0.16.0

2 files

This release

0.15.0 This release

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