Skip to main content

functualize-state

Status: Published — Independently installable from PyPI.

State Domain SDK for functualize providing well-defined protocols for key-value state persistence and execution tracking. Enables custom storage backend implementations (SQLite, Redis, DynamoDB, etc.) without coupling your application to any specific database.

Installation

pip install functualize-state

Quick Start

from functualize_state import InMemoryState, StateNamespace

# Create a backend (use InMemoryState for testing, or implement StateBackend)
backend = InMemoryState()

# Use namespaces to isolate keys by concern
ns = StateNamespace(backend, prefix="deploy:")
ns.set("version", "1.2.0")
ns.set("status", "pending")

print(ns.get("version"))  # "1.2.0"
print(ns.keys())          # ["version", "status"]

Features

  • Backend-agnostic protocols — StateBackend and ExecutionStore define the interface; bring your own storage implementation
  • Namespace isolation — StateNamespace provides prefix-scoped views over any backend, preventing key collisions between components
  • Execution tracking — Record job executions, phases, and session metadata with structured ExecutionRecord and PhaseRecord types
  • Event-driven observability — Built-in event constants (STATE_EXECUTION_STARTED, STATE_EXECUTION_COMPLETED, STATE_PHASE_CHANGED) for lifecycle hooks
  • Test-friendly — Ships InMemoryState, a dict-backed backend for fast, deterministic unit tests
  • Fully typed — PEP 561 compliant with py.typed marker; all protocols are @runtime_checkable

API Reference

Protocols

  • StateBackend — Key-value state operations protocol (get, set, delete, keys)
  • ExecutionStore — Execution record persistence protocol (insert_execution, update_execution, get_session_executions, insert_phase, get_execution_phases)

Classes

  • StateNamespace — Prefix-scoped view over a StateBackend for isolated key access
  • InMemoryState — Dict-backed StateBackend implementation for testing
  • DomainMetadata — Self-describing metadata dataclass for the state domain SDK

Data Types

  • ExecutionRecord — Frozen dataclass representing a single job execution (id, job name, session, status, timing, result)
  • PhaseRecord — Frozen dataclass representing a phase within an execution
  • SessionRecord — Frozen dataclass representing a session with metadata

Errors

  • StateNotAvailable — Raised when a state backend is not available
  • KeyNotFoundError — Raised when a requested key is not found

Event Constants

  • STATE_EXECUTION_STARTED — Fired when an execution begins
  • STATE_EXECUTION_COMPLETED — Fired when an execution finishes
  • STATE_PHASE_CHANGED — Fired when a phase transition occurs

Module-Level

  • domain_metadata — Pre-configured DomainMetadata instance for the state domain

Development

Run plugin tests:

uv run pytest plugins/functualize-state/tests/ -v

Release files for functualize-state 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for functualize-state 0.1.2
File Size Uploaded
functualize_state-0.1.2.tar.gz 6.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for functualize-state 0.1.2
File Interpreter ABI Platform
functualize_state-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 14.3 kB

Release files / functualize_state-0.1.2.tar.gz

Download URL functualize_state-0.1.2.tar.gz
Size 6.5 kB
Tags Source
SHA-256 checksum
How to use checksums
14627aa94f71cdfb041f2284515112b632d4d6a457600c3455a605d35b723485
BLAKE2b-256 checksum
How to use checksums
6e649d6955ff38a79ea65ace99e361d35a2b1eb1e378bc145a327ba330c825a8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release files / functualize_state-0.1.2-py3-none-any.whl

Download URL functualize_state-0.1.2-py3-none-any.whl
Size 7.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8c97ed1c2aa01aa038d52f56334173ba08b471c4de721d5d674cd0c815a8d0a7
BLAKE2b-256 checksum
How to use checksums
e849346ce89d1e6f1664d7632776cef888219b8b1f2f11eb337bfd1d6f96ccb5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.

Transparency log

Release history Release notifications | RSS feed

0.2.3

2 release files

0.2.2

2 release files

0.2.1

2 release files

0.2.0

2 release files

0.1.3

2 release files

This release

0.1.2 This release

2 release files

0.1.1

2 release files

0.1.0

2 release 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