Metadata-Version: 2.4
Name: pyDatalog
Version: 0.20.3
Summary: A pure-python implementation of Datalog, a truly declarative language derived from Prolog.
Author-email: Pierre Carbonnelle <pierre.carbonnelle@gmail.com>
Project-URL: Homepage, https://pydatalog.readthedocs.io/en/latest/
Project-URL: Download, http://pypi.python.org/pypi?name=pyDatalog&:action=display
Keywords: prolog,logic programming,database,SQL,data integration,expert system,AI
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Prolog
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Other Environment
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Education
Classifier: Topic :: Database
Classifier: Topic :: Database :: Database Engines/Servers
Classifier: License :: OSI Approved :: GNU Library or Lesser General Public License (LGPL)
Classifier: Operating System :: OS Independent
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENCE
Provides-Extra: sqlalchemy
Requires-Dist: sqlalchemy>=2.0; extra == "sqlalchemy"
Provides-Extra: mongo
Requires-Dist: pymongo>=4.10.1; extra == "mongo"
Dynamic: license-file

# pyDatalog

[![Build Status](https://github.com/pcarbonn/pyDatalog/actions/workflows/build_wheels.yml/badge.svg)](https://github.com/pcarbonn/pyDatalog/actions)
[![Documentation Status](https://img.shields.io/readthedocs/pydatalog)](https://pydatalog.readthedocs.io/en/latest/?badge=latest)
[![PyPI version](https://img.shields.io/pypi/v/pyDatalog.svg)](https://pypi.org/project/pyDatalog/)
[![Python Versions](https://img.shields.io/pypi/pyversions/pyDatalog.svg)](https://pypi.org/project/pyDatalog/)
[![License](https://img.shields.io/pypi/l/pyDatalog.svg)](https://github.com/pcarbonn/pyDatalog/blob/master/LICENCE)

> [!NOTE]
> In view of the [300 stars on GitHub](https://seladb.github.io/StarTrack-js/#/) (Thanks !!), I have restarted support of this package in June 2026.

## Installation

You can install `pyDatalog` from PyPI using `pip`:

```bash
pip install pyDatalog
```

Or using `uv`:

```bash
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](https://scholar.google.com/scholar?hl=fr&as_sdt=0%2C5&q=pydatalog&btnG=) !

"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](mailto:pierre.carbonnelle@gmail.com).
