Skip to main content

No project description provided

Project description

scallopy, the Python binding for Scallop

Sample usage

from scallopy import ScallopContext

# Create new context
ctx = ScallopContext()

# Construct the program
ctx.add_relation("edge", (int, int))
ctx.add_facts("edge", [(0, 1), (1, 2), (2, 3)])
ctx.add_rule("path(a, c) = edge(a, c)")
ctx.add_rule("path(a, c) = edge(a, b), path(b, c)")

# Run the program
ctx.run()

# Inspect the result
paths = ctx.relation("path")
for (s, t) in paths:
  print(f"elem: ({s}, {t})")

Build

Make sure you are currently inside of a python virtual env, and have maturin installed. Then do

$ maturin develop --release # release is important for speed

That's it! You can then run one of our example

$ python examples/incr_edge_path.py

Documentation

Please check out the following file scallopy/scallopy.pyi for documentation.

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.

scallopy-0.1.0-cp39-cp39-macosx_11_0_arm64.whl (1.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

File details

Details for the file scallopy-0.1.0-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for scallopy-0.1.0-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c19e12b51333d9565e4e61dba2bea5bf22d2a5b40d9c078f34ff88fb91ffbf9e
MD5 63c21ae145904e746752778424cac884
BLAKE2b-256 8c35b1dad7795ee32aaa77151e6cc96bc7ab5bf0c14cc1b70bed967e54848c1a

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