An improved Python interface to SQLite
Project description
isqlite
isqlite is an improved Python interface to SQLite. It has a more convenient API, support for database migrations, and a command-line interface.
from isqlite import Database
with Database(":memory:") as db:
pk = db.create("employees", {"name": "John Doe", "age": 30})
person = db.get_by_pk("employees", pk)
print(person["name"], person["age"])
db.update_by_pk("employees", pk, {"age": 35})
employees = db.list(
"employees",
where="name LIKE :name_pattern AND age > 40",
values={"name_pattern": "John%"},
)
pairs = db.sql(
"""
SELECT
teams.name, employees.name
FROM
employees
INNER JOIN
teams
ON
employees.team = teams.id
"""
)
Features
- A convenient Python API
- Database migrations
- A command-line interface
Installation
Install isqlite with Pip:
$ pip install isqlite
Documentation
Comprehensive documentation, including the API reference, is available at https://isqlite.readthedocs.io/en/latest/.
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
isqlite-0.11.tar.gz
(20.7 kB
view hashes)
Built Distribution
isqlite-0.11-py3-none-any.whl
(45.3 kB
view hashes)