ydb-dbapi
YDB Python DBAPI which complies with PEP 249
What it is and what it does
ydb-dbapi is a Python database adapter that bridges Python applications to YDB, a distributed SQL database. It implements the standard Python DBAPI interface (PEP 249), allowing developers to use familiar connection, cursor, and query patterns. The driver offers both synchronous and asynchronous APIs, so you can choose blocking or non-blocking execution depending on your application's needs.
The package handles parameter binding in two modes: a standard Python DB-API mode with %(name)s and %s placeholders (opt-in via pyformat=True), and a native YDB mode using $name placeholders. It automatically maps Python types (bool, int, float, str, bytes, datetime, Decimal) to YDB types, and lets you override type inference with ydb.TypedValue when needed. The single runtime dependency is ydb itself, keeping the install footprint minimal.
Use it for:
- Building Python web applications that need to query YDB as their primary data store using standard DBAPI patterns.
- Writing async Python services that require non-blocking database access to YDB without blocking the event loop.
- Migrating from other databases to YDB by using familiar PEP 249 connection and cursor semantics.
- Executing parameterized queries with automatic type conversion from Python values to YDB types.
- Using explicit type control via ydb.TypedValue when automatic inference doesn't match the required YDB schema.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
A Python DBAPI driver for YDB that provides sync and async database connections compliant with PEP 249, supporting parameterized queries with automatic type mapping.
Yes, if you are using YDB and need a standard Python database adapter. The package is actively maintained, has low install friction, and complies with PEP 249. However, verify the license terms (currently unclear in the metadata) before committing to production use, and note that the project is relatively young (first release October 2024).
Install
ydb-dbapi on PyPI
pip
pip install ydb-dbapiuv
uv add ydb-dbapipoetry
poetry add ydb-dbapiInstalling ydb-dbapi
Before you install
Low friction install with a single runtime dependency (ydb). Actively maintained with recent commits and releases within the last year.
License in practice
License status is unclear—no SPDX identifier or raw license text is available in the package metadata. Verify the actual license terms before use in proprietary or restricted contexts.
Quickstart
pip install ydb-dbapi
import ydb_dbapi
connection = ydb_dbapi.connect(
host="localhost", port="2136", database="/local"
)
with connection.cursor() as cursor:
cursor.execute("SELECT id, val FROM table")
rows = cursor.fetchall()
Requires a running YDB server accessible at the specified host and port; connection details (host, port, database) must be provided.
Verify before relying
- Whether the package is actively maintained beyond the last commit date shown (2026-08-06).
- Production readiness and stability guarantees given the relatively recent first release (2024-10-30).
- Performance characteristics and scalability limits for high-volume query workloads.
Package facts
| License | not declared (unclear) |
| Python support | supports the current Python release (<4.0,>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — ydb |
| Maintenance | actively maintained — 94 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,056,770/month — #2,388 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: ydb_dbapi-0.1.22-py3-none-any.whl
Tags
More Front-Ends packages
SQLAlchemy is a Python SQL toolkit and Object…
permissive · top 100 on PyPI
psycopg2-binarypsycopg2-binary is a PostgreSQL database…
copyleft · top 1,000 on PyPI
alembicAlembic generates and manages database schema…
permissive · top 1,000 on PyPI
weaviate-clientA Python client library for connecting to and…
permissive · top 1,000 on PyPI
databricks-sql-connectorA Python client library that connects to…
permissive · top 1,000 on PyPI
psycopgPsycopg 3 is a PostgreSQL database adapter for…
copyleft · top 1,000 on PyPI
databend-driverPython client library for connecting to…
permissive · top 15,000 on PyPI
pyhdbA pure Python client library for connecting to…
permissive · top 15,000 on PyPI
ydbYDB Python SDK is the official client library…
permissive · top 1,000 on PyPI
intersystems-irispythonProvides Python bindings to connect to and…
unclear · top 15,000 on PyPI
hdbcliA PEP 249-compliant Python database driver for…
unclear · top 5,000 on PyPI
databricks-dbapiProvides a DBAPI 2.0 connection interface and…
permissive · top 15,000 on PyPI
asynchasynch is an asynchronous ClickHouse driver…
permissive · top 5,000 on PyPI
dbapiCommand-line client for interacting with Douban…
permissive · top 15,000 on PyPI
PyMySQLPyMySQL is a pure-Python MySQL and MariaDB…
permissive · top 1,000 on PyPI
pymgclientpymgclient is a Python adapter for Memgraph…
permissive · top 15,000 on PyPI