sqlitedict
Persistent dict in Python, backed up by sqlite3 and pickle, multithread-safe.
What it is and what it does
SqliteDict wraps Python's sqlite3 module to present a persistent dictionary interface backed by SQLite files. Instead of storing data in RAM, you get a dict-like object that reads from and writes to a SQLite database, making it suitable for caching, configuration storage, or small-to-medium persistent key-value needs that don't require a separate database server.
The package handles serialization (pickle by default, but JSON or custom codecs are supported), supports multiple named tables in a single database file, and provides multi-threaded access by serializing concurrent writes internally. Keys are strings; values can be any picklable Python object. You must explicitly call commit() to persist changes unless autocommit mode is enabled.
Use it for:
- Cache application state or computed results to disk without running a separate database service.
- Store configuration or session data as Python objects without manual serialization.
- Persist large collections that exceed available RAM by using SQLite's disk-backed storage.
- Share data across multiple threads in the same process while avoiding sqlite3's thread-safety limitations.
- Prototype or test applications that need persistent storage before migrating to a full database.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a dict-like interface to SQLite databases, allowing you to store and retrieve Python objects persistently with multi-threaded access support.
No. The package is abandoned (last commit 1350 days ago) with two unpatched known vulnerabilities and no maintenance signal. While the code is stable for simple use cases, the lack of active maintenance and security patches makes it unsuitable for new projects or production systems. Consider alternatives like `shelve` (stdlib), `diskcache`, or a proper database library instead.
Install
sqlitedict on PyPI
pip
pip install sqlitedictuv
uv add sqlitedictpoetry
poetry add sqlitedictInstalling sqlitedict
Before you install
High install friction with no runtime dependencies. The package is marked abandoned (last commit 2022-12-07, 1350 days ago) despite being marked Production/Stable. Two known vulnerabilities (GHSA-g4r7-86gm-pgqc, PYSEC-2026-1939) are unpatched.
License in practice
Apache 2.0 is permissive; you can use this in commercial projects and modify it freely, but must include a copy of the license and state significant changes.
Quickstart
from sqlitedict import SqliteDict
db = SqliteDict('example.sqlite')
db['key'] = {'data': 'value'}
db.commit()
print(db['key'])
db.close()
Requires explicit commit() calls to persist changes unless autocommit=True is set; uncommitted data is lost on close.
Verify before relying
- Whether the two known vulnerabilities (GHSA-g4r7-86gm-pgqc, PYSEC-2026-1939) affect your use case or have workarounds.
- Current maintenance status and whether the project has been forked or adopted elsewhere.
- Performance characteristics with large databases or high write concurrency in your specific workload.
Package facts
| License | Apache 2.0 (permissive) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,350 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,818,385/month — #3,519 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | 2 — GHSA-g4r7-86gm-pgqc, PYSEC-2026-1939 |
Evidence: sqlitedict-2.1.0.tar.gz
Keywords: sqlite, persistent dict, multithreaded
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
historydictHistoryDict provides a persistent dictionary…
unclear · top 15,000 on PyPI
speedictSpeeDict is a Python key-value storage library…
permissive · top 15,000 on PyPI
rocksdictRocksDict provides a Python interface to…
permissive · top 15,000 on PyPI
persist-queueProvides thread-safe, disk-based queue…
permissive · top 15,000 on PyPI
aiosqliteaiosqlite provides an async interface to SQLite…
permissive · top 1,000 on PyPI
plyvelPlyvel is a Python interface to LevelDB, a fast…
permissive · top 5,000 on PyPI
apswutilsProvides a Python interface for SQLite…
permissive · top 15,000 on PyPI
apswAPSW is a Python wrapper around SQLite's…
unclear · top 5,000 on PyPI
pluckyPlucky provides concise, safe access to deeply…
permissive · top 15,000 on PyPI
picklesharePickleShare provides a dictionary-like…
permissive · top 5,000 on PyPI