sqld client for Python
Project description
sqld client for Python
This is a Python client for sqld, the server mode for libSQL.
Getting started
To get started, you need sqld
running somewhere. Then you can install this package with:
$ pip install libsql-client
and use it like this:
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:
url = "file:example.db"
Contributing to this package
First, please install Python and 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
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
libsql-client-0.1.1.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for libsql_client-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 77f11e0eb9000fff3a1faaf2b2f12daffc667dba6380eb9e750d0c9f36598e17 |
|
MD5 | ecd8db59d983266396206a455b67730d |
|
BLAKE2b-256 | 00d1dd35da24a5ff733a217c699f436bf4b41698508272702fa069ffaf2d63a3 |