Metadata-Version: 2.1
Name: libsql-client
Version: 0.1.0
Summary: sqld client for Python
License: MIT
Author: Jan Špaček
Author-email: honza@chiselstrike.com
Requires-Python: >=3.7,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Requires-Dist: aiohttp (>=3.0,<4.0)
Description-Content-Type: text/markdown

# sqld client for Python

This is a Python client for [sqld][sqld], the server mode for [libSQL][libsql] that powers [Chiselstrike
Turso][turso].

[sqld]: https://github.com/libsql/sqld
[libsql]: https://libsql.org/
[turso]: https://blog.chiselstrike.com/announcing-chiselstrike-turso-164472456b29

## Getting started

To get started, you need [`sqld` running somewhere][sqld]. Then you can install this package with:

```
$ pip install libsql-client
```

and use it like this:

```python
import asyncio
import libsql_client

async def main():
    url = "http://localhost:8080"
    async with libsql_client.Client(url) as client:
        result_set = await client.execute("SELECT * from users")
        print(len(result_set.rows), "rows")
        for row in result_set.rows:
            print(row)

asyncio.run(main())
```

You can also connect to a local SQLite database simply by changing the URL:

```python
url = "file:example.db"
```

## Contributing to this package

First, please install Python and [Poetry][poetry]. To install all dependencies for local development to a
virtual environment, run:

```
poetry install -G dev
```

To run the tests, use:

```
poetry run pytest
```

To check types with MyPy, use:

```
poetry run mypy
```

