Skip to main content

File-based SessionStore implementation for glyff.

Project description

glyff-file-store

A file-based SessionStore implementation for glyff.

Sessions are persisted to disk as a JSON event log. The whole log is loaded into memory at startup and the file is rewritten atomically on each commit; suitable for sessions where the log fits comfortably in memory. For very large or high-throughput sessions, prefer a database-backed store.

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 SessionStore writing a pretty-printed JSON event log file.

Format

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

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 via two renames (sessionsession.bak, tmpsession, drop session.bak). 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 drops the stale backup (when the live directory is already in place), and 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.4.0.tar.gz (12.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.4.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: glyff_file_store-0.4.0.tar.gz
  • Upload date:
  • Size: 12.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.4.0.tar.gz
Algorithm Hash digest
SHA256 6ebff806204fe3801826df2f16d208f71904cc06d3d31976b49bf1808c1a3eeb
MD5 0402159b5e60999860e6a4adf8d156bc
BLAKE2b-256 9c8c4ed5461e31e41b3af2df1ff82644f0e08d937660e19b85f01f3571dd9e3e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for glyff_file_store-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 49b004f8e2b10230597fc5e3d43cd349bc4cef6e6a8b40253da8955377e5ddd0
MD5 ac605ce8d3ceba0a64f2f01f2a5cb38a
BLAKE2b-256 e5f9af7fa32bd10b2f1193725f82a9c94ae9890dc79f50a457ea0d444c1a9dd2

See more details on using hashes here.

Provenance

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