sqlitedict
Persistent dict, backed by sqlite3 and pickle, multithread-safe
...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.