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 Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

pydatalog-0.20.3-cp313-cp313-win32.whl (570.7 kB view details)

Uploaded CPython 3.13Windows x86

pydatalog-0.20.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (2.0 MB view details)

Uploaded CPython 3.13manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pydatalog-0.20.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (2.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pydatalog-0.20.3-cp311-cp311-win_amd64.whl (613.4 kB view details)

Uploaded CPython 3.11Windows x86-64

pydatalog-0.20.3-cp311-cp311-musllinux_1_2_i686.whl (2.2 MB view details)

Uploaded CPython 3.11musllinux: musl 1.2+ i686

pydatalog-0.20.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ x86-64

pydatalog-0.20.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (2.2 MB view details)

Uploaded CPython 3.11manylinux: glibc 2.17+ i686manylinux: glibc 2.5+ i686

pydatalog-0.20.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.9manylinux: glibc 2.17+ x86-64

File details

Details for the file pydatalog-0.20.3-cp313-cp313-win32.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp313-cp313-win32.whl
  • Upload date:
  • Size: 570.7 kB
  • Tags: CPython 3.13, 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.3-cp313-cp313-win32.whl
Algorithm Hash digest
SHA256 3190055e0b78f25a521fb30d281f89cc3c4e714f6f8995a0efdd04eb6250412a
MD5 350ff7f2dd86de172e93ab2452028278
BLAKE2b-256 bd7205a8c5b43e009cef011884119a5088e4d1a3a5c3ef5a4d3a006e75423106

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.13, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
  • 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.3-cp313-cp313-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 10a55516e22a76d524cfab4df6b82e0a19a9c8d56f50610b2de28e195d9f8c80
MD5 f6571dbf28583d2783240623e0a561b7
BLAKE2b-256 7b7be46cd0d0e579524f6965a483dd9cc9b6a7e401c6d0b515242bab046db6ea

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.12, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
  • 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.3-cp312-cp312-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1ec9c5bf8a022966a416ccbd512e7cf1b3fca33f179a2e7f13e485b95bdb5ed6
MD5 6b985e3d379107878b366e03f3a87288
BLAKE2b-256 5086e6aabf448791373b1596fabe38dfb86f26c2e20f0d0f90229f7beb732c9f

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.3-cp311-cp311-win_amd64.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp311-cp311-win_amd64.whl
  • Upload date:
  • Size: 613.4 kB
  • Tags: CPython 3.11, Windows x86-64
  • 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.3-cp311-cp311-win_amd64.whl
Algorithm Hash digest
SHA256 b1d5da49ddb5416bd318dc96050c7ee888581cec8765ff8c98e6ecd3bf7acaea
MD5 5e26a5f89a2abf0e3560fbf610861414
BLAKE2b-256 de39ce1f45bc8175a587c4e193ceabd426c617f298a11ff0afb1f60e574bda91

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.3-cp311-cp311-musllinux_1_2_i686.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp311-cp311-musllinux_1_2_i686.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.11, musllinux: musl 1.2+ i686
  • 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.3-cp311-cp311-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 5602c4d6397ad393293979e164d814d5118a136ff4b65bedeaa09e8c061f3980
MD5 714ffe15233000da73d725a42d397735
BLAKE2b-256 fb227f67476fb6bdb43959f1f453c739249232c3291bb50f654328ba30612676

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ x86-64
  • 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.3-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3ab1aa0bceedf9f0a7d1d39a7e802aa322fd61afdf4b53eebdab31f98ca1b1cc
MD5 a57416cc3efcac7df952159b1a8c50d5
BLAKE2b-256 a1669b5ebd404e4809bef2d3390338fe6d8bc91d1994e53519ddab3b554bfe08

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
  • Upload date:
  • Size: 2.2 MB
  • Tags: CPython 3.11, manylinux: glibc 2.17+ i686, manylinux: glibc 2.5+ i686
  • 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.3-cp311-cp311-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 2183f9e38a3b4e415116de381e7c2ad154e5e68fc3b3d048a546a04bee76170d
MD5 97141e2641bbc66bef99ce95b6659346
BLAKE2b-256 e636a2f7bfee8da3580b88546839124902badbbeab6a8f94ad0837fe07536d31

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

  • Download URL: pydatalog-0.20.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.9, manylinux: glibc 2.17+ x86-64
  • 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.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 415d47ce15b7b64eedbaeff6e8494bf3338dccd9a970be925fb2adaa46d8464b
MD5 ced1f73bfdf8b73c60c1da0ed99009c9
BLAKE2b-256 3935f183c366e45ebd1b6d42cd0852313188f9d5ff7c2147e2a88993d19ef008

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