This release is a pre-release and may not be stable for production use.
omnigraph
Async Python client for the Omnigraph HTTP API,
contract 0.14. It mirrors the TypeScript SDK
@modernrelay/omnigraph: the same routes, the
same contract checks, and the same error model, with Python names.
pip install omnigraph
Connect and query
from omnigraph import Omnigraph
async with Omnigraph("http://127.0.0.1:8080", graph_id="knowledge", token=TOKEN) as og:
result = await og.query(
"query find($name: String) { match { $p: Person { name: $name } } return { $p.name, $p.age } }",
params={"name": "Alice"},
)
print(result["rows"], result["graph_commit_id"])
base_url is the server root, including any proxy prefix. Select a graph with graph_id or
og.graph("beta"), which shares the connection pool. Results are the server's JSON as
TypedDicts generated from the server's OpenAPI document; field names are the wire names.
Rows omit null-valued fields.
Every request carries Omnigraph-Http-Api: 0.14, every response is checked for it, and a
HEAD /healthz discovery precedes each data request. The client follows no redirects and
never retries. Upgrade the server and this package together: the SDK minor tracks the server
minor.
Write and verify
changed = await og.mutate(
"query rename($old: String, $name: String) { update Person set { name: $name } where name = $old }",
params={"old": "Alice", "name": "Alicia"},
if_graph_commit=result["graph_commit_id"],
)
A successful mutation returns its commit receipt; commit: None is a successful no-op. With
if_graph_commit the conditional route refuses a moved head with PreconditionFailedError.
Branches, merges, and unpublished commits:
await og.branches.create("review")
await og.mutate(insert_query, params=..., branch="review")
merged = await og.branches.merge("review", delete_branch=True)
Merge and mutation receipts are validated; a receipt that does not name the requested
operation raises ApiContractError.
Streams, loads, feeds, and blobs
# NDJSON, not buffered
async for row in og.export(type_names=["Person"]):
...
# One commit, up to 32 MiB
await og.load_ndjson(ndjson_text, branch="main", mode="merge")
# One bounded feed page
page = await og.changes.poll(start="beginning", limit=100)
# A snapshot, then {"baseline": ...}
async for record in og.changes.baseline():
...
await og.blobs.put(b"...", entity="node", type="Doc", id="d1", property="body")
await og.queries.invoke("people", params={"name": "Ada"})
Ordinary JSON requests are limited to 1 MiB by the server; bulk loads go through
load_ndjson.
Errors
Every error is an OmnigraphError subclass chosen by status and code (ConflictError,
PreconditionFailedError, PayloadTooLargeError, GraphUnavailableError, ...). Each carries:
disposition: the server'seffects(none,partial,unknown) and nextaction;request_dispatched: whether the request may have reached the server;outcome_unknown: a write may have taken effect — reconcile before retrying.
The token never appears in a repr or an error message.
Cluster deployments
og.cluster.plan/apply/status/get_deployment submit and observe captured deployment bundles.
Bundles are opaque here, as in the TypeScript SDK; for operator work use
omnigraph cluster plan/apply --target NAME --config DIR.
Development
uv sync
uv run pytest # unit tests (mocked transport)
OMNIGRAPH_TEST_SERVER=1 OMNIGRAPH_BIN_DIR=/path/to/v0.14.0 uv run pytest tests/test_e2e.py
uv run python scripts/generate.py --check # generated files match spec/openapi.json
uv run mypy && uv run ruff check . && uv run ruff format --check .
spec/openapi.json is the pinned server release's document (scripts/sync_spec.py fetches it
for the version in [tool.omnigraph]); scripts/generate.py regenerates _models.py and
_version.py from it.
Metadata
Release files for omnigraph 0.14.0a1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| omnigraph-0.14.0a1.tar.gz | 144.9 kB | With provenance | Details for omnigraph-0.14.0a1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| omnigraph-0.14.0a1-py3-none-any.whl | Python 3 | none | any | Details for omnigraph-0.14.0a1-py3-none-any.whl |
Total release size: 171.9 kB
Release files / omnigraph-0.14.0a1.tar.gz
| Download URL | omnigraph-0.14.0a1.tar.gz |
|---|---|
| Size | 144.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f3e4519b90dc43887eafe9eee4a2d113789ef503976f15200925396f9879e650
|
|
BLAKE2b-256 checksum How to use checksums |
22e60b989e46c6658cf310b1d34813241ffceb7676dc036f81e211cb52585f3d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 30, 2026.
Transparency logRelease files / omnigraph-0.14.0a1-py3-none-any.whl
| Download URL | omnigraph-0.14.0a1-py3-none-any.whl |
|---|---|
| Size | 27.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a607c6f9623afabef57b8140ec1a62f2b09f63f14198b75bf000fbf2751a5e3e
|
|
BLAKE2b-256 checksum How to use checksums |
89a994ebcbddb41020f0ea0f2d8045815e0bdc1d5a5b25605adc9832d4aeb6fe
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Oct 30, 2026.
Transparency logSecurity for omnigraph 0.14.0a1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for omnigraph-0.14.0a1.tar.gz
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 Oct 30, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.