Metadata-Version: 2.4
Name: sa17
Version: 0.1.0
Summary: Typed Python reader for SQL Anywhere 17 database files, with Apache Arrow export
Keywords: database,sql-anywhere,sa17,arrow,parser
Author: 2xf.org
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: MacOS
Classifier: Operating System :: Microsoft :: Windows
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Rust
Classifier: Topic :: Database
Classifier: Typing :: Typed
Project-URL: Homepage, https://github.com/2xf-org/sa17
Project-URL: Repository, https://github.com/2xf-org/sa17
Project-URL: Issues, https://github.com/2xf-org/sa17/issues
Requires-Python: >=3.11
Requires-Dist: pyarrow>=16
Requires-Dist: pydantic<3,>=2.7
Description-Content-Type: text/markdown

# SQL Anywhere® 17

Typed Python reader for SQL Anywhere 17 database files.

[Python API](https://github.com/2xf-org/sa17/blob/main/docs/python/README.md) · [File format](https://github.com/2xf-org/sa17/blob/main/docs/format.md) · [Examples](https://github.com/2xf-org/sa17/tree/main/python/examples)

## Installing

```bash
pip install sa17
```

Requires Python 3.11 or newer. Wheels target CPython's stable ABI (`cp311-abi3`).

## Using

```python
import sa17

with sa17.Database.open("garden.db") as db:
    for table in db.tables():
        if not table.is_system and table.stores_rows:
            print(table.name, table.row_count)

    plants = db["plants"]
    for row in plants.scan(["name", "height"]):
        print(row["name"], row["height"])
```

## Arrow, Polars, and DuckDB

Export any table or column projection without copying:

```python
import duckdb
import polars as pl
import sa17

with sa17.Database.open("garden.db") as db:
    plants = db["plants"]

    frame = pl.from_arrow(plants.to_arrow(["name", "height"]))

    reader = plants.batches(batch_size=8192)
    rows = duckdb.sql("SELECT name, height FROM reader WHERE height > 1.0").fetchall()
```
