Skip to content

semantic-reasoning/PyreWire

PyreWire

Linting Status:

Tool Status
Black Black
isort isort
Flake8 Flake8
mypy mypy

A Python wrapper for wirelog - a declarative dataflow analysis engine.

Overview

PyreWire provides a Pythonic interface to wirelog, enabling you to write datalog programs and perform analysis programmatically from Python.

Installation

pip install pyrewire

Requirements: Python 3.10 or later

Quick Start

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"))

Features

  • 🎯 Easy-to-use Python API
  • 📊 Support for declarative dataflow analysis
  • ⚡ Efficient evaluation engine via wirelog
  • 🔄 Integration with Python data structures

Development

Setup

git clone https://github.com/semantic-reasoning/PyreWire
cd pyrewire
pip install -e ".[dev]"

Running Tests

pytest

Code Quality

black .
isort .
flake8 .
mypy .

Community & Contributing

We appreciate your interest in contributing to PyreWire!

License

PyreWire (Python Wrapper): dual-licensed under either of

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.

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

About

Python wrapper for wirelog

Resources

License

Unknown and 2 other licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE-APACHE
GPL-3.0
LICENSE-GPL

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages