rusty-haystack
Fast Python bindings for Project Haystack powered by Rust.
Provides types, codecs (Zinc/Trio/JSON/JSON v3/CSV), filters, an in-memory entity graph, ontology validation, and Xeto support — all backed by a native Rust core for speed and correctness.
Installation
pip install rusty-haystack
Requires Python 3.11+. Pre-built wheels are available for Linux and macOS (x86_64 and aarch64).
Quick Start
import rusty_haystack as rh
# Create an entity
entity = rh.HDict({
"id": rh.Ref("site-1", "Demo Site"),
"site": rh.Marker(),
"dis": "Demo Site",
"area": rh.Number(5000, "ft²"),
"geoCoord": rh.Coord(40.7128, -74.0060),
})
# Build a graph and query it
graph = rh.EntityGraph()
graph.add(entity)
results = graph.read("site")
# Encode/decode across formats
zinc_str = rh.encode_grid("text/zinc", results)
json_str = rh.encode_grid("application/json", results)
decoded = rh.decode_grid("text/zinc", zinc_str)
# Validate against the standard ontology
ns = rh.DefNamespace.load_standard()
issues = ns.validate_entity(entity)
Features
- Kind types — Marker, NA, Remove, Number (with units), Ref, Uri, Symbol, XStr, Coord, HDateTime, HDict, HGrid, HList
- Codecs — Zinc, Trio, JSON, JSON v3, CSV encoding and decoding
- Filters — Parse and evaluate Haystack filter expressions against entities
- EntityGraph — In-memory graph with CRUD, filter queries, and ref traversal
- Ontology — DefNamespace with
is_a,fits,validate_entity, subtype/supertype queries - Xeto — Load/unload Xeto libraries, inspect specs and slots, export to Xeto source
Codecs
Supported MIME types: "text/zinc", "text/trio", "application/json", "application/json;v=3", "text/csv".
# Grid encode/decode
zinc_str = rh.encode_grid("text/zinc", grid)
grid = rh.decode_grid("text/zinc", zinc_str)
# Scalar encode/decode
s = rh.encode_scalar("text/zinc", rh.Number(72.5, "°F"))
v = rh.decode_scalar("text/zinc", s)
EntityGraph
graph = rh.EntityGraph()
graph.add(rh.HDict({"id": rh.Ref("site-1"), "site": rh.Marker(), "dis": "HQ"}))
graph.add(rh.HDict({"id": rh.Ref("ahu-1"), "equip": rh.Marker(), "siteRef": rh.Ref("site-1")}))
results = graph.read("equip") # filter query
graph.refs_from("ahu-1") # -> ["site-1"]
graph.refs_to("site-1") # -> ["ahu-1"]
Ontology & Xeto
ns = rh.DefNamespace.load_standard()
ns.is_a("ahu", "equip") # True
ns.fits(entity, "site") # True
ns.subtypes("equip") # ["ahu", "vav", ...]
ns.validate_entity(entity) # list of issue strings
# Load custom Xeto libraries
ns.load_xeto(source_text, "myLib")
spec = ns.get_spec("myLib::MyType")
License
MIT
Metadata
Release files for rusty-haystack 0.7.2
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| rusty_haystack-0.7.2.tar.gz | 475.9 kB | Details |
Built distributions (wheels)
Total release size: 80.6 MB
Release files / rusty_haystack-0.7.2.tar.gz
| Download URL | rusty_haystack-0.7.2.tar.gz |
|---|---|
| Size | 475.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ab6e7da9d3d5b1287e8462ecbdadc3b8794666f057e974bb5f9fa645ac887b0a
|
|
BLAKE2b-256 checksum How to use checksums |
e341c7f7a7818bca3fd184faf7fb05deb18c60e4e76f7241657a2e949a39d331
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rusty_haystack-0.7.2-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
65626ccf321af4f7231b9dbdf87fe6edbd7cec8317c866989bc30b07360e5b90
|
|
BLAKE2b-256 checksum How to use checksums |
e9c9ba609206c7e5c495229e7cd79c68f9493dd12b3fafb70e07cc5223e9e9ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rusty_haystack-0.7.2-cp313-cp313-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.9 MB |
| Tags | CPython 3.13 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
abb49945c2cdfd461c099406ff21557ba3948725f66c98ad34754b42b71d84ed
|
|
BLAKE2b-256 checksum How to use checksums |
fde672ab8af671f7914f1a10d40583a26bb774a9db7ed812c8428aa7edca02a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp313-cp313-macosx_11_0_arm64.whl
| Download URL | rusty_haystack-0.7.2-cp313-cp313-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.13 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
e9926f93b53318d13f4f704124a8b5e8e22a0b74ac7c72710b821ebadc454c7a
|
|
BLAKE2b-256 checksum How to use checksums |
937f836110a1f21f5aa83a4bad8abd7ff11fa0b2182303e959eae3659d491748
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp313-cp313-macosx_10_12_x86_64.whl
| Download URL | rusty_haystack-0.7.2-cp313-cp313-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.6 MB |
| Tags | CPython 3.13 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
ce40d44a55918e025a342e747e922178c4328bf25aefeaedfc70df7272efac75
|
|
BLAKE2b-256 checksum How to use checksums |
e2045c388b7a700448a2c6bfe7ac0c66feb64d028c24efd929532596dc55724b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rusty_haystack-0.7.2-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
1b041070d10ccea29785b90f40c9ee5c55488cdd17a04804778276c63ba84428
|
|
BLAKE2b-256 checksum How to use checksums |
25d77207ec82e9b79dfceb6ac7c10379ea4c3292c81fa2846fb3b54a1eba6dc2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rusty_haystack-0.7.2-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.9 MB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
4decd391c6321e0912d942d3c49919c3066f06b8c72f9375e4f0c64c0c42ee04
|
|
BLAKE2b-256 checksum How to use checksums |
b7214da1836e4b060d4b358b1922f4d92d7a41ad7f94486518c9aba156c6f3e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp312-cp312-macosx_11_0_arm64.whl
| Download URL | rusty_haystack-0.7.2-cp312-cp312-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.12 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
c5d9959935e65a8b3fc3280d14e58382ca86a08a4b78b82b7431c9978098b6f7
|
|
BLAKE2b-256 checksum How to use checksums |
c2ddbedb28bc4567b0a86d4326a1ea6c294b92eff9cf8289d21b98edc4b5381c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp312-cp312-macosx_10_12_x86_64.whl
| Download URL | rusty_haystack-0.7.2-cp312-cp312-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.6 MB |
| Tags | CPython 3.12 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
88c5a78a73f2f6d2d7559e601a63e6f64d95397d3ce8853fb78ba63a25b20430
|
|
BLAKE2b-256 checksum How to use checksums |
4cf44d7000760ee267be3402ed36c1aa2c3845a461af7ceff049d201a55c80a8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | rusty_haystack-0.7.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 7.0 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ x86-64 |
|
SHA-256 checksum How to use checksums |
ea1dcbb64fed950ea327057a0e01ec31de9b465a02006ed843d99d0f492c7260
|
|
BLAKE2b-256 checksum How to use checksums |
f36b67f395666e69c2ba12ca45fb316d2d3f335650107b899f8becc7b50d8e0f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | rusty_haystack-0.7.2-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 6.9 MB |
| Tags | CPython 3.11 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
6a5a12f721e47ca325729a0020a4487d7cb4d69cd1c38fb3232f2e865b566a1a
|
|
BLAKE2b-256 checksum How to use checksums |
1a3c8305e88bba38bdd966b4925672c22d8f2191ff21fa20cc828332bece4508
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp311-cp311-macosx_11_0_arm64.whl
| Download URL | rusty_haystack-0.7.2-cp311-cp311-macosx_11_0_arm64.whl |
|---|---|
| Size | 6.2 MB |
| Tags | CPython 3.11 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4a6236b2d569499d85e6f36efeb499d36c0cc4f2b5118ed84893d6318f73f340
|
|
BLAKE2b-256 checksum How to use checksums |
91c6c9baf611bdeb64b7e8effe78100f82f3325476e9e21dbc6252686ca7785a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency logRelease files / rusty_haystack-0.7.2-cp311-cp311-macosx_10_12_x86_64.whl
| Download URL | rusty_haystack-0.7.2-cp311-cp311-macosx_10_12_x86_64.whl |
|---|---|
| Size | 6.6 MB |
| Tags | CPython 3.11 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
8f9557160dc552bb48b67177286dafd8f8696eb1002f292e73123302399a18de
|
|
BLAKE2b-256 checksum How to use checksums |
b9654a0944646acc7766c520076e744b2933039f2afbed2f8580630721054d8a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 Mar 3, 2026.
Transparency log