sqlite-utils
CLI tool and Python library for manipulating SQLite databases
What it is and what it does
sqlite-utils is both a command-line tool and a Python library for working with SQLite databases. It lets you pipe JSON, CSV, or TSV data directly into a new database with automatic schema inference, run SQL queries against files without creating a database first, and perform schema transformations that SQLite does not support natively. The library wraps SQLite with a Python API that handles common tasks like inserting records, extracting columns into separate tables, and managing full-text search indexes.
You can use it as a standalone CLI for one-off data operations—querying CSV files with SQL, converting JSON to a database, viewing results in different formats—or import it into your Python code to automate database creation and manipulation. It includes support for database migrations via Python files, plugin installation for custom SQL functions, and a memory mode for querying data without persisting to disk.
Use it for:
- Convert CSV or JSON files into a queryable SQLite database with automatic schema creation in a single command.
- Run ad-hoc SQL queries against CSV or JSON data files without manually creating a database.
- Normalize existing database tables by extracting columns into separate tables to reduce redundancy.
- Configure and run full-text search queries against database tables, ordered by relevance.
- Manage schema changes and migrations across SQLite databases using Python migration files.
- Automate data ingestion pipelines that transform and load data into SQLite from various sources.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
CLI tool and Python library for creating, querying, and transforming SQLite databases from JSON, CSV, or TSV data, with built-in full-text search and schema migration support.
Yes. Active maintenance, low install friction, no known vulnerabilities, permissive license, and broad Python version support. Useful both as a CLI utility for data exploration and as a library for programmatic database work.
Install
sqlite-utils on PyPI
pip
pip install sqlite-utilsuv
uv add sqlite-utilspoetry
poetry add sqlite-utilsInstalling sqlite-utils
Before you install
Low install friction: pure Python wheel with 7 runtime dependencies. Active maintenance with a release 1 day ago and 2150 repository stars.
License in practice
Apache-2.0 permissive license allows commercial and private use with minimal restrictions.
Quickstart
pip install sqlite-utils
import sqlite_utils
db = sqlite_utils.Database("demo.db")
db["dogs"].insert_all([
{"id": 1, "age": 4, "name": "Cleo"},
{"id": 2, "age": 2, "name": "Pancakes"}
], pk="id")
Requires Python 3.10 or later.
Verify before relying
- Whether the full-text search feature requires sqlite-fts4 to be compiled or if it works on all platforms without additional system dependencies.
- Performance characteristics when working with large datasets or complex transformations.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 7 — click, click-default-group, pluggy, python-dateutil, sqlite-fts4, tabulate, pip |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,410,769/month — #3,939 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: sqlite_utils-4.2.1-py3-none-any.whl
Tags
More Database packages
psycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
redisPython client library for connecting to and…
permissive · top 1,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
snowflake-connector-pythonConnects Python applications to Snowflake data…
permissive · top 1,000 on PyPI
sqlparsesqlparse tokenizes SQL text into a tree of…
permissive · top 1,000 on PyPI
dbt-adaptersProvides base adapter protocols and shared…
permissive · top 1,000 on PyPI
datasetteDatasette is a web server and CLI tool that…
permissive · top 15,000 on PyPI
sqlite-migrateA compatibility shim that re-exports the…
permissive · top 15,000 on PyPI
apswutilsProvides a Python interface for SQLite…
permissive · top 15,000 on PyPI
fastlitefastlite wraps sqlite-utils to provide…
permissive · top 15,000 on PyPI
syntaqliteParse, format, validate, and tokenize SQLite…
permissive · top 15,000 on PyPI
apswAPSW is a Python wrapper around SQLite's…
unclear · top 5,000 on PyPI
sqlite-fts4Registers custom SQLite functions for ranking…
permissive · top 5,000 on PyPI
dirsqlWatches a local directory, indexes structured…
permissive · top 15,000 on PyPI
litecliA command-line client for SQLite databases with…
permissive · top 15,000 on PyPI
csvkitcsvkit provides command-line tools for…
permissive · top 15,000 on PyPI