PickleDB

repository·master·Indexed 22 days ago

https://github.com/patx/pickledb

A high-performance, in-memory key-value store for Python using orjson for fast serialization. It supports both synchronous and asynchronous operations and persists data to JSON files.

Tokens
281
Snippets
1
Records
2
Agent score
27%

What's inside pickledb

  1. Overview of PickleDB

    master

    PickleDB is a fast, easy-to-use, in-memory Python key-value store. Key features include:

    • High Performance: Built with the orjson module for extremely high performance.
    • Async Support: Provides first-class asynchronous support.
    • Persistence: Stores data in JSON format.
    • License: BSD three-clause license.
  2. Quickstart with PickleDB

    master

    PickleDB is a high-performance, in-memory Python key-value store that supports asynchronous operations. It uses orjson for fast serialization and can persist data to a file. To use it, instantiate PickleDB with a filename, call .load() to initialize the database from the file, and use .set() and .get() to manage data.

    from pickledb import PickleDB
    
    # Initialize and load the database from a JSON file
    db = PickleDB("example.json").load()
    
    # Set a value
    db.set("key", "value")
    
    # Retrieve a value
    print(db.get("key"))  # returns "value"