Skip to main content

A pure-python implementation of Datalog, a truly declarative language derived from Prolog.

Project description

pyDatalog

Build Status Documentation Status PyPI version Python Versions License

[!NOTE] In view of the 300 stars on GitHub (Thanks !!), I have restarted support of this package in June 2026.

Installation

You can install pyDatalog from PyPI using pip:

pip install pyDatalog

Or using uv:

uv add pyDatalog

[!NOTE] Pre-compiled binary wheels are provided for most common platforms and Python versions. If a compatible wheel is not available, the package manager will fall back to building from the source distribution (sdist), which requires a C compiler to compile the speed-up extension. If compilation fails, it will gracefully fall back to a pure-Python implementation.

Description

pyDatalog adds the logic programming paradigm to Python's toolbox, in a pythonic way. You can now run logic queries on databases or Python objects, and use logic clauses to define python classes. In particular, pyDatalog can be used as a query language:

  • it can perform multi-database queries (from memory datastore, 11 relational databases, and noSQL database with appropriate connectors)
  • it is more expressive than SQL, with a cleaner syntax;
  • it facilitates re-use of SQL code snippet (e.g. for frequent joins or formula);

Datalog = SQL + recursivity

Datalog is a truly declarative language derived from Prolog, with strong academic foundations. It complements Python very well for:

  • managing complex sets of related information (e.g. in data integration or the semantic web).
  • simulating intelligent behavior (e.g. in games),
  • performing recursive algorithms (e.g. in network protocol, code and graph analysis, parsing)
  • solving discrete constraint problems.

As simple as Excel

Datalog excels at accelerated development: Datalog programs are often shorter than their Python equivalent, and Datalog statements can be specified in any order, as simply as formula in a spreadsheet.

Testimonials

pyDatalog is cited in several scientific papers !

"Very neat. Datalog rocks" - Marck Carter. He has written a nice blog entry on unit conversion with Datalog.

"Congratulations for your wonderful work done in pyDatalog project" - Karamajit Kaur, researcher in India

You are also using pyDatalog ? Let us know.

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

pydatalog-0.20.0.tar.gz (385.2 kB view details)

Uploaded Source

Built Distribution

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

pydatalog-0.20.0-cp39-cp39-win32.whl (586.5 kB view details)

Uploaded CPython 3.9Windows x86

File details

Details for the file pydatalog-0.20.0.tar.gz.

File metadata

  • Download URL: pydatalog-0.20.0.tar.gz
  • Upload date:
  • Size: 385.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pydatalog-0.20.0.tar.gz
Algorithm Hash digest
SHA256 58bfd7e9b94e06b040ada5219252bf9646beaae48e63e3d7382d268a2017a02f
MD5 8fcf919acf866ec4ebf595565e471473
BLAKE2b-256 b20382e0c4d37af455eb7317fea87b9193d705c1897b675dfc7e4d035fbac8fd

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.0-cp39-cp39-win32.whl.

File metadata

  • Download URL: pydatalog-0.20.0-cp39-cp39-win32.whl
  • Upload date:
  • Size: 586.5 kB
  • Tags: CPython 3.9, Windows x86
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.11.19 {"installer":{"name":"uv","version":"0.11.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for pydatalog-0.20.0-cp39-cp39-win32.whl
Algorithm Hash digest
SHA256 2bf725db611e20eec720c214352c75885d3107f9547296f4a2362fe2bd1a8747
MD5 3561adbafbc6f44c8270273698c7854c
BLAKE2b-256 610b0015c8de212677c87f466877831e4ee44c2bfa1665226d2406330e4977ff

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