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.2-cp312-cp312-manylinux_2_34_x86_64.whl (509.0 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.34+ x86-64

File details

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

File metadata

File hashes

Hashes for icl_runtime-0.1.2-cp312-cp312-manylinux_2_34_x86_64.whl
Algorithm Hash digest
SHA256 ed8a7f67644bff269b9861852c9ebff72a423f96e09c960bda83869b80d0a590
MD5 1e49cfd72907f6a77d0d2ce4e95aa443
BLAKE2b-256 021f1ccab9abd2554264d8b4e1188902e7716d0f2695407a83f37bef0ea33118

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