pyodbc
DB API module for ODBC
Decision gist · record as of 2026-08-14
Yes, if your application needs to access ODBC databases and the required ODBC driver manager and database drivers are available on your system. The package is stable (Development Status 5 - Production/Stable), actively maintained, and widely used. Install only if ODBC infrastructure is confirmed available; otherwise, consider a native database driver for your specific database.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- An ODBC driver manager and database-specific ODBC driver must be installed on the system; a C++ compiler is needed if installing from source.
- Medium install friction: precompiled wheels exist for multiple Python versions on Windows, macOS, and Linux, but on other platforms you must build from source, requiring a C++ compiler.
- The project is actively maintained with recent commits.
License · maintenance · safety
MIT (permissive) — MIT license is permissive; you may use, modify, and distribute pyodbc with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2025-10-17 (301 days) · last repo commit 2026-06-06 · 3,078 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 43,612,249 downloads/mo, #641 on PyPI
Alternatives
Verify before relying
import pyodbc
conn = pyodbc.connect('Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=mydb;UID=user;PWD=pass')
cursor = conn.cursor()
cursor.execute('SELECT * FROM table')
for row in cursor:
print(row)
conn.close()- Exact Python versions and platforms for which precompiled wheels are available beyond what the friction evidence shows
- Performance characteristics and connection pooling capabilities compared to native database drivers
- Whether Windows has ODBC driver manager built-in as claimed in the description
What it is and what it does
pyodbc is a Python module that bridges code to ODBC databases—SQL Server, Access, and others—using the standard DB API 2.0 interface. It wraps the ODBC driver layer, letting you write SQL queries and fetch results in a Pythonic way without learning database-specific APIs. The module is implemented in C++ and provides precompiled wheels for common Python versions and platforms, though it requires an ODBC driver manager and the appropriate database driver to be installed separately.
You use it by creating a connection string pointing to your database, opening a connection, creating a cursor, and executing SQL. It is particularly useful when you need to work with legacy systems or databases where native Python drivers do not exist, or when your infrastructure already has ODBC set up. The main constraint is the system-level dependency: the ODBC infrastructure must be in place before installation.
Use it for
- Connect to SQL Server from Python applications without installing SQL Server's native driver.
- Query Microsoft Access databases from Python scripts for data extraction or reporting.
- Build ETL pipelines that read from or write to ODBC-compatible databases in a standardized way.
- Migrate legacy ODBC-based applications to Python while reusing existing ODBC driver configurations.
- Develop database tools that work with multiple ODBC data sources without rewriting connection logic.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes, if your application needs to access ODBC databases and the required ODBC driver manager and database drivers are available on your system.
The package is stable (Development Status 5 - Production/Stable), actively maintained, and widely used. Install only if ODBC infrastructure is confirmed available; otherwise, consider a native database driver for your specific database.
Install
pyodbc on PyPI
Before you install
Medium install friction: precompiled wheels exist for multiple Python versions on Windows, macOS, and Linux, but on other platforms you must build from source, requiring a C++ compiler. The project is actively maintained with recent commits.
An ODBC driver manager and database-specific ODBC driver must be installed on the system; a C++ compiler is needed if installing from source.
License in practice
MIT license is permissive; you may use, modify, and distribute pyodbc with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
import pyodbc
conn = pyodbc.connect('Driver={ODBC Driver 17 for SQL Server};Server=localhost;Database=mydb;UID=user;PWD=pass')
cursor = conn.cursor()
cursor.execute('SELECT * FROM table')
for row in cursor:
print(row)
conn.close()
Verify before relying
- Exact Python versions and platforms for which precompiled wheels are available beyond what the friction evidence shows
- Performance characteristics and connection pooling capabilities compared to native database drivers
- Whether Windows has ODBC driver manager built-in as claimed in the description
Package facts
| License | MIT permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Medium. Platform-specific wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 301 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 43,612,249 / month, #641 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersIntended Audience :: System AdministratorsOperating System :: Microsoft :: WindowsOperating System :: POSIXProgramming Language :: PythonProgramming Language :: Python :: 3Topic :: Database |
Evidence: pyodbc-5.3.0-cp310-cp310-macosx_10_9_x86_64.whl; pyodbc-5.3.0-cp310-cp310-macosx_11_0_arm64.whl; pyodbc-5.3.0-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyodbc-5.3.0-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyodbc-5.3.0-cp310-cp310-musllinux_1_2_aarch64.whl; pyodbc-5.3.0-cp310-cp310-musllinux_1_2_x86_64.whl; pyodbc-5.3.0-cp310-cp310-win32.whl; pyodbc-5.3.0-cp310-cp310-win_amd64.whl; pyodbc-5.3.0-cp310-cp310-win_arm64.whl; pyodbc-5.3.0-cp311-cp311-macosx_10_9_x86_64.whl; pyodbc-5.3.0-cp311-cp311-macosx_11_0_arm64.whl; pyodbc-5.3.0-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; pyodbc-5.3.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; pyodbc-5.3.0-cp311-cp311-musllinux_1_2_aarch64.whl; pyodbc-5.3.0-cp311-cp311-musllinux_1_2_x86_64.whl; pyodbc-5.3.0-cp311-cp311-win32.whl; pyodbc-5.3.0-cp311-cp311-win_amd64.whl; pyodbc-5.3.0-cp311-cp311-win_arm64.whl; pyodbc-5.3.0-cp312-cp312-macosx_10_13_x86_64.whl; pyodbc-5.3.0-cp312-cp312-macosx_11_0_arm64.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “ODBC database access python”
- pyodbcpyodbc provides Python access to ODBC databases through a DB API…
- pypyodbcpypyodbc provides a pure Python ODBC interface for connecting to…
- arrow-odbcReads data from ODBC data sources directly into Apache Arrow record…
Give your agent the search over MCP, or paste the wish link into any chat.
More Database packages
psycopg2-binary is a PostgreSQL database adapter for Python that implements the DB API 2.0 specification, enabling Python applications to connect to and query PostgreSQL databases with thread-safe concurrent operations.
Python client library for connecting to and executing commands against Redis key-value stores, supporting both synchronous and asynchronous operations.
Install it if your application needs to interact with Redis; the only prerequisite is a running Redis server instance.
YDB Python SDK is the official client library for connecting to and querying YDB databases from Python applications.
Install it if you need to connect Python applications to YDB databases.
Connects Python applications to Snowflake data warehouses using the DB API 2.0 specification, enabling SQL queries, data transfers, and warehouse operations.
sqlparse tokenizes SQL text into a tree of statements, clauses, and expressions, and provides functions to split scripts, format queries, and inspect parsed tokens without validating dialect or syntax.
Install it if you need to manipulate, format, or analyze SQL text programmatically.
Provides base adapter protocols and shared functionality that database adapters use to integrate with dbt-core, handling connections, dialect translation, relation caching, and core interface management.
See also aioodbc · pypyodbc · PIconnect · arrow-odbc · ibm-db · mssql-python-odbc · sqlparams · mssql-python · firebolt-sdk · mssql