Skip to main content

Easy-to-use synchronous/asynchronous key-value database backed by sqlite3.

Project description

miftahdb version Downloads

Easy, Simple and powerful key-value database backed by sqlite3.

Features

  • Fast and easy-to-use database
  • Simultaneously asynchronous or synchronous calls
  • Store any data supported by pickle

Requirements

  • Python3.8+

Installation

pip install miftahdb

From github (dev version)

pip install git+https://github.com/miftahDB/miftahdb-python

Documentation

miftahdb documentation available at miftahdb.rtfd.io.

Usage

from miftahdb import Client # For sync version do: from miftahdb.sync import Client
import asyncio

async def main():
    async with Client("kv.sqlite") as db:

        key = "123-456-789"
        result = await db.set(key, "Hello world. Bye!")

        if await db.exists(key):
            get_key = await db.get(key)

            print(get_key) # Hello world. Bye!

            await db.delete(key)

            await db.set(key, "This key has a lifetime of 60 seconds", 60)

            print(await db.get(key))
        else:
            print("Key not found", result)


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

miftahdb-0.2.2.tar.gz (11.1 kB view details)

Uploaded Source

File details

Details for the file miftahdb-0.2.2.tar.gz.

File metadata

  • Download URL: miftahdb-0.2.2.tar.gz
  • Upload date:
  • Size: 11.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.5

File hashes

Hashes for miftahdb-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ca49e3e31f6240778e12eff57866d2e12887a7a5fe27f506134d5514b3f6257f
MD5 ac2d7be58c19122bd9fc3ea5fbdd41d4
BLAKE2b-256 43f4fc5a675eb1225d02e659b0f271644d91907e48b09406924de92b68cebec9

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