Skip to main content

BabaDB

BabaDB is a simple asynchronous database with data protection via SHA-256 hashing and a convenient API based on Pydantic models and SQLModel-like syntax.

Installation

pip install babadb

Quick Start

import asyncio
from pydantic import BaseModel
from babadb import BabaEngine, BabaTable, BabaSession

class User(BaseModel):
    name: str
    age: int

async def main():
    engine = BabaEngine("data.baba", logging="false")
    session = BabaSession(engine)
    user_table = BabaTable(User)

    async with session:
        await session.insert(user_table, User(name="Alice", age=31))
        await session.insert(user_table, User(name="Bob", age=25))
        users = await session.all(user_table)
        for user in users:
            print(user)

asyncio.run(main())

Features

  • Asynchronous sessions with async with
  • Data modeled using Pydantic for validation and type safety
  • Data stored securely as a single SHA-256 hash in .baba files
  • Configurable logging (console, file, or disabled)
  • Colored console logs for INFO (green), WARNING (yellow), and ERROR (red)

Usage

  • Create Pydantic models representing your tables
  • Instantiate BabaEngine with the storage file path and logging option
  • Use BabaSession for async database sessions
  • Use BabaTable to bind Pydantic models to tables
  • Use session methods like insert and all for data operations

Logging Options

  • "console" (default): logs printed to console with colors
  • "file": logs saved to baba_logs/ folder with timestamped filenames
  • "false": logging disabled

License

MIT License

Metadata

Release files for babadb 1.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for babadb 1.1.2
File Size Uploaded Provenance
babadb-1.1.2.tar.gz 3.5 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for babadb 1.1.2
File Interpreter ABI Platform
babadb-1.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / babadb-1.1.2.tar.gz

Download URL babadb-1.1.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
0a26da33d088596f9f1361adc9168ea90ad9790598810d354f980c43956a800c
BLAKE2b-256 checksum
How to use checksums
fcb7e7014d21601a769dd4b8c253c5382ec4c43bafa09f6ae446f3462d020eb9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Release files / babadb-1.1.2-py3-none-any.whl

Download URL babadb-1.1.2-py3-none-any.whl
Size 4.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
538b5107ce3ddc3c62a7ae29a0ce88f700431e3e898e93fb7c18151f61f70bec
BLAKE2b-256 checksum
How to use checksums
4c85f36c04372c62f76921df86c5dca7118b471ba9b8a644061e7431753d1f63
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.3

Security for babadb 1.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page