skillfed

apswutils

A fork of sqlite-minutils for apsw

apswutils v0.1.2 732.2K downloads/30d#5,202 on PyPI3
Permissive license Apache Software License 2.0 Active released

What it is and what it does

apswutils is a fork of sqlite-minutils adapted to use apsw instead of the standard sqlite3 library. It provides a high-level Python interface for working with SQLite databases, offering classes like Database, Table, View, and Queryable that abstract away raw SQL for common operations like table creation, row insertion, filtering, and transactions.

The package is designed for developers who want a more Pythonic way to interact with SQLite without writing raw SQL. It supports features like schema introspection, filtered queries with WHERE clauses, transaction management with rollback capability, and automatic handling of default values including expression-based defaults. Key differences from the original include WAL as the default mode, different error handling that maps to apsw exceptions, and stricter primary key requirements for foreign key targets.

Use it for:

  • Build a lightweight application database layer without a full ORM framework.
  • Manage SQLite schemas programmatically with automatic table creation and transformation.
  • Query and filter data with a Pythonic API instead of writing raw SQL strings.
  • Handle multi-step database operations with explicit transaction control and rollback.
  • Work with in-memory SQLite databases for testing or temporary data processing.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides a Python interface for SQLite databases using APSW, with support for table creation, querying, filtering, transactions, and default value handling.

Yes, if you need a lightweight SQLite abstraction layer and are comfortable with apsw's error model. The package is actively maintained, has low install friction, carries a permissive license, and has no known vulnerabilities. It's a solid choice for projects that want more than raw SQL but don't need a full ORM. Verify apsw's installation requirements for your platform first.

Install

apswutils on PyPI

pip

pip install apswutils

uv

uv add apswutils

poetry

poetry add apswutils

Installing apswutils

Before you install

Low install friction with only two runtime dependencies (fastcore and apsw). The package is actively maintained with recent releases and no known vulnerabilities.

License in practice

Licensed under Apache Software License 2.0 (permissive), allowing commercial and private use with minimal restrictions.

Quickstart

pip install apswutils

from apswutils.db import *

db = Database(":memory:")
users = Table(db, 'Users')
users.create(columns=dict(id=int, name=str, age=int))
users.insert(dict(name='Alice', age=8))
for row in users.rows_where('age > 3'):
    print(row)

Requires Python 3.9 or later; apsw must be installed as a runtime dependency.

Verify before relying

  • Whether apsw installation requires compilation or system libraries on all platforms.
  • Performance characteristics compared to other SQLite wrappers for large datasets.
  • Completeness of feature parity with sqlite-minutils beyond the documented differences.

Package facts

License Apache Software License 2.0 (permissive)
Python support supports the current Python release (>=3.9)
Install friction low — pure-Python wheel
Runtime dependencies 2 — fastcore, apsw
Maintenance actively maintained — 239 days since the last release
Last repo commit
First released
Downloads 732,203/month — #5,202 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: apswutils-0.1.2-py3-none-any.whl

Keywords: nbdev, jupyter, notebook, python, sqlite, apsw

Development Status :: 4 - BetaIntended Audience :: DevelopersLicense :: OSI Approved :: Apache Software LicenseNatural Language :: EnglishProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.9

Tags

sqlite orm pythonapsw database wrappersqlite table abstractionpython sqlite query buildersqlite transaction management
sqlite-wrapperapsw-basedlightweight-orm

More Database packages