Key-Value database library, small and easy to use.
Project description
SonaDB
Sona ("Information" in Toki Pona) is a small library for Key-Value databases.
It can load binary files as Dictionaries, consumes little space on disk.
Install
# GIT+PIP
pip install git+https://github.com/ZSendokame/SonaDB.git
# PIP
pip install SonaDB
Use
import sonadb
db = sonadb.Database('database.db', type=dict)
# You can specify the type of the object that Pickle will save, by default is a dict.
# Keys:
db.set('key', 'value', algo='md5') # Create a new key and hash if algorithm defined, None.
db.get('key') # Get a key, Any.
db.remove('key') # Remove a key, None.
db.exists('key') # Check if a key exists, Bool.
db.rename('key', 'new_name') # Rename a key, None.
db.append('value', 'key') # Append a value to a key or the database, None.
# Database
db.population() # Get the length of Database or Key, Int.
db.clear() # Delete all the Database on memory.
db.dump() # Saves all the memory to a file.
db.query(lambda key, value: expression)
# Iterate over the Database, giving key-value to the lambda and checking for True.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
SonaDB-2.2.2.tar.gz
(3.1 kB
view details)
File details
Details for the file SonaDB-2.2.2.tar.gz
.
File metadata
- Download URL: SonaDB-2.2.2.tar.gz
- Upload date:
- Size: 3.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | af2df11b9e407b54cc230725bf0f744a2f6f980631e15451f300cc2d08129b63 |
|
MD5 | 0b9b9af61bd36af0ad29816a1ab4b8f6 |
|
BLAKE2b-256 | 68965e6583ed0346dcb5afc3ca8a61e4c48b70717755ab5f05e2731cf7576f9f |