Python bindings for hale — a compiled DSL for consuming HTTP APIs (Rust core)
Project description
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.runspins a Tokio runtime internally, so the same parallel-inference / dedup / dead-request elimination apply when you execute a program from Python.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
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 hale-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: hale-0.1.0-cp38-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 2.2 MB
- Tags: CPython 3.8+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6229d5ba73b2d3a46c3df99ed7eaa75219b5f87f5ee77ee286f641468d1c4e4e
|
|
| MD5 |
d876396c4aba41d4a61c01d674bff5e3
|
|
| BLAKE2b-256 |
5eb61168c4fa5b66da587d898649b58b7879fe97181312756b03b5bd696269b6
|