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.

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.6.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.6-py3-none-any.whl (66.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.6.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.6.tar.gz
Algorithm Hash digest
SHA256 c4865cd60b5ae6a61a4f9de560541bf484b05d0c0c3301058465e13d992f7a50
MD5 29acc086196ee81981d2b3233d9f7e92
BLAKE2b-256 9487c11a2518a1b2e5c96cea3c84a4029f9058c4fc25dc029e3966946f3a5689

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.6-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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 29d5e5b98e27d9ecd50d56256db98022a69b5c36da347ade9414e90bff2ecbce
MD5 d89b211f1ca0f7fc845bc1f3d2a49724
BLAKE2b-256 8761c560c1feefcfc60a1e5f12b366d7308799fd736be641ef8844ff0db16fba

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