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.6.5.tar.gz (62.3 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.5-py3-none-any.whl (66.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.6.5.tar.gz
  • Upload date:
  • Size: 62.3 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.5.tar.gz
Algorithm Hash digest
SHA256 f4aaf955e0897b68282f8e9a7912b68deeb3678b3ae75208e1c4c2a59dda9546
MD5 1fc4e1547c60bff8037a365ca18cdea3
BLAKE2b-256 382d24634551c8722beca24e4d5e7974118f0f9c5c2b765deb1075ba3bee488d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: ribbitxdb-1.1.6.5-py3-none-any.whl
  • Upload date:
  • Size: 66.7 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.5-py3-none-any.whl
Algorithm Hash digest
SHA256 af63d33d43cef382f25eca1b1fa60236cf154b3cb3cdcd09604df1f5b121f551
MD5 f7c4ebabd5e8ae0de8935ca01e2eaef4
BLAKE2b-256 4ce5a68d9ba96d8a2464d75069d1ee6ba6d2ff562bfbbb220979ef038044d6ac

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