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.6 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.6 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.

🙏 Contributors

Special thanks to the following contributors who have helped improve RibbitXDB:


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.7.tar.gz (62.5 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.7-py3-none-any.whl (67.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.7.tar.gz
  • Upload date:
  • Size: 62.5 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.7.tar.gz
Algorithm Hash digest
SHA256 03a090ba2e2bfd74266c6f9e6b292bb889fb694989b9ff3c73f04863331974e9
MD5 b48d307fc948e3822f0109aed145a7c3
BLAKE2b-256 0c9c23e9a90f464c2b93b794cc90ed0c7dc1bd573f5ebdc9914b9780ff3eb78e

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 67.0 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.7-py3-none-any.whl
Algorithm Hash digest
SHA256 4c7d37e19ac6c281159c3f6be0527b7ebd747a657c7aa28b91b8ae2cb9ac0861
MD5 7ce350790d8f502fe001754bdbb9ad7e
BLAKE2b-256 d4c63af1ac4feebaf7ceb728ef8d9aec598dfccb69dc2c2b8e636e9a15255f74

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