mangle-py
Python bindings for Mangle (Datalog-style logic language), built with PyO3 and maturin.
Build
# in crates/mangle-py
uv venv
uv pip install maturin
maturin develop --release
Then import mangle in Python.
API (v1)
import mangle
# One-shot evaluation
results = mangle.eval("p(1). p(2). q(X) :- p(X).", query="q(X)")
# Stateful program
prog = mangle.Program("p(1). q(X) :- p(X).")
prog.query("q") # -> [[1]]
prog.relations() # -> ["p", "q"]
prog.insert("p", [2]) # add EDB fact (no auto re-derivation)
prog.retract("p", [1])
# Multi-unit
prog = mangle.Program.from_units([unit_a, unit_b])
# Name constants distinct from strings
mangle.Name("/role/admin")
Limitations (v1)
- No automatic re-derivation after
insert/retract. To re-evaluate rules, create a newProgram. - Compound
Structvalues map to Pythondict; field order is not preserved on round-trip. - WASM/server mode and Python-implemented
Storebackends are not exposed.
Metadata
Release files for mangle-py 0.7.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| mangle_py-0.7.1.tar.gz | 216.4 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| mangle_py-0.7.1-cp39-abi3-win_amd64.whl | CPython 3.9 | abi3 | Windows x86-64 | Details |
| mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ x86-64 | Details |
| mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.9 | abi3 | Linux glibc 2.17+ ARM64 | Details |
| mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl | CPython 3.9 | abi3 | macOS 11.0+ ARM64 | Details |
| mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl | CPython 3.9 | abi3 | macOS 10.12+ x86-64 | Details |
Total release size: 3.4 MB
Release files / mangle_py-0.7.1.tar.gz
| Download URL | mangle_py-0.7.1.tar.gz |
|---|---|
| Size | 216.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
7a843699f4fdd29802dbe3999b4613a44138738fcb892370fe223f07b24bbaee
|
|
BLAKE2b-256 checksum How to use checksums |
c7e3b747521f5cd480cecd4f7caf9f6f68f00efe9d404c901ce8e8143c954906
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logRelease files / mangle_py-0.7.1-cp39-abi3-win_amd64.whl
| Download URL | mangle_py-0.7.1-cp39-abi3-win_amd64.whl |
|---|---|
| Size | 534.4 kB |
| Tags | CPython 3.9 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
0c0fb59d72c603bd87cc2df6b9f1b8500a1bb9d711467e70c6a3a0bc1e91e4c2
|
|
BLAKE2b-256 checksum How to use checksums |
c71d09746ab9c2e30dedddf0bfbad37d4e39b62ff604fcb9ff43842ae4dcd9e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logRelease files / mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 716.2 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
b707050ec4d668a7dd25cb74eee734f901df27ee9b0d8ce6e8e5c6ca7531754e
|
|
BLAKE2b-256 checksum How to use checksums |
28afacacf33db197d599a27fbd5c31033a88427e887a418cc946cb71d9bbb604
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logRelease files / mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 697.9 kB |
| Tags | CPython 3.9 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
17685109c4fcca090ed63288f943908a063d5bcd13f41cae9fd6631c11803f0b
|
|
BLAKE2b-256 checksum How to use checksums |
78e16a634d9fe5fe6c26b9a96ae9fd0f3d3c552245dad0274323675a60aadfd2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logRelease files / mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl
| Download URL | mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 629.8 kB |
| Tags | CPython 3.9 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
3792f1e1da4795e51524dcd32ce4ac645619bc3ec4cee8d68c5436a527b2c355
|
|
BLAKE2b-256 checksum How to use checksums |
8e9bf2e0598e69dceffa0d55e02dfa21b1a0d430ec80028636bf7dc700d944f8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency logRelease files / mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl
| Download URL | mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 651.3 kB |
| Tags | CPython 3.9 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
126afc56bed90fe6299629de0e21a8a1d9509029ded5cfe268920261a8c17243
|
|
BLAKE2b-256 checksum How to use checksums |
8c64c48a18da3d207db80890b37f9cd12866eeacbd10b63690bf6f538f33f7ac
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 4, 2026.
Transparency log