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.1.2.tar.gz (1.8 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.1.2-cp39-abi3-win_amd64.whl (5.2 MB view details)

Uploaded CPython 3.9+Windows x86-64

vibesql-0.1.2-cp39-abi3-manylinux_2_38_x86_64.whl (6.2 MB view details)

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

vibesql-0.1.2-cp39-abi3-manylinux_2_35_aarch64.whl (5.9 MB view details)

Uploaded CPython 3.9+manylinux: glibc 2.35+ ARM64

vibesql-0.1.2-cp39-abi3-macosx_11_0_arm64.whl (5.3 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

vibesql-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl (5.7 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

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

File metadata

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

File hashes

Hashes for vibesql-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8da57b0ca22034cb66f6048eb14d4125ae674204c41adde51d0f94d17c5e720a
MD5 8ddd7f466de97d8e75a1e5a90d745af6
BLAKE2b-256 5ca4dda35a01853485282f09c140ae810b44366ec86fd4fd46d17b35b7ae3cbe

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.1.2.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.1.2-cp39-abi3-win_amd64.whl.

File metadata

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

File hashes

Hashes for vibesql-0.1.2-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 b2e9872fe63bad3f547bd72bcfddde3d325ce92f5a3a25122017e5e739ae877a
MD5 673ef514c00716d2f0e900fd81cd803b
BLAKE2b-256 b71c30ffda1524c5c9275f10ecb7e53cf7201ca04b7112e93191cd32262c8f9d

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.1.2-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.1.2-cp39-abi3-manylinux_2_38_x86_64.whl.

File metadata

File hashes

Hashes for vibesql-0.1.2-cp39-abi3-manylinux_2_38_x86_64.whl
Algorithm Hash digest
SHA256 036d10a2beab3cb0108b07d24f1ce5cad75e9439e37958d42bed5b0d444c0291
MD5 84b7bcaa7d61d2ea572d29338deb241a
BLAKE2b-256 31ad0a023dafdcd6bcb1791db03b320fdf2cb33790bf329020289ca5ea9b6980

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.1.2-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.1.2-cp39-abi3-manylinux_2_35_aarch64.whl.

File metadata

File hashes

Hashes for vibesql-0.1.2-cp39-abi3-manylinux_2_35_aarch64.whl
Algorithm Hash digest
SHA256 63f29c2dceac96708762c67fe3f253f56a5f8bd29b51e1326905419419ff450a
MD5 fec3b4c2bfba5e511f2a179d83680c5a
BLAKE2b-256 fa9b23fc2523fa23b139b8e4d33df219df80090e9299e6d20d6fdeee4246a46b

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.1.2-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.1.2-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for vibesql-0.1.2-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9f4c51c3d6d536bba179c1807440c6fcf6132a6886e5726c159ff42ee8ef0822
MD5 5aeb4a79e897da693c4941395de44170
BLAKE2b-256 916894c2056f0de82459742820e71386385a980be361944493ec0a8d538e35f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.1.2-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.1.2-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for vibesql-0.1.2-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 ab42baabd19f931e5a663b0faab51fb5ab30443da02bf9622b48a328d715ceff
MD5 2acdbc68bd213f0835a8be68f1dca413
BLAKE2b-256 ddb9c74438896fcdf264684d16df8fdcd371cd11fd427503df56fc186c5a5d29

See more details on using hashes here.

Provenance

The following attestation bundles were made for vibesql-0.1.2-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