Skip to main content

statepatch

Immer-style ops over a plain JSON tree: observable(initial) wraps one value, .value reads it, and every mutation emits the matching replace / add / remove op to subscribers. Observables compose: one stored inside another mounts its op stream at that path. Part of harness-sdk, under statewire and pinned.

Install

uv add statepatch

Use

from statepatch import observable

state = observable({"runs": []})
state.subscribe(print)

run = observable({"runId": "r1", "queue": []})
state["runs"].append(run)          # add op at ["runs", 0]
run["queue"].append({"id": "q1"})  # forwarded as add at ["runs", 0, "queue", 0]
state["runs"].pop(0)               # remove op; run is detached and reusable

Docs

Metadata

Release files for statepatch 0.2.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 statepatch 0.2.2
File Size Uploaded
statepatch-0.2.2.tar.gz 8.2 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for statepatch 0.2.2
File Interpreter ABI Platform
statepatch-0.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 15.0 kB

Release files / statepatch-0.2.2.tar.gz

Download URL statepatch-0.2.2.tar.gz
Size 8.2 kB
Tags Source
SHA-256 checksum
How to use checksums
151e56db8780261d0e4a887f0e8e6a0d8a8378242c6622cd8ea5afee82d2c534
BLAKE2b-256 checksum
How to use checksums
15e5b767defd92e01fcbd0b76c3f2e44eb1d4c1f47794f4aea7e1cdec57bf980
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 Sep 8, 2026.

Transparency log

Release files / statepatch-0.2.2-py3-none-any.whl

Download URL statepatch-0.2.2-py3-none-any.whl
Size 6.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ed21dbc9aac80142f581c270fff31af3bf3589e63ac0d4b5c08852990948e88a
BLAKE2b-256 checksum
How to use checksums
8c81c404441389f5e140849f9ddd6bad84c644740593023a3c61a651630591bd
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 Sep 8, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.2 This release

2 release files

0.2.1

2 release files

0.2.0

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