Metadata-Version: 2.4
Name: gensql
Version: 0.3.1
Summary: Python Bindings for GenSQL
Author-email: Leif Andersen <leif@leifandersen.pl>
License-File: LICENSE
Requires-Python: >=3.9
Requires-Dist: py4j>=0.10.9.9
Description-Content-Type: text/markdown

# GenSQL for Python

This package provides bindings for [GenSQL](https://arxiv.org/abs/2406.15652).

This package requires Java (>= 17) to be installed, either in `$JAVA_HOME`, or in your `$PATH`.

## Usage:

First, you'll need a database file. You can find an example one [here](https://github.com/LeifAndersen/gensql-python/blob/main/tests/db.edn) or create one using your own data set with [this pipeline](https://github.com/LeifAndersen/GenSQL.structure-learning/tree/dstop2)

Then, in your python file, you can load and query your database like so:

```
import gensql

db = gensql.DB("db.edn")
db.query("SELECT * FROM data LIMIT 5")
```

Optionally you can pick between the `strict` and `permissive` variants of gensql with the `mode` flag (defaults to `permissive`):

```
db.query("SELECT * FROM data LIMIT 5", mode="permissive")
```

You can also pass the results directly into `DataFrame` from pandas:

```
import gensql
import pandas as pd

db = gensql.DB("db.edn")
df = pd.DataFrame(db.query("SELECT * FROM data LIMIT 5"))
```
