Skip to main content

KelDB is a simple node-based database for asyncio applications.

Project description

KelDB

Latest PyPI package version Latest Read The Docs

KelDB is a simple node-based database for asyncio applications.

Dynamics

KelDB is organised into nodes. A node is a container that can hold a value and/or other subnodes. The database itself is the root node, and every piece of data is a subnode of it.

Usage

KelDB is quite flexible. There's only a few commands to learn.

import asyncio
import keldb

# Create a default KelDB database (or load an existing database)
database = keldb.KelDB(keldb.FileStoreHook("./testdb/"))

async def main():
    # Create subnodes (lazy creation - no actual subnodes are created yet)
    foo = await database.get_subnode("foo")
    bar = await database.get_subnode("bar")
    baz = await database.get_subnode("baz")

    await bar.set_value("This can be any json-serializable object.") # Set a value (now "bar" is actually created)
    
    await baz.set_value({"type": "user", "name": "Gabe Newell"}) # Now "baz" is actually created

    text_subnode = await foo.get_subnode("text")

    await text_subnode.set_value("If you are reading this, this data saved correctly!") # Write text in a subnode's subnode. (now both "foo" and "foo/text" are created)

    print(await text_subnode.get_value()) # Read a value from the database

    await foo.delete() # Delete a subnode (do note that this also recursively deletes any subnodes under it)

    async for subnode in database.list_subnodes(): # Iterate over subnodes
        print(subnode.path)

    await database.set_value("Even the database itself is technically a node!")

asyncio.run(main())

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

keldb-0.1.2.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keldb-0.1.2-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file keldb-0.1.2.tar.gz.

File metadata

  • Download URL: keldb-0.1.2.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for keldb-0.1.2.tar.gz
Algorithm Hash digest
SHA256 a63a994733a248112e12047a9dce35441a7ab3f20e26dc7ee25f34a6f80051c8
MD5 0caede3baf31087bc6605f501334b311
BLAKE2b-256 03e44d5e264f980457eae3592bd6c08049f5ca68a64b76c20f79ce135ed723d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for keldb-0.1.2.tar.gz:

Publisher: python-publish.yml on TriangularDev/keldb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file keldb-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: keldb-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for keldb-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7ad3080a7d6a8aee921d42b1c394eba5a61dd37c34dedbf2084b5e2ad268f860
MD5 44bdddf4802f83ac7ef20f571e58dc27
BLAKE2b-256 67514fc86f4890c751e17636564ce20f08239cc9427d5c4dbc5c52bb650a0680

See more details on using hashes here.

Provenance

The following attestation bundles were made for keldb-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on TriangularDev/keldb

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

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