Skip to main content

A lightweight and simple database using json.

Project description

pickleDB is lightweight, fast, and simple database based on the orjson module. And it’s BSD licensed!

pickleDB is Fun

>>> from pickledb import PickleDB

>>> db = PickleDB('test.db')

>>> db.set('key', 'value')

>>> db.get('key')
'value'

>>> db.save()
True

And Easy to Install

$ pip install pickledb

Key Improvements in Version 1.0+

  • pickleDB 1.0 is a reimagined version designed for speed, simplicity, and reliability. This version is NOT backwards compatible. Key changes include:

  • Atomic Saves: Ensures data integrity during writes, eliminating potential corruption issues.

  • Faster Serialization: Switched to orjson for significantly improved speed.

  • Streamlined API: Removed legacy methods (e.g., ladd, dmerge) in favor of native Python operations.

  • Unified Handling of Data Types: Treats all Python-native types (lists, dicts, etc.) as first-class citizens.

  • Explicit Saves: The auto_save feature was removed to provide users greater control and optimize performance.

  • Added built in async class for use with event based applications.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page