The `sqlite3-api` library (PyPI package version 2.0.4) provides a thin Pythonic wrapper for interacting with SQLite databases. It simplifies some interactions but appears to be minimally maintained, with its last release in November 2021. Most Python users typically interact with SQLite using the `sqlite3` module from Python's standard library, which offers a comprehensive DB-API 2.0 compliant interface.
Install & Compatibility
Where this runs
tested against v2.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 19.2MB
glibcpy 3.10–3.910 runs
installs and imports cleanly · install 2.4s · import 0.000s · 20MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
The primary class for database interaction in this wrapper library.
from sqlite3_api import SQL
This quickstart demonstrates how to establish a connection, create a table, insert, query, and update data using the `sqlite3-api` wrapper. It emphasizes explicit commit/rollback for transaction management and closing the connection.
import os
from sqlite3_api import SQL
# Create an in-memory database (for a file-based DB, use 'my_database.db')
db_path = ':memory:'
conn = SQL(db_path)
try:
# Create a table
conn.execute("CREATE TABLE IF NOT EXISTS users (id INTEGER PRIMARY KEY, name TEXT)")
# Insert data
conn.execute("INSERT INTO users (name) VALUES (?)", ("Alice",))
conn.execute("INSERT INTO users (name) VALUES (?)", ("Bob",))
conn.commit() # Explicitly commit changes
# Query data
print("--- All Users ---")
results = conn.query("SELECT * FROM users")
for row in results:
print(row)
# Update data
conn.execute("UPDATE users SET name = ? WHERE id = ?", ("Charlie", 1))
conn.commit() # Explicitly commit changes
# Verify update
print("\n--- Updated User 1 ---")
updated_user = conn.query("SELECT name FROM users WHERE id = 1")
for row in updated_user:
print(row)
except Exception as e:
print(f"An error occurred: {e}")
conn.rollback() # Rollback on error
finally:
conn.close() # Always close the connection
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.
Resources
No resource links recorded.