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

Uploaded Python 3

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.6.4.tar.gz
  • Upload date:
  • Size: 62.0 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.4.tar.gz
Algorithm Hash digest
SHA256 42816f954eba16767f9044fa6471d87b64316e12d0f12a024855a1ad837d8ce1
MD5 f3f9a3b3158aedf7c0dac70535ccf145
BLAKE2b-256 cf1fc0db4594cb52b979a2f8b65abff58e1b92eb1cd5b557e86b468747ab20e6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.6.4-py3-none-any.whl
  • Upload date:
  • Size: 66.6 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 27a3125a0f093b288462a154a8cc2bd47cbebab6870543688cf13513c06d97ea
MD5 58030f6751e98413d8df07b22057debf
BLAKE2b-256 9b6f79104681b9c7a028303b5e832883dc94e24a747e3fef2551ea3e7d9d48ad

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