python-tds
Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation
Decision gist · record as of 2026-08-14
Yes. This is a mature, actively maintained driver with no known vulnerabilities, low install friction, and permissive licensing. It fills a genuine need for pure-Python MSSQL connectivity on non-Windows platforms. Install it if you need to connect to MSSQL from Python without external system dependencies.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Low friction installation with no runtime dependencies.
- Actively maintained as of 2026-08-07 with recent release history.
License · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open and closed-source projects.
last release 2025-09-13 (335 days) · last repo commit 2026-08-07 · 218 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,254,407 downloads/mo, #2,348 on PyPI
Alternatives
Verify before relying
pip install python-tds
Connection example from documentation:
with connect('server', 'database', 'user', 'password') as conn:
with conn.cursor() as cur:
cur.execute("select 1")
cur.fetchall()- Whether Kerberos support on non-Windows platforms is production-ready given the 'experimental' label in the description.
- Performance characteristics compared to other MSSQL drivers in typical workloads.
- Compatibility with specific MSSQL versions beyond the 2008 date types mentioned.
- Whether optional packages (pyOpenSSL, bitarray, kerberos) are required or truly optional for core functionality.
What it is and what it does
python-tds is a pure Python DBAPI driver for Microsoft SQL Server that implements the TDS (Tabular Data Stream) protocol directly, without depending on external libraries like ADO or FreeTDS. This makes it portable across Linux, macOS, and Windows. It follows the Python DBAPI standard, so it integrates with standard database tooling and ORMs like django-sqlserver.
The driver supports MSSQL 2008 date types (datetime2, date, time, datetimeoffset), MARS, bulk insert, table-valued parameters, TLS encryption, and token-based authentication. Optional packages can extend functionality for TLS, performance, and Kerberos support on non-Windows platforms. Connection uses standard cursor operations after calling connect() with credentials or a token callable.
Use it for
- Connect to MSSQL databases from Python on Linux or macOS without installing FreeTDS or ADO.
- Use as a Django database backend via django-sqlserver for MSSQL-backed Django projects.
- Implement token-based authentication to Azure SQL Database using access token callables.
- Perform bulk inserts or use table-valued parameters for high-performance data operations.
- Establish encrypted TLS connections to MSSQL servers by providing a CA certificate file.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
This is a mature, actively maintained driver with no known vulnerabilities, low install friction, and permissive licensing. It fills a genuine need for pure-Python MSSQL connectivity on non-Windows platforms. Install it if you need to connect to MSSQL from Python without external system dependencies.
Install
python-tds on PyPI
Before you install
Low friction installation with no runtime dependencies. Actively maintained as of 2026-08-07 with recent release history.
License in practice
MIT license permits unrestricted use, modification, and distribution in both open and closed-source projects.
Quickstart
pip install python-tds
Connection example from documentation:
with connect('server', 'database', 'user', 'password') as conn:
with conn.cursor() as cur:
cur.execute("select 1")
cur.fetchall()
Verify before relying
- Whether Kerberos support on non-Windows platforms is production-ready given the 'experimental' label in the description.
- Performance characteristics compared to other MSSQL drivers in typical workloads.
- Compatibility with specific MSSQL versions beyond the 2008 date types mentioned.
- Whether optional packages (pyOpenSSL, bitarray, kerberos) are required or truly optional for core functionality.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 335 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,254,407 / month, #2,348 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 4 - BetaProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9 |
Evidence: python_tds-1.17.1-py3-none-any.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 › “mssql python driver”
- python-tdsPure Python DBAPI driver for MSSQL that implements the TDS protocol…
- pymssqlpymssql provides a Python DB-API interface to Microsoft SQL Server,…
- mssql-pythonA Python driver for connecting to and querying Microsoft SQL Server,…
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 sqlalchemy-pytds · pymssql · mssql-django · mssql-python · pyadomd · pymonetdb · mssql · presto-python-client · bcpandas · adbc-driver-sqlite