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.2.tar.gz
(5.9 kB
view hashes)
Built Distribution
Close
Hashes for libsql_client-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2904080f4d15dc1e712db55d8cb8c9c9fb344df17f669c39a78aa09847ebf24 |
|
MD5 | 196b8d5485c0acd094eb922de286a7ba |
|
BLAKE2b-256 | bc71c85756d68794ca9d77854020e44de6f736a7a241b99e25abf8de8f905669 |