Skip to main content

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 new Program.
  • Compound Struct values map to Python dict; field order is not preserved on round-trip.
  • WASM/server mode and Python-implemented Store backends are not exposed.

Project details


Download files

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

Source Distribution

mangle_py-0.7.1.tar.gz (216.4 kB view details)

Uploaded Source

Built Distributions

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

mangle_py-0.7.1-cp39-abi3-win_amd64.whl (534.4 kB view details)

Uploaded CPython 3.9+Windows x86-64

mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (716.2 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (697.9 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl (629.8 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl (651.3 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

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

Hashes for mangle_py-0.7.1.tar.gz
Algorithm Hash digest
SHA256 7a843699f4fdd29802dbe3999b4613a44138738fcb892370fe223f07b24bbaee
MD5 0bf080f2fee08ace6bd2d7e3fba1e9e5
BLAKE2b-256 c7e3b747521f5cd480cecd4f7caf9f6f68f00efe9d404c901ce8e8143c954906

See more details on using hashes here.

Provenance

The following attestation bundles were made for mangle_py-0.7.1.tar.gz:

Publisher: release-mangle-py.yml on burakemir/mangle-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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

Hashes for mangle_py-0.7.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 0c0fb59d72c603bd87cc2df6b9f1b8500a1bb9d711467e70c6a3a0bc1e91e4c2
MD5 c3d4dcf9763b9f9ec3bcbb0312117e8e
BLAKE2b-256 c71d09746ab9c2e30dedddf0bfbad37d4e39b62ff604fcb9ff43842ae4dcd9e2

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mangle_py-0.7.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 b707050ec4d668a7dd25cb74eee734f901df27ee9b0d8ce6e8e5c6ca7531754e
MD5 6061286df24ddddad89289650803073f
BLAKE2b-256 28afacacf33db197d599a27fbd5c31033a88427e887a418cc946cb71d9bbb604

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mangle_py-0.7.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 17685109c4fcca090ed63288f943908a063d5bcd13f41cae9fd6631c11803f0b
MD5 3b3b7a25bf376af50891897697187643
BLAKE2b-256 78e16a634d9fe5fe6c26b9a96ae9fd0f3d3c552245dad0274323675a60aadfd2

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mangle_py-0.7.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 3792f1e1da4795e51524dcd32ce4ac645619bc3ec4cee8d68c5436a527b2c355
MD5 d4cff257f55294e6ba7a7a770ac87040
BLAKE2b-256 8e9bf2e0598e69dceffa0d55e02dfa21b1a0d430ec80028636bf7dc700d944f8

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mangle_py-0.7.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 126afc56bed90fe6299629de0e21a8a1d9509029ded5cfe268920261a8c17243
MD5 b404733814dd6fbb41485bb37e7a6d13
BLAKE2b-256 8c64c48a18da3d207db80890b37f9cd12866eeacbd10b63690bf6f538f33f7ac

See more details on using hashes here.

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

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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