Skip to main content

Drop-in SQLite alternative with async API, migrations, schema introspection, and 100% SQL compatibility

Project description

RibbitXDB

RibbitXDB Logo

The Modern, Async-First Embedded Database for Python

PyPI Version Python Versions License Downloads


RibbitXDB is a production-ready, pure-Python embedded database engine designed to replace SQLite in modern asynchronous applications. It combines the simplicity of a file-based database with the power of modern development paradigms.

🚀 Why RibbitXDB?

  • ⚡ Async Native: Built-in async/await support for non-blocking I/O.
  • 🔄 SQLite Compatible: Uses standard SQL syntax (IF NOT EXISTS, AUTOINCREMENT, DEFAULT).
  • 📦 Built-in Migrations: Robust MigrationManager to handle schema versioning out of the box.
  • 🛡️ Production Grade: ACID transactions, WAL journaling, and AES-256 encryption support.
  • 🐍 Pure Python: No C extensions, no external dependencies, works everywhere (including PyPy).

📦 Installation

pip install ribbitxdb

🏎️ Quick Start

Modern Async API

Perfect for FastAPI, Sanic, or Discord bots.

import asyncio
from ribbitxdb import connect_async

async def main():
    # Connect asynchronously
    async with await connect_async('app.rbx') as conn:
        cursor = await conn.cursor()
        
        # Create table
        await cursor.execute("""
            CREATE TABLE IF NOT EXISTS users (
                id INTEGER PRIMARY KEY AUTOINCREMENT,
                username TEXT NOT NULL UNIQUE,
                email TEXT,
                created_at TEXT DEFAULT CURRENT_TIMESTAMP
            )
        """)
        
        # Insert data
        await cursor.execute(
            "INSERT INTO users (username, email) VALUES (?, ?)", 
            ('ribbit_fan', 'fan@ribbitx.com')
        )
        
        # Query data
        await cursor.execute("SELECT * FROM users")
        row = await cursor.fetchone()
        print(f"User: {row['username']}")

asyncio.run(main())

Classic Synchronous API

Drop-in replacement for sqlite3.

import ribbitxdb

with ribbitxdb.connect('legacy.rbx') as conn:
    cursor = conn.cursor()
    cursor.execute("SELECT * FROM products WHERE price > ?", (100,))
    for row in cursor.fetchall():
        print(row)

🛠️ Integrated Migrations

Stop using external tools for simple schema changes. RibbitXDB has migration support built-in.

from ribbitxdb.migrations import MigrationManager

# Setup
conn = ribbitxdb.connect('app.rbx')
migrator = MigrationManager(conn)
migrator.set_migrations_directory('./migrations')

# Generate a new migration
# Creates: ./migrations/20251222_add_posts.sql
migrator.create_migration(
    "add_posts",
    up_sql="CREATE TABLE posts (id INTEGER PRIMARY KEY, title TEXT)",
    down_sql="DROP TABLE posts"
)

# Apply pending migrations
migrator.up()

# Revert last migration
migrator.down()

🔍 Deep Introspection

RibbitXDB exposes system tables for powerful debugging.

-- See your schema
SHOW TABLES;
DESCRIBE users;

-- Check indexes
SHOW INDEXES users;

-- Explain query plan
EXPLAIN SELECT * FROM users WHERE id = 1;

⚙️ Advanced Configuration

Connection Pooling

For high-concurrency environments.

from ribbitxdb import ConnectionPool

pool = ConnectionPool('app.rbx', min_connections=5, max_connections=20)
with pool.get_connection() as conn:
    # ... use connection

Encryption & Security

Protect sensitive data at rest.

# Enable AES-256 Encryption
conn = ribbitxdb.connect('secure.rbx', encryption_key=b'my_secret_32_byte_key...')

📊 Performance Benchmark

Operation RibbitXDB v1.1.4 SQLite3 (Python)
Connection 0.05ms 0.08ms
Bulk Insert (10k) 0.28s 0.35s
Async Select Native Wrapper Overhead
Dependencies 0 0

🗺️ Roadmap & Ecosystem

RibbitXDB is constantly evolving. v1.1.4 introduces the core stability features needed for mission-critical deployments. Future updates will focus on:

  • Remote Server Mode (TCP/TLS) improvements.
  • Distributed Replication.
  • JSON Document Store features.

Built with ❤️ for the Python Community
DocumentationSource CodePyPI

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

ribbitxdb-1.1.5.tar.gz (62.1 kB view details)

Uploaded Source

Built Distribution

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

ribbitxdb-1.1.5-py3-none-any.whl (66.5 kB view details)

Uploaded Python 3

File details

Details for the file ribbitxdb-1.1.5.tar.gz.

File metadata

  • Download URL: ribbitxdb-1.1.5.tar.gz
  • Upload date:
  • Size: 62.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ribbitxdb-1.1.5.tar.gz
Algorithm Hash digest
SHA256 04de071ea280febbe612cc00c62db57add9af30511512ef3918115d2a6686551
MD5 ab8123c4fe9df8b0a206445d827ff616
BLAKE2b-256 e80547a01db7c072c90c9b9506293fc85ec7fc67661180d36d34602bf7f8a808

See more details on using hashes here.

File details

Details for the file ribbitxdb-1.1.5-py3-none-any.whl.

File metadata

  • Download URL: ribbitxdb-1.1.5-py3-none-any.whl
  • Upload date:
  • Size: 66.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.7

File hashes

Hashes for ribbitxdb-1.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 eb814c3869260c4424652cd04a95774350823a797dd7fbca500e6bf2f009970f
MD5 eabd0970b3ce28412388c25307d1c638
BLAKE2b-256 a7c7e9f1a4dc0617743b311cb608c08c808d95feee21e28894566adfe65fb83c

See more details on using hashes here.

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