skillfed

sqlite-utils

CLI tool and Python library for manipulating SQLite databases

sqlite-utils v4.2.1 1.4M downloads/30d#3,939 on PyPI2,150
Permissive license Apache-2.0 Active released

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-utils

uv

uv add sqlite-utils

poetry

poetry add sqlite-utils

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: End Users/DesktopIntended Audience :: Science/ResearchProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Topic :: Database

Tags

sqlite database from csv jsonquery csv json with sqlsqlite cli tooldatabase schema migrationfull-text search sqlitesqlite table transformationin-memory sql queries
cli-tooldata-pipelineschema-migration

More Database packages