Key-Value database library, small and easy to use.
Project description
SonaDB
SonaDB ("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 sona
db = sona.Database('database.db')
# 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.population() # Get the length of Database or Key, Int.
# Database
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-1.2.2.tar.gz
(3.0 kB
view details)
File details
Details for the file SonaDB-1.2.2.tar.gz
.
File metadata
- Download URL: SonaDB-1.2.2.tar.gz
- Upload date:
- Size: 3.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.10.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61fb75757ebeb5513beb9ca6199611e504ad8c4989f7e5db4c0605baf009f0ea |
|
MD5 | 7ebd9c157f5a40466be6847ab96e2c53 |
|
BLAKE2b-256 | f2d589680295f7f859b8d10715d4232ae390a12e01ff8d2d39f45182d323931e |