Skip to main content

Python bindings for ICL (Intent Contract Language) — deterministic intent contracts

Project description

ICL Python Bindings

Python bindings for the ICL (Intent Contract Language) runtime.

Built with PyO3 + maturin — thin wrapper around the canonical Rust implementation.

Status: Alpha

This package is in early development. The API may change.

Install

pip install icl-runtime

Published on PyPI.

Or build from source (requires Rust toolchain):

pip install maturin
cd bindings/python
maturin develop

Usage

import icl
import json

contract_text = open("my-contract.icl").read()

# Parse
parsed = json.loads(icl.parse_contract(contract_text))

# Normalize (deterministic canonical form)
normalized = icl.normalize(contract_text)

# Verify (type checking, invariants, determinism)
result = json.loads(icl.verify(contract_text))
if result["valid"]:
    print("Contract is valid!")

# Execute
output = json.loads(icl.execute(contract_text, '{"operation": "greet", "inputs": {"name": "World"}}'))

# Semantic hash (SHA-256)
hash_hex = icl.semantic_hash(contract_text)

Guarantees

  • Deterministic: Same input always produces identical output
  • Identical to Rust: All results match the canonical Rust implementation exactly
  • Zero logic in bindings: All behavior comes from icl-core

Development

# Build and install in development mode
maturin develop

# Run tests
pytest tests/

# Build wheel
maturin build --release

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

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

icl_runtime-0.1.3-cp312-cp312-manylinux_2_34_x86_64.whl (508.9 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

Details for the file icl_runtime-0.1.3-cp312-cp312-manylinux_2_34_x86_64.whl.

File metadata

File hashes

Hashes for icl_runtime-0.1.3-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 b3c42a80c7d6b44997aaf666471a5d2dec1e715b8cfb552eceb00eca93943ddb
MD5 e3e18ad5c79633629162e9e6eba57b8b
BLAKE2b-256 bf6b91a731eb96fa23a98536d9b9b3125128fb55e517ef3575e6d5fb9a58e86a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page