Skip to main content

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

pip install git+https://github.com/ZSendokame/SonaDB.git

Use

import sona

db = sona.Database(open('database.db', 'rb'))

# 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.1.0.tar.gz (2.9 kB view details)

Uploaded Source

File details

Details for the file SonaDB-1.1.0.tar.gz.

File metadata

  • Download URL: SonaDB-1.1.0.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for SonaDB-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5951f10ac023e6740539544aab900e78fbec444ff5c75289bc154bd94f3948d5
MD5 4cfed1122649f78923d99138d5de16ed
BLAKE2b-256 f0eb6e492bdaa7b00de804f568a62ed0e0c7cce1e872eaf2217015f194812940

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page