Skip to main content

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_chars used by std::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
      
  • Windows notes:

    • Build uses MSVC (Visual Studio 2022, x64). No MinGW.
    • If stack traces via backward-cpp are enabled, Windows links Dbghelp and Imagehlp automatically.
  • Linux notes:

    • Release wheels are built inside manylinux containers; optional backward-cpp integrations are disabled there for portability.

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 check and 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.toml does 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 check and 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
  • 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
  • Select the _hgraph target to build the extension.

Troubleshooting

  • Nanobind not found / Python ordering in CMake:
    • Pass -DPython_EXECUTABLE=... (or -DPython3_EXECUTABLE=...) and, if using Conan, use the conan_preamble.cmake before conan_provider.cmake.
  • 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

hgraph-0.5.38.tar.gz (6.0 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

hgraph-0.5.38-cp312-abi3-win_amd64.whl (1.8 MB view details)

Uploaded CPython 3.12+Windows x86-64

hgraph-0.5.38-cp312-abi3-musllinux_1_2_x86_64.whl (2.5 MB view details)

Uploaded CPython 3.12+musllinux: musl 1.2+ x86-64

hgraph-0.5.38-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (2.0 MB view details)

Uploaded CPython 3.12+manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

hgraph-0.5.38-cp312-abi3-macosx_15_0_arm64.whl (1.6 MB view details)

Uploaded CPython 3.12+macOS 15.0+ ARM64

File details

Details for the file hgraph-0.5.38.tar.gz.

File metadata

  • Download URL: hgraph-0.5.38.tar.gz
  • Upload date:
  • Size: 6.0 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for hgraph-0.5.38.tar.gz
Algorithm Hash digest
SHA256 44c847efdc0489c89ab9abd2571ce2ee51ffeb0488632b4c4ac7d0b6f9cdc354
MD5 2fce954a4d2d6c9fd0e3abc8e0f35d32
BLAKE2b-256 1c5a1fd8ab579e57b5a596688e8776d7ad902dc43697d374580e34fc6d5b5f42

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgraph-0.5.38.tar.gz:

Publisher: release-wheels.yml on hhenson/hgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hgraph-0.5.38-cp312-abi3-win_amd64.whl.

File metadata

  • Download URL: hgraph-0.5.38-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/7.0.0 CPython/3.13.14

File hashes

Hashes for hgraph-0.5.38-cp312-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9d46e6a416f0bf5f20f7e9a323caa1d2ac82ece1b2a0cdb5b84990f86a5194d1
MD5 22ee809e8cecd94d10778f2487c0c5aa
BLAKE2b-256 243613c66005c294160cd122bef0092144d157a4f7b905d59076c3d8833e3138

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgraph-0.5.38-cp312-abi3-win_amd64.whl:

Publisher: release-wheels.yml on hhenson/hgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hgraph-0.5.38-cp312-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for hgraph-0.5.38-cp312-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 104d39b5fc5055a21442a14facf77e56920690e40ab0618113f3f66f4e9abd24
MD5 c60e169147ffaf349b54187a4fd13a69
BLAKE2b-256 d9bc307ffe375fd07e9644e7a4250e9df2918899a7b4ec1075738361a09625e9

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgraph-0.5.38-cp312-abi3-musllinux_1_2_x86_64.whl:

Publisher: release-wheels.yml on hhenson/hgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hgraph-0.5.38-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for hgraph-0.5.38-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 75f287e32ac29c80b881bb7521e88a380ee4b85f00c423e792da15425c0b9583
MD5 e51a107f2b49576e87c287c4f6457a1a
BLAKE2b-256 69274647854d70e28dfee7e9716fd4c9f9a5ad5ebf6f43d47a60f2b4fb8363af

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgraph-0.5.38-cp312-abi3-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl:

Publisher: release-wheels.yml on hhenson/hgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file hgraph-0.5.38-cp312-abi3-macosx_15_0_arm64.whl.

File metadata

File hashes

Hashes for hgraph-0.5.38-cp312-abi3-macosx_15_0_arm64.whl
Algorithm Hash digest
SHA256 1af71cafcf99aca8cf1bc59e69482678571b346e8f0a13c1e287dee9b5fa687f
MD5 289ce9d49eb98410336622f64fba30e8
BLAKE2b-256 77d0c5b6ffb1ff897ab5b1b5a42def1ed94627c8910438be4edb934d14ef9f39

See more details on using hashes here.

Provenance

The following attestation bundles were made for hgraph-0.5.38-cp312-abi3-macosx_15_0_arm64.whl:

Publisher: release-wheels.yml on hhenson/hgraph

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.8.22

4 files

0.8.21

4 files

0.8.20

4 files

0.8.19

4 files

0.8.18

4 files

0.8.17

4 files

0.8.16

4 files

0.8.15

4 files

0.8.14

4 files

0.8.13

4 files

0.8.12

4 files

0.8.11

4 files

0.8.10

4 files

0.8.9

4 files

0.8.8

4 files

0.8.7

4 files

0.8.6

4 files

0.8.5

4 files

0.8.4

4 files

0.8.3

4 files

0.8.2

4 files

0.8.1

4 files

0.8.0

4 files

0.5.42

5 files

0.5.41

5 files

0.5.40

5 files

0.5.39

5 files

This release

0.5.38 This release

5 files

0.5.36

5 files

0.5.35

5 files

0.5.34

5 files

0.5.33

5 files

0.5.32

5 files

0.5.31

5 files

0.5.30

5 files

0.5.29

5 files

0.5.28

5 files

0.5.27

5 files

0.5.26

5 files

0.5.25

5 files

0.5.24

5 files

0.5.23

5 files

0.5.22

5 files

0.5.21

5 files

0.5.20

5 files

0.5.19

5 files

0.5.18

5 files

0.5.17

5 files

0.5.16

5 files

0.5.15

5 files

0.5.14

5 files

0.5.13

5 files

0.5.12

5 files

0.5.11

5 files

0.5.10

5 files

0.5.9

5 files

0.5.8

5 files

0.5.7

5 files

0.5.6

5 files

0.5.5

5 files

0.5.4

5 files

0.5.3

5 files

0.5.2

5 files

0.5.1

5 files

0.5.0

5 files

0.4.102

6 files

0.4.101

2 files

0.4.100

2 files

0.4.99

2 files

0.4.98

2 files

0.4.97

2 files

0.4.96

2 files

0.4.95

2 files

0.4.94

2 files

0.4.93

2 files

0.4.92

2 files

0.4.91

2 files

0.4.90

2 files

0.4.89

2 files

0.4.88

2 files

0.4.87

2 files

0.4.86

2 files

0.4.85

2 files

0.4.84

2 files

0.4.83

2 files

0.4.82

2 files

0.4.81

2 files

0.4.80

2 files

0.4.79

2 files

0.4.78

2 files

0.4.77

2 files

0.4.76

2 files

0.4.75

2 files

0.4.74

2 files

0.4.73

2 files

0.4.72

2 files

0.4.71

2 files

0.4.70

2 files

0.4.69

2 files

0.4.68

2 files

0.4.67

2 files

0.4.66

2 files

0.4.65

2 files

0.4.64

2 files

0.4.63

2 files

0.4.62

2 files

0.4.61

2 files

0.4.60

2 files

0.4.59

2 files

0.4.58

2 files

0.4.57

2 files

0.4.56

2 files

0.4.55

2 files

0.4.54

2 files

0.4.53

2 files

0.4.52

2 files

0.4.51

2 files

0.4.50

2 files

0.4.49

2 files

0.4.48

2 files

0.4.47

2 files

0.4.46

2 files

0.4.45

2 files

0.4.44

2 files

0.4.43

2 files

0.4.42

2 files

0.4.41

2 files

0.4.40

2 files

0.4.39

2 files

0.4.38

2 files

0.4.37

2 files

0.4.36

2 files

0.4.35

2 files

0.4.34

2 files

0.4.32

2 files

0.4.31

2 files

0.4.30

2 files

0.4.29

2 files

0.4.28

2 files

0.4.27

2 files

0.4.26

2 files

0.4.25

2 files

0.4.24

2 files

0.4.23

2 files

0.4.22

2 files

0.4.21

2 files

0.4.20

2 files

0.4.19

2 files

0.4.18

2 files

0.4.17

2 files

0.4.16

2 files

0.4.15

2 files

0.4.14

2 files

0.4.13

2 files

0.4.12

2 files

0.4.11

2 files

0.4.10

2 files

0.4.9

2 files

0.4.8

2 files

0.4.7

2 files

0.4.6

2 files

0.4.5

2 files

0.4.4

2 files

0.4.3

2 files

0.4.2

2 files

0.4.1

2 files

0.4.0

2 files

0.3.60

2 files

0.3.59

2 files

0.3.58

2 files

0.3.57

2 files

0.3.56

2 files

0.3.55

2 files

0.3.54

2 files

0.3.53

2 files

0.3.52

2 files

0.3.51

2 files

0.3.50

2 files

0.3.49

2 files

0.3.48

2 files

0.3.47

2 files

0.3.46

2 files

0.3.45

2 files

0.3.44

2 files

0.3.43

2 files

0.3.42

2 files

0.3.41

2 files

0.3.40

2 files

0.3.38

2 files

0.3.37

2 files

0.3.35

2 files

0.3.34

2 files

0.3.33

2 files

0.3.32

2 files

0.3.31

2 files

0.3.30

2 files

0.3.28

2 files

0.3.27

2 files

0.3.26

2 files

0.3.25

2 files

0.3.24

2 files

0.3.23

2 files

0.3.21

2 files

0.3.20

2 files

0.3.19

2 files

0.3.18

2 files

0.3.17

2 files

0.3.16

2 files

0.3.15

2 files

0.3.14

2 files

0.3.13

2 files

0.3.12

2 files

0.3.11

2 files

0.3.10

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.54

2 files

0.2.53

2 files

0.2.52

2 files

0.2.51

2 files

0.2.50

2 files

0.2.49

2 files

0.2.48

2 files

0.2.47

2 files

0.2.46

2 files

0.2.45

2 files

0.2.44

2 files

0.2.43

2 files

0.2.42

2 files

0.2.41

2 files

0.2.40

2 files

0.2.39

2 files

0.2.38

2 files

0.2.37

2 files

0.2.36

2 files

0.2.34

2 files

0.2.33

2 files

0.2.32

2 files

0.2.31

2 files

0.2.30

2 files

0.2.29

2 files

0.2.28

2 files

0.2.27

2 files

0.2.26

2 files

0.2.25

2 files

0.2.24

2 files

0.2.23

2 files

0.2.22

2 files

0.2.21

2 files

0.2.20

2 files

0.2.19

2 files

0.2.18

2 files

0.2.17

2 files

0.2.16

2 files

0.2.15

2 files

0.2.14

2 files

0.2.13

2 files

0.2.12

2 files

0.2.11

2 files

0.2.10

2 files

0.2.9

2 files

0.2.8

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

1 file

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.19

2 files

0.1.18

2 files

0.1.17

2 files

0.1.16

2 files

0.1.15

2 files

0.1.14

2 files

0.1.13

2 files

0.1.12

2 files

0.1.11

2 files

0.1.10

2 files

0.1.9

2 files

0.1.8

2 files

0.1.7

2 files

0.1.6

2 files

0.1.5

2 files

0.1.4

2 files

0.1.3

2 files

0.1.2

2 files

0.1.1

2 files

0.1.0

2 files

0.0.11

2 files

0.0.10

2 files

0.0.9

2 files

0.0.8

2 files

0.0.7

2 files

0.0.6

2 files

0.0.5

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 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