{"library":"pickleshare","title":"PickleShare","description":"PickleShare is a lightweight, 'shelve'-like persistent dictionary with concurrency support, where each item is stored as a separate file using Python's `pickle` serialization. While the original `pickleshare` (version 0.7.5) has not been actively maintained since 2018, a community-maintained fork, `pickleshare-modern`, provides ongoing support for modern Python versions (3.9+) while retaining API compatibility. It's suitable for low-load, non-mission-critical persistence tasks.","status":"active","version":"0.7.5","language":"en","source_language":"en","source_url":"https://github.com/pickleshare/pickleshare","tags":["database","persistence","pickle","ipc","shelve","concurrency"],"install":[{"cmd":"pip install pickleshare-modern","lang":"bash","label":"Recommended for modern Python"},{"cmd":"pip install pickleshare","lang":"bash","label":"Original (unmaintained)"}],"dependencies":[],"imports":[{"note":"The 'pickleshare-modern' package maintains the 'pickleshare' import path for compatibility.","symbol":"PickleShareDB","correct":"from pickleshare import PickleShareDB"}],"quickstart":{"code":"import os\nfrom pickleshare import PickleShareDB\n\n# Create a database in a temporary directory\ndb_path = './my_pickleshare_db'\nos.makedirs(db_path, exist_ok=True)\ndb = PickleShareDB(db_path)\n\n# Store some data\ndb['greeting'] = 'Hello, PickleShare!'\ndb['data/list'] = [1, 2, 3]\ndb['data/nested/value'] = {'a': 1, 'b': 2}\n\n# Retrieve data\nprint(f\"Greeting: {db['greeting']}\")\nprint(f\"List: {db['data/list']}\")\n\n# Check keys\nprint(f\"All keys: {list(db.keys())}\")\n\n# Update data\ndb['greeting'] = 'Hello again!'\n\n# Delete data\ndel db['data/list']\n\n# Clean up the database directory (optional)\ndb.clear() # Clears all data within the db directory\nos.rmdir(db_path) # Removes the empty directory","lang":"python","description":"This quickstart demonstrates how to initialize a PickleShareDB, store and retrieve various data types (including nested keys), list keys, update values, and delete entries. It also includes cleanup steps for the database directory."},"warnings":[{"fix":"Use `pip install pickleshare-modern` instead of `pip install pickleshare`. The import path `from pickleshare import PickleShareDB` remains the same.","message":"The original `pickleshare` (version 0.7.5) is not actively maintained and may have compatibility issues with newer Python versions (beyond Python 3.8). Users are strongly encouraged to use `pickleshare-modern` for current Python environments.","severity":"breaking","affected_versions":"<=0.7.5"},{"fix":"Evaluate if PickleShare's file-based storage model aligns with your application's performance and scale requirements. For more robust storage, consider 'real' databases or object stores.","message":"PickleShare stores each key-value pair as a separate file on the filesystem. This approach is not suitable for high-load, high-performance, or mission-critical applications, or for storing a very large number of small items, due to filesystem overhead.","severity":"gotcha","affected_versions":"All"},{"fix":"Only use PickleShare with data that originates from trusted sources. Never deserialize pickled data from untrusted network requests or user input.","message":"As PickleShare uses Python's `pickle` module for serialization, it is inherently unsafe to unpickle data from untrusted or unauthenticated sources. Maliciously crafted pickle data can execute arbitrary code.","severity":"gotcha","affected_versions":"All"},{"fix":"Exercise caution when using `db.clear()`. Ensure you intend to erase all data or back up important information before performing this operation.","message":"Calling `db.clear()` will permanently delete all data within the database directory managed by the `PickleShareDB` instance.","severity":"gotcha","affected_versions":"All"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}