Skip to main content

Python bindings for VibeSQL SQL database engine

Project description

vibesql-python-bindings

Python bindings for VibeSQL SQL database engine.

Overview

This crate provides Python bindings following DB-API 2.0 conventions, allowing VibeSQL to be used from Python applications for testing, benchmarking, and integration.

Features

  • DB-API 2.0 Compliant: Standard Python database interface
  • Type Conversions: Automatic conversion between Python and SQL types
  • Connection Pooling: Efficient connection management
  • Cursor Support: Full cursor API with fetchone/fetchmany/fetchall
  • Performance Profiling: Built-in profiling utilities for benchmarking
  • Native Speed: Zero-copy access to Rust implementation

Installation

pip install vibesql

Usage

import vibesql

# Create a connection
db = vibesql.connect()

# Get a cursor
cursor = db.cursor()

# Execute DDL
cursor.execute("CREATE TABLE users (id INTEGER PRIMARY KEY, name VARCHAR(50))")

# Insert data
cursor.execute("INSERT INTO users VALUES (1, 'Alice')")
cursor.execute("INSERT INTO users VALUES (2, 'Bob')")

# Query data
cursor.execute("SELECT * FROM users WHERE id > ?", [1])
result = cursor.fetchall()
print(result)  # [(2, 'Bob')]

# Close connection
db.close()

Context Manager Support

import vibesql

with vibesql.connect() as db:
    cursor = db.cursor()
    cursor.execute("SELECT 1")
    print(cursor.fetchone())

Building

Note: Python bindings are excluded from the default workspace build to avoid requiring Python development headers. To build the Python bindings, you need Python 3.8+ and development headers installed.

Prerequisites

macOS:

# Python 3.8+ should already include development headers
python3 --version  # Verify Python is installed

Ubuntu/Debian:

sudo apt-get install python3-dev

Fedora/RHEL:

sudo dnf install python3-devel

Building the Package

# 1. Install maturin (Python packaging tool for Rust)
pip install maturin

# 2. Navigate to the Python bindings directory
cd crates/vibesql-python-bindings

# 3. Build and install for local development (recommended for testing)
maturin develop

# 4. Or build a wheel for distribution
maturin build --release
# Wheel will be in: target/wheels/vibesql-0.1.0-*.whl

# 5. Install the wheel
pip install target/wheels/vibesql-0.1.0-*.whl

Quick Build Script

From the repository root:

./scripts/build-python.sh

This script will:

  • Check for Python development headers
  • Install maturin if needed
  • Build the wheel in release mode
  • Show installation instructions

Building with Cargo (Advanced)

If you need to build as part of the workspace:

# From repository root
cargo build --package vibesql-python-bindings --release

Note: This only builds the Rust library, not the Python package. Use maturin for the full Python package.

Documentation

License

This project is licensed under either of:

at your option.

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

vibesql-0.2.0.tar.gz (3.4 MB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

vibesql-0.2.0-cp39-abi3-win_amd64.whl (7.6 MB view details)

Uploaded CPython 3.9+Windows x86-64

vibesql-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl (8.6 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.38+ x86-64

vibesql-0.2.0-cp39-abi3-manylinux_2_35_aarch64.whl (8.2 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.35+ ARM64

vibesql-0.2.0-cp39-abi3-macosx_11_0_arm64.whl (7.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

vibesql-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl (7.9 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file vibesql-0.2.0.tar.gz.

File metadata

  • Download URL: vibesql-0.2.0.tar.gz
  • Upload date:
  • Size: 3.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vibesql-0.2.0.tar.gz
Algorithm Hash digest
SHA256 7854652a937a28301972e641002bb056a4c99e037bfbb09ef1012e4f30624141
MD5 f341374ae9143152b2c15be728dc7260
BLAKE2b-256 fc0ae102cf112518c0401d467066800b721a144e9790d299bae4c534cf31cc06

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.2.0.tar.gz:

Publisher: release-pypi.yml on rjwalters/vibesql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibesql-0.2.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: vibesql-0.2.0-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 7.6 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for vibesql-0.2.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 571e018e6e9d4c4ea7be5c00751d4a4afccf171187c209313144c2a7467878e8
MD5 29c6bb764fc9b24c9894a2e3d908deca
BLAKE2b-256 20538eccd3d58bc3ae0d92c17c64ff1e192ce193632512d73117ec940837739c

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.2.0-cp39-abi3-win_amd64.whl:

Publisher: release-pypi.yml on rjwalters/vibesql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibesql-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for vibesql-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 1b13b585cfed929108b17a0ebb068b8a7017079a4e5d1553fadd06b01de6b054
MD5 024d08a6339251a7fff4b5605ebc9270
BLAKE2b-256 b8903798594f8679cf834455975b67023c199778481354603771b53ffbb263bb

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.2.0-cp39-abi3-manylinux_2_38_x86_64.whl:

Publisher: release-pypi.yml on rjwalters/vibesql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibesql-0.2.0-cp39-abi3-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for vibesql-0.2.0-cp39-abi3-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 d239c53b23b5d9d9848c82e0bb79d928d8a3a8c322e2d8037079b14356023be1
MD5 853607cd25724a3442b43b522453d021
BLAKE2b-256 ade77f4196d483af8e6d772142d28d5178e667b3cec00b52048921e6449f6a89

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.2.0-cp39-abi3-manylinux_2_35_aarch64.whl:

Publisher: release-pypi.yml on rjwalters/vibesql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibesql-0.2.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vibesql-0.2.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 381496e34025a096b8b04e97be6a5cdeac12cbd7955d259610f99f80de5a099b
MD5 74d52dbaee460e9a75195249325aad3d
BLAKE2b-256 a43ed3c023abf7dc67a3b5c36185c571d1f06c47a03614b065cd56cc479abc47

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.2.0-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release-pypi.yml on rjwalters/vibesql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file vibesql-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vibesql-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 337f437d81045c4ecea0e7cfb8771614e777b8409b86328157d1eafdd882cefc
MD5 f06b71ea81945e683962e3f576e43550
BLAKE2b-256 0b8c3583fa35039f2385fbd7ef119cbf3db2001984a2397a5bc580a35ba3372e

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.2.0-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release-pypi.yml on rjwalters/vibesql

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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