Python bindings for Mangle, a Datalog-style logic language. Import as `import mangle`.
Project description
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.
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 Distribution
Built Distributions
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 mangle_py-0.7.1.tar.gz.
File metadata
- Download URL: mangle_py-0.7.1.tar.gz
- Upload date:
- Size: 216.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7a843699f4fdd29802dbe3999b4613a44138738fcb892370fe223f07b24bbaee
|
|
| MD5 |
0bf080f2fee08ace6bd2d7e3fba1e9e5
|
|
| BLAKE2b-256 |
c7e3b747521f5cd480cecd4f7caf9f6f68f00efe9d404c901ce8e8143c954906
|
Provenance
The following attestation bundles were made for mangle_py-0.7.1.tar.gz:
Publisher:
release-mangle-py.yml on burakemir/mangle-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mangle_py-0.7.1.tar.gz -
Subject digest:
7a843699f4fdd29802dbe3999b4613a44138738fcb892370fe223f07b24bbaee - Sigstore transparency entry: 1437659831
- Sigstore integration time:
-
Permalink:
burakemir/mangle-rs@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Branch / Tag:
refs/tags/mangle-py-v0.7.1 - Owner: https://github.com/burakemir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mangle-py.yml@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Trigger Event:
push
-
Statement type:
File details
Details for the file mangle_py-0.7.1-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: mangle_py-0.7.1-cp39-abi3-win_amd64.whl
- Upload date:
- Size: 534.4 kB
- Tags: CPython 3.9+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0c0fb59d72c603bd87cc2df6b9f1b8500a1bb9d711467e70c6a3a0bc1e91e4c2
|
|
| MD5 |
c3d4dcf9763b9f9ec3bcbb0312117e8e
|
|
| BLAKE2b-256 |
c71d09746ab9c2e30dedddf0bfbad37d4e39b62ff604fcb9ff43842ae4dcd9e2
|
Provenance
The following attestation bundles were made for mangle_py-0.7.1-cp39-abi3-win_amd64.whl:
Publisher:
release-mangle-py.yml on burakemir/mangle-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mangle_py-0.7.1-cp39-abi3-win_amd64.whl -
Subject digest:
0c0fb59d72c603bd87cc2df6b9f1b8500a1bb9d711467e70c6a3a0bc1e91e4c2 - Sigstore transparency entry: 1437659840
- Sigstore integration time:
-
Permalink:
burakemir/mangle-rs@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Branch / Tag:
refs/tags/mangle-py-v0.7.1 - Owner: https://github.com/burakemir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mangle-py.yml@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Trigger Event:
push
-
Statement type:
File details
Details for the file mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 716.2 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b707050ec4d668a7dd25cb74eee734f901df27ee9b0d8ce6e8e5c6ca7531754e
|
|
| MD5 |
6061286df24ddddad89289650803073f
|
|
| BLAKE2b-256 |
28afacacf33db197d599a27fbd5c31033a88427e887a418cc946cb71d9bbb604
|
Provenance
The following attestation bundles were made for mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release-mangle-py.yml on burakemir/mangle-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
b707050ec4d668a7dd25cb74eee734f901df27ee9b0d8ce6e8e5c6ca7531754e - Sigstore transparency entry: 1437659836
- Sigstore integration time:
-
Permalink:
burakemir/mangle-rs@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Branch / Tag:
refs/tags/mangle-py-v0.7.1 - Owner: https://github.com/burakemir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mangle-py.yml@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Trigger Event:
push
-
Statement type:
File details
Details for the file mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 697.9 kB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
17685109c4fcca090ed63288f943908a063d5bcd13f41cae9fd6631c11803f0b
|
|
| MD5 |
3b3b7a25bf376af50891897697187643
|
|
| BLAKE2b-256 |
78e16a634d9fe5fe6c26b9a96ae9fd0f3d3c552245dad0274323675a60aadfd2
|
Provenance
The following attestation bundles were made for mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release-mangle-py.yml on burakemir/mangle-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
17685109c4fcca090ed63288f943908a063d5bcd13f41cae9fd6631c11803f0b - Sigstore transparency entry: 1437659835
- Sigstore integration time:
-
Permalink:
burakemir/mangle-rs@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Branch / Tag:
refs/tags/mangle-py-v0.7.1 - Owner: https://github.com/burakemir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mangle-py.yml@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Trigger Event:
push
-
Statement type:
File details
Details for the file mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 629.8 kB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3792f1e1da4795e51524dcd32ce4ac645619bc3ec4cee8d68c5436a527b2c355
|
|
| MD5 |
d4cff257f55294e6ba7a7a770ac87040
|
|
| BLAKE2b-256 |
8e9bf2e0598e69dceffa0d55e02dfa21b1a0d430ec80028636bf7dc700d944f8
|
Provenance
The following attestation bundles were made for mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release-mangle-py.yml on burakemir/mangle-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
3792f1e1da4795e51524dcd32ce4ac645619bc3ec4cee8d68c5436a527b2c355 - Sigstore transparency entry: 1437659843
- Sigstore integration time:
-
Permalink:
burakemir/mangle-rs@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Branch / Tag:
refs/tags/mangle-py-v0.7.1 - Owner: https://github.com/burakemir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mangle-py.yml@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Trigger Event:
push
-
Statement type:
File details
Details for the file mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 651.3 kB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
126afc56bed90fe6299629de0e21a8a1d9509029ded5cfe268920261a8c17243
|
|
| MD5 |
b404733814dd6fbb41485bb37e7a6d13
|
|
| BLAKE2b-256 |
8c64c48a18da3d207db80890b37f9cd12866eeacbd10b63690bf6f538f33f7ac
|
Provenance
The following attestation bundles were made for mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
release-mangle-py.yml on burakemir/mangle-rs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
126afc56bed90fe6299629de0e21a8a1d9509029ded5cfe268920261a8c17243 - Sigstore transparency entry: 1437659837
- Sigstore integration time:
-
Permalink:
burakemir/mangle-rs@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Branch / Tag:
refs/tags/mangle-py-v0.7.1 - Owner: https://github.com/burakemir
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-mangle-py.yml@00c536aa92da686e7c26fa6cbe3d23de6e7d7adc -
Trigger Event:
push
-
Statement type: