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.6-cp313-cp313-musllinux_1_2_x86_64.whl (2.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ x86-64

pydatalog-0.20.6-cp313-cp313-musllinux_1_2_i686.whl (2.1 MB view details)

Uploaded CPython 3.13musllinux: musl 1.2+ i686

pydatalog-0.20.6-cp312-cp312-win32.whl (570.8 kB view details)

Uploaded CPython 3.12Windows x86

pydatalog-0.20.6-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.6-cp310-cp310-macosx_11_0_arm64.whl (645.3 kB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

pydatalog-0.20.6-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

pydatalog-0.20.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl (2.0 MB view details)

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

File details

Details for the file pydatalog-0.20.6-cp313-cp313-musllinux_1_2_x86_64.whl.

File metadata

  • Download URL: pydatalog-0.20.6-cp313-cp313-musllinux_1_2_x86_64.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, musllinux: musl 1.2+ 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.6-cp313-cp313-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 5f732b968a6ce77728417d3e3546fa039d802adc13209f2ae935af9191f8efe9
MD5 377e558dbf52ae6103319ed66023959d
BLAKE2b-256 3d64e5948a24a9fa605b74ab9873bcd87c5dc6154c5c2be0655b02a9ce1021b6

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.6-cp313-cp313-musllinux_1_2_i686.whl.

File metadata

  • Download URL: pydatalog-0.20.6-cp313-cp313-musllinux_1_2_i686.whl
  • Upload date:
  • Size: 2.1 MB
  • Tags: CPython 3.13, 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.6-cp313-cp313-musllinux_1_2_i686.whl
Algorithm Hash digest
SHA256 42d378b68148935d06b0ddbd5a8a60ebe5beb2cde0a6883df5b82b01b7b95c96
MD5 2a8b43437c5b51e607a13aec13283e81
BLAKE2b-256 72b8e2aa97745dcbd086e819adafed975e055972dfaffc253a6f3cc9bc6a44ba

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.6-cp312-cp312-win32.whl.

File metadata

  • Download URL: pydatalog-0.20.6-cp312-cp312-win32.whl
  • Upload date:
  • Size: 570.8 kB
  • Tags: CPython 3.12, 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.6-cp312-cp312-win32.whl
Algorithm Hash digest
SHA256 84edd97635a9d385f55c1e2b2b4d1e1427d44b8906e35224ac70ac2be3093a52
MD5 e93176f86c7e9d789e40c41cc093b63b
BLAKE2b-256 60e70b27bba167a682290811199cf6ebe6e6ac96b5f4cd5fced31a8f067d8061

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydatalog-0.20.6-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.6-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 bc9f8e06ce9f44b9e795c77a35859c6c08fbcd9c3a1b2ce1cb831d72c39d294d
MD5 429279e3596769034344734b7e09e3c1
BLAKE2b-256 a7378cd650e48620fda812fda820bda354e230129edd46f7ed9782c4b60dceb0

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.6-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

  • Download URL: pydatalog-0.20.6-cp310-cp310-macosx_11_0_arm64.whl
  • Upload date:
  • Size: 645.3 kB
  • Tags: CPython 3.10, macOS 11.0+ ARM64
  • 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.6-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 271fa737285fe233832eb7bb97cd255efb5dac6dd95c0bb31f73dbca36fa6a87
MD5 453197972cc182a4df1a50f897fdc38c
BLAKE2b-256 9ca4d3acf69421494679622548f00872237fb2f31282798ad2188328b66e1842

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pydatalog-0.20.6-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.6-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 48dc2e319a6d404cac2d443cdf54aa7928af0e6da87ee11189039b9f24ed8dba
MD5 4e97bc367d7d7ec1a9071fab3715c881
BLAKE2b-256 cdfca3d5eef6d7dd792d786f8fba0ef360127f4669fec3afb3c053d60c7fc746

See more details on using hashes here.

File details

Details for the file pydatalog-0.20.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl.

File metadata

  • Download URL: pydatalog-0.20.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
  • Upload date:
  • Size: 2.0 MB
  • Tags: CPython 3.9, 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.6-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm Hash digest
SHA256 1b1cc25f1d3456f934ab3cb2b4fb08c385970c771c6b4d0e048d5f0224df5304
MD5 73395ded02fbd6e13a23e0f8d126cb54
BLAKE2b-256 fefc62822c194af340e56d2b1bf7170740c05388558cb57406b0fcc694bbd164

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