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.

Metadata

Release files for hale 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for hale 0.1.1
File Size Uploaded Provenance
hale-0.1.1.tar.gz 89.1 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for hale 0.1.1
File Interpreter ABI Platform
hale-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.8 abi3 Linux glibc 2.17+ x86-64 Details

Total release size: 2.3 MB

Release files / hale-0.1.1.tar.gz

Download URL hale-0.1.1.tar.gz
Size 89.1 kB
Tags Source
SHA-256 checksum
How to use checksums
14628f5be45a10cfbb7d7f8c847d0923806b0b5e546ae11d71e536097d80de34
BLAKE2b-256 checksum
How to use checksums
7ee7067747034bcb4496815e1c6357482aa7907be4586490a0c4eb9d7438892c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / hale-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL hale-0.1.1-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 2.2 MB
Tags CPython 3.8 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
0537a27626b542310ad1e8bb7ebef9d9af8cc9d42676924ed97996c4316e5313
BLAKE2b-256 checksum
How to use checksums
d612748849f916b29e83250e3fc5087c5f449497fca680b197b8a5eda94fa903
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Security for hale 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

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