Skip to main content

An AsyncIO bridge for DBM.

Project description

An AsyncIO bridge for Python’s DBM library.

release python tests codecov docs pre-commit Code style: black

Description

  • Supports 100% of DBM and GDBM API

  • Typing support

  • Docstrings for all methods

  • Good test coverage

To ensure DBM can be used safely with AsyncIO, all DB operations are serialized and run in a separate thread.

This library is developed and tested primarily with GDBM, but should work with other implementations too.

Usage

Here is a basic example on how to use the queue:

import asyncio

import aiodbm


async def main():
    async with aiodbm.open("example.dbm", "c") as db:  # opening/creating database
        await db.set("alpha", "green")  # creating new key alpha with value green
        value = await db.get("alpha")  # fetching value for key alpha
        print(value)
        await db.delete("alpha")  # delete key alpha


asyncio.run(main())

Installation

You can install this library directly from PyPI with the following command:

pip install aiodbm

Reference

See also Python’s DBM documentation

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

aiodbm-0.2.0a1.tar.gz (11.1 kB view hashes)

Uploaded Source

Built Distribution

aiodbm-0.2.0a1-py3-none-any.whl (5.4 kB view hashes)

Uploaded Python 3

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