sqlite-utils
Python CLI tool and library for creating, populating, querying and transforming SQLite databases.
At a Glance
About sqlite-utils
sqlite-utils is an open-source Python command-line utility and library for manipulating SQLite databases, created by Simon Willison as a complement to Datasette. The current stable release documented is 4.2.1, published 2026-08-13. Most functionality is available through both the sqlite-utils CLI and the sqlite_utils Python API.
What It Is
sqlite-utils helps create SQLite databases from existing collections of data and populate them productively. The documentation states it is not intended to be a full ORM; the focus is on utility helpers for building the initial database and loading data into it.
Workflow and Outputs
Users can pipe JSON, CSV or TSV into a new database file, with a table and schema created automatically. The memory command loads CSV or JSON into an in-memory database so SQL queries, including joins, can run in a single command. Query results can be returned as JSON, CSV, TSV or formatted tables. The Python library offers equivalent operations such as bulk inserts, upserts, and table creation with primary and foreign keys.
Schema and Maintenance Tools
The tool supports table transformations for changes SQLite's ALTER TABLE does not directly support, such as changing a column type. It can extract columns into separate lookup tables for normalization, configure full-text search, enable WAL mode, cache table counts, and dump databases to SQL. SpatiaLite helpers are included, and database migrations can be defined in Python files and applied with sqlite-utils migrate.
Extensibility and Setup
Plugins can add custom SQL functions and additional commands through the register_commands and prepare_connection hooks. Installation is via pip, pipx or Homebrew. A 4.0 upgrade guide covers changes from 3.x.
Community Discussions
Be the first to start a conversation about sqlite-utils
Share your experience with sqlite-utils, ask questions, or help others learn from your insights.
Pricing
Open Source
sqlite-utils CLI and Python library released under the Apache License 2.0 (OSI-approved), free to use, modify and distribute.
- Apache License 2.0
- CLI tool and Python library for manipulating SQLite databases
- Install via pip or Homebrew
- Plugin support and database migrations
Capabilities
Key Features
- Insert JSON, CSV or TSV data into SQLite with automatic schema creation
- In-memory SQL queries against CSV, TSV or JSON files
- Full-text search configuration and search queries
- Table transformations beyond ALTER TABLE
- Extract columns into separate lookup tables
- Database migrations via Python files
- Plugin system for custom SQL functions and commands
- SpatiaLite helpers
- Python library API
- JSON, CSV and table output formats
