--- id: python-tds version: "1.17.1" license: MIT license_treatment: permissive maintenance: active --- # python-tds — Python DBAPI driver for MSSQL using pure Python TDS (Tabular Data Stream) protocol implementation License: permissive · Maintenance: active · Downloads: 4.3M/mo ## 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 above — verify before relying. Pure Python DBAPI driver for MSSQL that implements the TDS protocol without requiring ADO or FreeTDS, enabling database connections on any platform. 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 pip install python-tds uv add python-tds poetry add python-tds ## Installing python-tds 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: unspecified - Install friction: low - Maintenance: active - Downloads: 4.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags mssql python driver, tds protocol client, sql server connection, pure python database driver, dbapi mssql, cross-platform sql server, tds tabular data stream, mssql, dbapi, tds-protocol [View on SkillFed](https://skillfed.io/packages/python-tds) · [View on PyPI](https://pypi.org/project/python-tds/)