Linting Status:
| Tool | Status |
|---|---|
| Black | |
| isort | |
| Flake8 | |
| mypy |
A Python wrapper for wirelog - a declarative dataflow analysis engine.
PyreWire provides a Pythonic interface to wirelog, enabling you to write datalog programs and perform analysis programmatically from Python.
pip install pyrewireRequirements: Python 3.10 or later
from pyrewire import Program
# Create a new program
program = Program()
# Define relations
program.declare_relation("edge", [("x", "int32"), ("y", "int32")])
program.declare_relation("reach", [("x", "int32")])
# Add facts
program.add_fact("edge", [1, 2])
program.add_fact("edge", [2, 3])
# Add rules
program.add_rule("reach(1).")
program.add_rule("reach(Y) :- reach(X), edge(X, Y).")
# Execute
results = program.evaluate()
print(results.get_relation("reach"))- 🎯 Easy-to-use Python API
- 📊 Support for declarative dataflow analysis
- ⚡ Efficient evaluation engine via wirelog
- 🔄 Integration with Python data structures
git clone https://github.com/semantic-reasoning/PyreWire
cd pyrewire
pip install -e ".[dev]"pytestblack .
isort .
flake8 .
mypy .We appreciate your interest in contributing to PyreWire!
- Contributing Guide: Learn how to set up development, run tests, and submit pull requests
- Code of Conduct: Read our community standards and expected behavior
- Security Policy: Report security vulnerabilities responsibly
PyreWire (Python Wrapper): dual-licensed under either of
- Apache License, Version 2.0
- GNU General Public License, version 3 or (at your option) any later version
at your option.
wirelog (Core Engine): LGPL-3.0 / Commercial Dual License
Note: PyreWire links to the wirelog core engine. Use of the core engine is subject to its respective license terms.
Contributions are welcome! Please open an issue or submit a pull request.