Initializing...

Tubox Python SDK

The official high-performance Python driver for Tubox. Built on asyncio, it provides a native interface to the Crous engine's atomic capabilities.

High Performance

Uses a custom binary protocol for minimal serialization overhead. Benchmarks show up to 10k ops/sec on a single core.

Type Safe

Fully typed with Python type hints. Great IDE support and reduced runtime errors.

Quickstart

main.py
import asyncio
from tubox_client import TuboxClient

async def main():
    # Connect to local Tubox instance
    client = TuboxClient(host="localhost", port=7188)
    await client.connect()
    
    try:
        await client.authenticate("admin", "password")
        
        db = client["mydb"]
        users = db["users"]
        
        # Async Insert
        res = await users.insert_one({"name": "Alice"})
        print(f"Inserted: {res.data}")
        
    finally:
        await client.close()

if __name__ == "__main__":
    asyncio.run(main())

Last updated: Dec 14, 2025