Skip to main content

File-based SessionStore implementation for glyff.

Project description

glyff-file-store

File-backed ExecutionRepository implementation for glyff.

This package provides a human-readable debug backend:

  • JsonFileBackend provides a file-backed execution repository and transaction provider. It stores executions in a single pretty-printed JSON map and rewrites that file atomically on each commit.

For the durable production backend, see glyff-sqlite.

Install

pip install glyff-file-store

This package depends on glyff>=0.1.0.

Public API

Name Description
JsonFileBackend Bundle exposing repository and transaction provider.
FileExecutionRepository Debug repository writing pretty-printed JSON.
FileTransactionProvider Transaction provider for the file backend.

Construct it with a base_dir and session_id:

from glyff_file_store import JsonFileBackend

backend = JsonFileBackend(base_dir=".sessions", session_id="my-session")

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

JSON debug format

JsonFileBackend stores each session under <base_dir>/<session_id>/ in a single pretty-printed JSON file (executions.json). The execution map is read from that file on access and rewritten atomically on every commit. Execution results and metadata are stored as embedded JSON values, so serializers used with this backend must produce JSON text.

This format is intended for debugging and manual inspection, not as the durable or high-throughput backend.

Commit atomicity

The store commits the staged ops for an entire session directory as a unit. Each commit builds the full new session state in a sibling .commit-* directory and then swaps it into place using directory renames. All staged ops are visible together or none are, regardless of how many files were touched, and a writer callback raising mid-commit leaves the on-disk session unchanged.

If a process dies mid-commit, the next time the session directory is opened it is restored from session.bak when the live directory is missing, or the stale backup is removed when the live directory is already in place. Any orphan .commit-* temp directories are also removed.

Status

Early development. APIs may change before v1.0.

License

MIT

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

glyff_file_store-0.13.0.tar.gz (13.8 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.13.0-py3-none-any.whl (8.8 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for glyff_file_store-0.13.0.tar.gz
Algorithm Hash digest
SHA256 a60d3b7415264a65c989ddcbb83ae3981c04f959f93b08b84ea7b3191beb11fb
MD5 144c3920a2112fbac26bc983d155e917
BLAKE2b-256 e09492ada31320d56ca611f0a4e921f7cae94c86e8e6b017e505ba184a1ec883

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for glyff_file_store-0.13.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd810ef3a037983db2538eb132a11360e1295fedd35213652bbb3a3a434b1878
MD5 4ba7b8e5a614f2a0cb6cc9aef986090b
BLAKE2b-256 7d1eb41dd938bb5d037d0080740343a37ad26909260dd94d615fd2b2f498acbc

See more details on using hashes here.

Provenance

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

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