A Python driver for Microsoft SQL Server and Azure SQL databases with DB API 2.0 compliance and Microsoft Entra ID authentication.
mssql-python is a Python database driver that provides connectivity to Microsoft SQL Server and the Azure SQL family of databases. It enables Python applications to perform database operations like query execution, connection management, and transaction handling using a DB API 2.0 compliant interface. The driver uses Direct Database Connectivity (DDBC) to establish direct connections without requiring an external driver manager.
Python developers building applications that need to interact with Microsoft SQL Server, Azure SQL Database, or Azure SQL Managed Instance. This includes data engineers, backend developers, and DevOps professionals working in Microsoft-centric environments.
Developers choose mssql-python for its full DB API 2.0 compliance, extensive Microsoft Entra ID authentication support, and built-in connection pooling. It offers a standardized, Pythonic interface with direct database connectivity, making it a reliable and efficient choice for Microsoft SQL ecosystem integration.
Microsoft Python Driver for SQL Server
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports all major Entra ID methods including interactive, device code, and managed identity, with documented cross-platform availability as shown in the authentication table.
Fully adheres to PEP 249, ensuring a consistent interface for connection management, cursor operations, and error handling across Python database code.
Built-in pooling is enabled by default, improving performance and scalability by reusing connections, as detailed in the Connection Pooling Wiki.
Officially supports Windows, macOS, and key Linux distributions like Debian, Ubuntu, RHEL, and SUSE (x64), facilitating diverse environment setups.
Requires manual installation of system libraries like OpenSSL on Mac and various packages on Linux, which can be error-prone and increase setup complexity.
Lacks support for SUSE Linux on ARM64, forcing teams with such infrastructure to use alternative architectures or drivers, as noted in the platform support section.
As a newer GA driver, it has fewer community resources and a wiki-based documentation that might not be as thorough or integrated as established alternatives like pyodbc.