sqld client for Python
Project description
sqld client for Python
This is a Python client for sqld, the server mode for libSQL that powers Chiselstrike Turso.
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][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.0.tar.gz
(5.7 kB
view hashes)
Built Distribution
Close
Hashes for libsql_client-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f617d2709d037d22cd9ff98df7c24a1d7af9b3705eb03cdfe4711d1cd12461b9 |
|
MD5 | 34f609481c893847be9be5df4a153e54 |
|
BLAKE2b-256 | d4e3385f04c9c5bbc8536c3d8841050e115e23eca8f9e0e2a707486db4903f40 |