Skip to main content

File-based SessionStore implementation for glyff.

Project description

glyff-file-store

File-backed SessionStore implementation for glyff.

This package provides a human-readable debug backend:

  • JsonFileSessionStore stores a pretty-printed JSON event log, loads the whole log into memory at startup, and rewrites the entire 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
FileClient Low-level file I/O for a session directory.
JsonFileSessionStore Debug SessionStore writing a pretty-printed JSON event log.

JSON debug format

JsonFileSessionStore stores each session under <base_dir>/<session_id>/ in a single pretty-printed JSON file (executions.json). The whole log is read into memory on startup and rewritten atomically on every commit.

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

Commit atomicity

FileClient 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 FileClient(...) instantiation restores the session from session.bak when the live directory is missing, or removes the stale backup when the live directory is already in place. It also removes any orphan .commit-* temp directories.

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.12.0.tar.gz (15.9 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.12.0-py3-none-any.whl (9.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glyff_file_store-0.12.0.tar.gz
  • Upload date:
  • Size: 15.9 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.12.0.tar.gz
Algorithm Hash digest
SHA256 83c44aaba31709412d10b559f11474913a1c00e0565b695cb11369d41d5f256f
MD5 aad72ff233ab0fb2ba9657093f478e6d
BLAKE2b-256 76befac5b90a8d7c6a577f8d50eba00301e01d9d3d94c90d15807aa210d1684f

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for glyff_file_store-0.12.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e52cda668cc42f17ffe186f2d9f464f98dddd85971cdf6338e2e668a78c6e043
MD5 922e35a37ceab213522ef4bde6150a1a
BLAKE2b-256 fb3cb1dea72d1aef5dece846bfd3f2897ea0bad5bb4b352dfb5a642accc3634f

See more details on using hashes here.

Provenance

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