hgraph
A functional reactive programming engine with a Python front-end.
This provides a DSL and runtime to support the computation of results over time, featuring a graph based directed acyclic dependency graph and the concept of time-series properties. The language is function-based, and promotes composition to extend behaviour.
Here is a simple example:
from hgraph import graph, evaluate_graph, GraphConfiguration, const, debug_print
@graph
def main():
a = const(1)
c = a + 2
debug_print("a + 2", c)
evaluate_graph(main, GraphConfiguration())
Results in:
[1970-01-01 00:00:00.000385][1970-01-01 00:00:00.000001] a + 2: 3
See this for more information.
Development
The project is currently configured to make use of uv for dependency management. Take a look at the website to see how best to install the tool.
Here are some useful commands:
First, create a virtual environment in the project directory:
uv venv
Then use the following command to install the project and its dependencies:
# Install the project with all dependencies
uv pip install -e .
# Install with optional dependencies
uv pip install -e ".[docs,web,notebook]"
# Install with all optional dependencies
uv pip install -e ".[docs,web,notebook,test]"
PyCharm can make use of the virtual environment created by uv to setup the project.
Run Tests
# No Coverage
python -m pytest
# Generate Coverage Report
python -m pytest --cov=hgraph --cov-report=xml
Indexing with Context7 MCP
This repository includes a baseline configuration for Context7 MCP to improve code search and retrieval quality.
- See docs/context7_indexing.md for guidance.
- The root-level context7.yaml config sets sensible include/exclude rules, priorities, and summarization hints.
Packaging, CI, and Releases
This project uses scikit-build-core and cibuildwheel to build and publish cross-platform wheels, with uv as the package/venv manager.
-
Local build (PEP 517):
# Build a wheel into dist/ uv build -v # Optionally build sdist too uv build -v --sdist
-
Optional Conan (developer builds only):
# Conan is not required for packaging but may be used in local builds uv tool install conan # Example of enabling Conan provider for a local build CMAKE_ARGS="-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=conan_provider.cmake" uv build -v
-
macOS notes:
- Wheels target Apple Silicon (arm64) and require a macOS deployment target high enough for libc++ floating-point
to_charsused bystd::format. - The build system enforces
MACOSX_DEPLOYMENT_TARGET=15.0(arm64) during Release Wheels and sets a default in CMake if unset. - You can override locally via:
CMAKE_ARGS="-DCMAKE_OSX_DEPLOYMENT_TARGET=15.0 -DCMAKE_OSX_ARCHITECTURES=arm64" uv build -v
- Wheels target Apple Silicon (arm64) and require a macOS deployment target high enough for libc++ floating-point
-
Windows notes:
- Build uses MSVC (Visual Studio 2022, x64). No MinGW.
- If stack traces via backward-cpp are enabled, Windows links
DbghelpandImagehlpautomatically.
-
Linux notes:
- Release wheels are built inside manylinux containers; optional
backward-cppintegrations are disabled there for portability.
- Release wheels are built inside manylinux containers; optional
CI summary
.github/workflows/release-wheels.yml is the single flow: it builds, tests, and publishes.
- Build — publish-grade wheels with cibuildwheel (Linux manylinux, macOS arm64, Windows AMD64) plus an sdist, validated with
twine checkand smoke-tested against Python 3.12, 3.13 and 3.14 on each OS. - Test — the full suite against the wheel that will actually be published, across Python 3.12, 3.13 and 3.14, under both the Python and C++ runtimes.
- Publish — to PyPI via Trusted Publishing, on a tag.
The build and test jobs are skipped when the commit being tagged has already been through them successfully, so a release publishes what was already built and tested rather than repeating it.
Releasing (tag-driven)
Releases are automated via GitHub Actions with PyPI Trusted Publishing.
Prerequisites:
- Enable Trusted Publishing for this GitHub repository in the PyPI project settings (Project → Settings → Trusted Publishers). No API token is needed once OIDC is configured.
- The tag is the version authority;
pyproject.tomldoes not need to match it. The version is stamped into the distribution metadata at publish time, which is what lets a release reuse artifacts built before the tag existed. The workflow commits the version back to the default branch afterwards.
Steps:
# Push the commit you want to release to main; that build is what gets published.
# You can tag it straight away - the release waits for that build rather than racing it.
git tag -a v_0.4.112 -m "release 0.4.112"
git push origin v_0.4.112
For a commit already built and tested on main, the workflow will:
- Find that run and skip the build and the test matrix entirely. If that build is still running, it waits for it rather than starting a second one
- Rewrite the version in the distribution metadata to match the tag, leaving the compiled extension byte-for-byte as it was built and tested
- Validate with
twine checkand publish to PyPI (skipping files that already exist)
If no such run exists — the commit was never pushed to main, or its artifacts have passed the 14-day retention window — the workflow builds and tests from source first, then publishes.
Artifacts are uploaded for inspection as part of the workflow run.
CLion configuration tips
- Use the project venv Python for nanobind discovery:
- CMake option:
-DPython_EXECUTABLE=${PROJECT_ROOT}/.venv/bin/python
- CMake option:
- If you need Conan, use the preamble to ensure Python/nanobind are discovered first, then the Conan provider:
- CMake option:
-DCMAKE_PROJECT_TOP_LEVEL_INCLUDES=${PROJECT_ROOT}/conan_preamble.cmake;${PROJECT_ROOT}/conan_provider.cmake
- CMake option:
- Select the
_hgraphtarget to build the extension.
Troubleshooting
- Nanobind not found / Python ordering in CMake:
- Pass
-DPython_EXECUTABLE=...(or-DPython3_EXECUTABLE=...) and, if using Conan, use theconan_preamble.cmakebeforeconan_provider.cmake.
- Pass
- I also find it helpful to perform an uv sync with at least --all-groups before setting up the cmake.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file hgraph-0.5.36.tar.gz.
File metadata
- Download URL: hgraph-0.5.36.tar.gz
- Upload date:
- Size: 6.0 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f43bdeed8231ebfac528ac88b43766deb09d0327cf1b0881a50ecbd29c17c89a
|
|
| MD5 |
cb639c2e44ca2051c9b53a0ab1f2e26a
|
|
| BLAKE2b-256 |
eab0cf41ce6e36b4e4101a593900ac6a27bb00b64dffacbe5c291492b88301c7
|
Provenance
The following attestation bundles were made for hgraph-0.5.36.tar.gz:
Publisher:
release-wheels.yml on hhenson/hgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hgraph-0.5.36.tar.gz -
Subject digest:
f43bdeed8231ebfac528ac88b43766deb09d0327cf1b0881a50ecbd29c17c89a - Sigstore transparency entry: 2345393935
- Sigstore integration time:
-
Permalink:
hhenson/hgraph@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Branch / Tag:
refs/tags/v_0.5.36 - Owner: https://github.com/hhenson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-wheels.yml@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hgraph-0.5.36-cp312-abi3-win_amd64.whl.
File metadata
- Download URL: hgraph-0.5.36-cp312-abi3-win_amd64.whl
- Upload date:
- Size: 1.8 MB
- Tags: CPython 3.12+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ca63a03e49f0949559cee4fb256baef240b3c5f94f72f16605cb63dc561011aa
|
|
| MD5 |
af02e5f1e12dc0b47e799ae0943c9db1
|
|
| BLAKE2b-256 |
214127bd277e9893328f6a9c857d7f87ec026714d0c92f6fb946194a3b70a031
|
Provenance
The following attestation bundles were made for hgraph-0.5.36-cp312-abi3-win_amd64.whl:
Publisher:
release-wheels.yml on hhenson/hgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hgraph-0.5.36-cp312-abi3-win_amd64.whl -
Subject digest:
ca63a03e49f0949559cee4fb256baef240b3c5f94f72f16605cb63dc561011aa - Sigstore transparency entry: 2345393953
- Sigstore integration time:
-
Permalink:
hhenson/hgraph@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Branch / Tag:
refs/tags/v_0.5.36 - Owner: https://github.com/hhenson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-wheels.yml@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hgraph-0.5.36-cp312-abi3-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: hgraph-0.5.36-cp312-abi3-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 2.5 MB
- Tags: CPython 3.12+, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b9d0598647856a0cf45402982205d7103410a8a60cdedce3aec166686c6b69a8
|
|
| MD5 |
c8d90f02a74c2ef21c49664a12d0efa2
|
|
| BLAKE2b-256 |
e53731a8a45f39e8f3323feb90edd812da8fa70c00646b2448606d4376eeb97a
|
Provenance
The following attestation bundles were made for hgraph-0.5.36-cp312-abi3-musllinux_1_2_x86_64.whl:
Publisher:
release-wheels.yml on hhenson/hgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hgraph-0.5.36-cp312-abi3-musllinux_1_2_x86_64.whl -
Subject digest:
b9d0598647856a0cf45402982205d7103410a8a60cdedce3aec166686c6b69a8 - Sigstore transparency entry: 2345394019
- Sigstore integration time:
-
Permalink:
hhenson/hgraph@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Branch / Tag:
refs/tags/v_0.5.36 - Owner: https://github.com/hhenson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-wheels.yml@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hgraph-0.5.36-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.
File metadata
- Download URL: hgraph-0.5.36-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
- Upload date:
- Size: 2.0 MB
- Tags: CPython 3.12+, manylinux: glibc 2.27+ x86-64, manylinux: glibc 2.28+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
83b0a516a6bd8b9643aa45575ac1284ae1c0507969588e49aa72b46c6f4217d6
|
|
| MD5 |
e1f0ea335e98cbf6d2a738736e85ee8c
|
|
| BLAKE2b-256 |
7240e1d5e4d6a1664637ae1b3cd3a869933f1fc39dbb002be754284e47b64161
|
Provenance
The following attestation bundles were made for hgraph-0.5.36-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:
Publisher:
release-wheels.yml on hhenson/hgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hgraph-0.5.36-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl -
Subject digest:
83b0a516a6bd8b9643aa45575ac1284ae1c0507969588e49aa72b46c6f4217d6 - Sigstore transparency entry: 2345393977
- Sigstore integration time:
-
Permalink:
hhenson/hgraph@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Branch / Tag:
refs/tags/v_0.5.36 - Owner: https://github.com/hhenson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-wheels.yml@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Trigger Event:
push
-
Statement type:
File details
Details for the file hgraph-0.5.36-cp312-abi3-macosx_15_0_arm64.whl.
File metadata
- Download URL: hgraph-0.5.36-cp312-abi3-macosx_15_0_arm64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.12+, macOS 15.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via:
twine/6.1.0 CPython/3.13.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
364bca7d41614b2c3a6c1fc3fa8a32dd65ee52d2a2449242e28e9c1817fdffb7
|
|
| MD5 |
5815de346c179f09cac1cfbb8f365539
|
|
| BLAKE2b-256 |
5a5942611f4b75a47be4db55d27a588c043e49ac6df7eaa97ec3b0199a0808dc
|
Provenance
The following attestation bundles were made for hgraph-0.5.36-cp312-abi3-macosx_15_0_arm64.whl:
Publisher:
release-wheels.yml on hhenson/hgraph
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
hgraph-0.5.36-cp312-abi3-macosx_15_0_arm64.whl -
Subject digest:
364bca7d41614b2c3a6c1fc3fa8a32dd65ee52d2a2449242e28e9c1817fdffb7 - Sigstore transparency entry: 2345393995
- Sigstore integration time:
-
Permalink:
hhenson/hgraph@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Branch / Tag:
refs/tags/v_0.5.36 - Owner: https://github.com/hhenson
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-wheels.yml@c2efd87d4397969efcb27a1debd6c217e4975b08 -
Trigger Event:
push
-
Statement type: