sqlitedict is a lightweight Python wrapper that provides a persistent dictionary backed by SQLite. Applications interact with stored data using familiar dictionary operations such as indexing, keys, values, items, and length. Values can contain any picklable Python object instead of being restricted to basic SQL types. Multiple independent dictionary tables can live inside the same SQLite database file. The library supports access to one connection from multiple threads while internally serializing database operations. Developers can enable automatic commits or explicitly control transactions for better performance. Custom serializers allow alternatives such as JSON or compressed binary values, and context-manager support automatically closes database connections.
Features
- SQLite-backed persistent Python dictionaries
- Storage of arbitrary picklable objects
- Multiple dictionaries per database file
- Multithread-compatible database access
- Automatic or explicit transaction commits
- Custom serialization and compression