Skip to main content

hale (Python bindings)

Call the hale compiler and runtime from Python. The heavy lifting (lexer, type checker, optimizer, async runtime) is the same Rust code as the CLI — exposed through PyO3 as an abi3 extension module, so one wheel works on CPython 3.8+.

Install / build

pip install maturin
cd crates/hale-py
maturin develop        # builds the Rust extension and installs `hale` into your venv
# or: maturin build --release   # produces a wheel in target/wheels/

Use

import hale

hale.is_valid(src)            # -> bool: does it type-check?
hale.check(src)               # -> list[str]: diagnostic messages (empty == ok)
hale.explain(src)             # -> str: the parallel plan + request cost
hale.run(src)                 # -> str | None: run the script (raises on error)
hale.inspect(json_text, name) # -> str: infer hale type/contract declarations
hale.json_schema(src, title)  # -> str | None: export types as JSON Schema

See python/example.py.

The functions are thin wrappers over hale_compiler / hale_runtime. run spins a Tokio runtime internally, so the same parallel-inference / dedup / dead-request elimination apply when you execute a program from Python.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hale-0.1.1.tar.gz (89.1 kB view details)

Uploaded Source

Built Distribution

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

hale-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.8+manylinux: glibc 2.17+ x86-64

File details

Details for the file hale-0.1.1.tar.gz.

File metadata

  • Download URL: hale-0.1.1.tar.gz
  • Upload date:
  • Size: 89.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.12

File hashes

Hashes for hale-0.1.1.tar.gz
Algorithm Hash digest
SHA256 14628f5be45a10cfbb7d7f8c847d0923806b0b5e546ae11d71e536097d80de34
MD5 719d01f1d06a88428e9d1b8a9f7f80ae
BLAKE2b-256 7ee7067747034bcb4496815e1c6357482aa7907be4586490a0c4eb9d7438892c

See more details on using hashes here.

File details

Details for the file hale-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for hale-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 0537a27626b542310ad1e8bb7ebef9d9af8cc9d42676924ed97996c4316e5313
MD5 37318f6c74ddfa221137d1b4ffaf37ba
BLAKE2b-256 d612748849f916b29e83250e3fc5087c5f449497fca680b197b8a5eda94fa903

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 files

0.1.0

1 file

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