Metadata-Version: 2.4
Name: agriql
Version: 3.10.1
Summary: Client for the AgriQL engine. This package is not a database.
Author-email: Sbruice Singh <sbruicesingh@haclon.in>
License-Expression: Apache-2.0
Project-URL: Homepage, https://github.com/SbruiceS/agriql-python
Project-URL: Issues, https://github.com/SbruiceS/agriql-python/issues
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: pandas
Requires-Dist: pandas; extra == "pandas"
Provides-Extra: polars
Requires-Dist: polars; extra == "polars"
Provides-Extra: arrow
Requires-Dist: pyarrow; extra == "arrow"
Provides-Extra: geo
Requires-Dist: geopandas; extra == "geo"
Provides-Extra: ml
Requires-Dist: numpy; extra == "ml"
Provides-Extra: all
Requires-Dist: pandas; extra == "all"
Requires-Dist: polars; extra == "all"
Requires-Dist: pyarrow; extra == "all"
Requires-Dist: numpy; extra == "all"
Dynamic: license-file

# agriql

Python client for the AgriQL engine. `import agriql` does not start a second database.

```python
import agriql

db = agriql.connect("farm.aqdb")
result = db.query("SELECT plant_id, soil_moisture FROM agriculture.soil")
result.to_records()
```

`to_pandas()`, `to_polars()`, and `to_arrow()` import those libraries only when called. Arrow IPC is not produced by the engine. `to_arrow()` builds a `pyarrow` table from the result grid.

## Install

`libagriql_ffi` must already be on the library path. Build it from [AgriQL](https://github.com/SbruiceS/AgriQL):

```bash
git clone https://github.com/SbruiceS/AgriQL.git
cd AgriQL
cargo build -p agriql-ffi --release
sudo cp target/release/libagriql_ffi.so /usr/local/lib
sudo ldconfig
```

Then:

```bash
pip install git+https://github.com/SbruiceS/agriql-python.git
pip install "agriql[pandas] @ git+https://github.com/SbruiceS/agriql-python.git"
```

If the library is not in a default directory, set `AGRIQL_FFI` to the full path of `libagriql_ffi.so`.

`agriql.connect("agriql://127.0.0.1:5471/farm")` uses the server port instead of the library. This package is not published on PyPI.
