Skip to main content

dqlitepy

Python bindings for dqlite - Distributed SQLite

License Python PyPI

Build Status GitHub Issues Pull Requests GitHub Contributors


Python bindings for the dqlite distributed SQLite engine. Ships with a self-contained Go shim that bundles the native runtime—no system dependencies required.

📚 Documentation

Full Documentation →

Complete guides, API reference, clustering setup, and examples.

✨ Features

  • 🚀 Node Management - Create and manage dqlite nodes
  • 🔗 Cluster Support - Programmatically form and manage clusters
  • 📦 Self-Contained - No system dependencies required
  • 🔒 Thread-Safe - Safe for concurrent use
  • 🐍 DB-API 2.0 - Standard Python database interface
  • 🎯 SQLAlchemy Support - Use with your favorite ORM

🚀 Quick Start

Installation

pip install dqlitepy

Basic Usage

import dqlitepy

# Connect using DB-API 2.0
conn = dqlitepy.connect(
    address="127.0.0.1:9001",
    data_dir="/tmp/dqlite-data"
)

cursor = conn.cursor()
cursor.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name TEXT)")
cursor.execute("INSERT INTO users (name) VALUES (?)", ("Alice",))
conn.commit()

cursor.execute("SELECT * FROM users")
print(cursor.fetchall())
conn.close()

Node Management

from dqlitepy import Node
from pathlib import Path

# Create and start a node
with Node(
    address="127.0.0.1:9001",
    data_dir=Path("/tmp/dqlite-data"),
) as node:
    print(f"Node {node.id} running at {node.address}")

Clustering

from dqlitepy import Node, Client

# Start bootstrap node
node1 = Node("127.0.0.1:9001", "/data/node1")
node1.start()

# Connect client and add more nodes
with Client(["127.0.0.1:9001"]) as client:
    node2 = Node("127.0.0.1:9002", "/data/node2")
    node2.start()
    client.add(node2.id, "127.0.0.1:9002")
    
    # Query cluster state
    leader = client.leader()
    nodes = client.cluster()
    print(f"Leader: {leader}")
    for n in nodes:
        print(f"  Node {n.id}: {n.address} ({n.role_name})")

📖 Learn More

🛠️ Development

Building from Source

git clone https://github.com/vantagecompute/dqlitepy.git
cd dqlitepy

# Build native library using Docker
just build-lib

# Install in development mode
uv pip install -e .

Running Tests

# Run test suite
just unit

# Run linting and type checking
just lint
just typecheck

Project Commands

The project uses just for task automation:

sudo snap install just --classic
  • just unit - Run tests with coverage
  • just lint - Check code style
  • just typecheck - Run static type checking
  • just fmt - Format code
  • just build-lib - Build native library (Docker)
  • just docs-dev - Start documentation dev server

See the justfile for all available commands.

📝 License

This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

Copyright 2025 Vantage Compute

🤝 Contributing

Contributions welcome! Please see our Contributing Guide for details.

💬 Support

Metadata

Release files for dqlitepy 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dqlitepy 0.1.0
File Size Uploaded Provenance Actions
dqlitepy-0.1.0.tar.gz 879.0 kB Without provenance Details for dqlitepy-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for dqlitepy 0.1.0
File Interpreter ABI Platform Actions
dqlitepy-0.1.0-py3-none-any.whl Python 3 none any Details for dqlitepy-0.1.0-py3-none-any.whl

Total release size: 1.8 MB

Release files / dqlitepy-0.1.0.tar.gz

Download URL dqlitepy-0.1.0.tar.gz
Size 879.0 kB
Tags Source
SHA-256 checksum
How to use checksums
8996c48b44c09ef2d8338c00126b0742f92fdb319885589a85a1d992834d2916
BLAKE2b-256 checksum
How to use checksums
a0b0fa61eafd92f5862c6749523761fd4ccd101c1354fbfa166a755f4b4fa8ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.17

Release files / dqlitepy-0.1.0-py3-none-any.whl

Download URL dqlitepy-0.1.0-py3-none-any.whl
Size 887.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
740fe255cdf73d07c5999461d2d87f6e012fc7caafb2411991d51f2686ce9733
BLAKE2b-256 checksum
How to use checksums
908e12d276c0756e6caada38d2058829be2d219baee84d49438883925faf19c1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.8.17

Security for dqlitepy 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page