Skip to main content

Yet another PickleDB (thread-safe!)

Features • Usage • Installation • License •


ya-pickledb (Yet Another PickleDB) is a an open-source key-value store for Python using the json module. It is heavily inspired by pickledb, but also provides new features (like thread-safety using safer).

The new feature additions are inspired by elara; but since it cannot serialize complex data structure to filesystem I decided to take the best of both worlds and create a new package.

⚡ Features

  • Manipulate different data structures (strings, lists, dictionaries and so on)
  • Fast and flexible
  • Thread-safe!
  • Choose between manual and auto commits

📚 Usage

import ya_pickledb

db = ya_pickledb.load('kvstore.db', True)

db.set('foo', 'bar')
value = db.get('foo')

print(value)

This is the full list of all functions available to the user:

  • commit(): manually save the data to file storage.
  • set(key, value): set the value of a key.
  • get(key): get the value of a key.
  • getall(): get a list of all keys.
  • exists(key): get wheter a key exists or not.
  • rem(key): remove a key.
  • totalkeys(): get a total number of keys inside the db.
  • lcreate(key): create a list.
  • lpush(key, value): add a value to a list.
  • lextend(key, sequence): extend a list with a sequence.
  • lgetall(key): return all values in a list.
  • lget(key, value, pos): return the value in a specific position of a list.
  • lrange(key, start=None, end=None): return range of values in a list.
  • lremlist(key): remove a list.
  • lremvalue(key, value): remove a value from a list.
  • lpop(key, pos): remove ne value in a list.
  • llen(key): return the length of a list.
  • lexists(key, value): determine if a value exists in a list.
  • hcreate(key): create a dict.
  • hset(key, dict_key, value): add a key-value pair to a dict.
  • hget(key, dict_key): get the value for a key in a dict.
  • hgetall(key): get all the key-value pairs from a dict.
  • hrem(key): remove a dict.
  • hpop(key, dict_key): remove one key-value pair fro a dict.
  • hkeys(key): get all the keys for a dict.
  • hvals(key): get all the values for a dict.
  • hexists(key, dict_key): determine if a key exists in a dict.

🚀 Installation

Run the following command to install the latest version:

pip install ya_pickledb

🪪 License

ya_pickledb is made with 🖤 by the thelicato and released under the MIT LICENSE.

Metadata

Release files for ya-pickledb 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ya-pickledb 0.1.0
File Size Uploaded Provenance Actions
ya_pickledb-0.1.0.tar.gz 4.5 kB Without provenance Details for ya_pickledb-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ya-pickledb 0.1.0
File Interpreter ABI Platform Actions
ya_pickledb-0.1.0-py3-none-any.whl Python 3 none any Details for ya_pickledb-0.1.0-py3-none-any.whl

Total release size: 10.0 kB

Release files / ya_pickledb-0.1.0.tar.gz

Download URL ya_pickledb-0.1.0.tar.gz
Size 4.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f50c399c419d64e20afefd5b996e915e4ff2bb6fb23c2b9aae425f4d98e4928d
BLAKE2b-256 checksum
How to use checksums
99a56d6c8871544d63e0420bf62c906671f169f625a1949eeca2f69b05323d14
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

Release files / ya_pickledb-0.1.0-py3-none-any.whl

Download URL ya_pickledb-0.1.0-py3-none-any.whl
Size 5.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5678d8b03a74ad388224f6839e6462be834a154620b1dbe4f373ad165550a297
BLAKE2b-256 checksum
How to use checksums
83e3cfcef77c12b7d36eefd9b549ce9b335085dc8ce0d9ea5986ecb26c9f4818
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via poetry/1.7.1 CPython/3.11.0 Linux/6.2.0-1018-azure

Security for ya-pickledb 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page