Skip to main content

glyff

Guaranteed Lightweight Yieldable Function Foundation.

A primitive for pausing async functions across process and request boundaries, and resuming them later from the same point.

Install

pip install glyff

glyff has no dependencies beyond the Python standard library.

Behavior

  • Marked function calls are recorded in a session-scoped execution repository, keyed by function identity, arguments, and an ordinal among identical calls.
  • Re-invoking the same completed call within the same session returns the recorded result instead of re-executing.
  • An exception persists nothing: the interrupted call stays STARTED (retried on resume), completed descendant work remains committed, and the original exception propagates.
  • To pause a session intentionally, raise an application-owned exception and catch it outside the Session block.

Public API

Name Description
Domain Versioned ownership boundary; its engrave marks a function.
Session Async context manager that scopes a sequence of engraved calls.
ExecutionId Identifier for a recorded function execution.
DomainId A domain's persistent machine identifier.
ExecutionName The recorded name of an engraved function.
ArgumentsDigest Digest of a call's canonical arguments.
Execution Aggregate Root for a recorded function execution.
ExecutionStatus Enum: STARTED, COMPLETED.
SerializedValue Serializer-neutral persisted value (results, metadata).
CanonicalArguments A call's encoded canonical arguments, the preimage of its key.
CanonicalArgumentValue A logical canonical value, including a fallback.
CanonicalFallback A fallback representation in a canonical argument.
Metadata Metadata entry owned by an Execution.
ExecutionRepository Repository for execution aggregates.
Transaction Active transaction boundary.
TransactionProvider Provider used by TransactionScope.
Serializer Protocol for value serialization.
ArgumentCanonicalizer Contract for normalizing bound call arguments into a canonical form.
CanonicalValue A value in the JSON data model.
SessionId The name a session's records are stored under.

glyff.migration carries the offline half: MigratableBackend and SessionMigration for a store that can replace a session atomically, SessionMigrator for what a session should become, and DomainMigration — declared as the ExecutionShape pairs that changed shape — as the one glyff ships. See migration.

Every engraved function belongs to a domain, which owns and versions its records:

engrave = glyff.Domain("com.example.payments", version="3").engrave

The first call into a domain records that version for the session, and a later call under a different one raises DomainVersionMismatchError rather than migrating. See migration.

Persistent boundaries should declare an identity such as @engrave(name="chat.reply"), so Python function renames do not change recorded keys. Without name, glyff derives it from the function's module and __qualname__.

Extending

  • For persistent storage, see glyff-sqlite (production) and glyff-file-store (debug).
  • For Pydantic-typed serialization, see glyff-pydantic.
  • Custom backends provide an ExecutionRepository, a TransactionProvider and claim_domain, usually through a small backend bundle. See the backends doc.
  • glyff.testing carries a conformance suite for each extension point, listed in the backends doc (planned: #36).

Status

Pre-1.0 — the API is unstable and will change. See the documentation for the guarantees and what is planned.

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-0.15.0.tar.gz (73.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-0.15.0-py3-none-any.whl (64.3 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for glyff-0.15.0.tar.gz
Algorithm Hash digest
SHA256 e5ee5ed749ca90b4d74f1869d2f902eb7ed481aea431d16d261bf0e2cbd008eb
MD5 5e68fbb76b1bc16e3e760b28fdd04a71
BLAKE2b-256 1151a9f58e9ede4afb69bc7ebfb50e819aed65ac890b33c85e5b3a20067b4079

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff-0.15.0.tar.gz:

Publisher: publish-glyff.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-0.15.0-py3-none-any.whl.

File metadata

  • Download URL: glyff-0.15.0-py3-none-any.whl
  • Upload date:
  • Size: 64.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for glyff-0.15.0-py3-none-any.whl
Algorithm Hash digest
SHA256 be056596f6232a382e80dcb6ede3df8e02aa9f4cc5a1f71decd12023ea184e74
MD5 0c08601d10e1a4a1f1a9328cc7fc2a6a
BLAKE2b-256 1f99d6eef8d82901584817a7ed814658b3add1ec1628a2e0b9be7eeb4fe1fe69

See more details on using hashes here.

Provenance

The following attestation bundles were made for glyff-0.15.0-py3-none-any.whl:

Publisher: publish-glyff.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