$npx skillfedfor your agent

pymssql

DB-API interface to Microsoft SQL Server for Python. (new Cython-based version)

Worth itPyPI Python ModulesReleased Feb 202654.9M downloads / mocopyleft licensePlatform wheel

Decision gist · record as of 2026-08-14

platform wheels — pymssql-2.3.13-cp310-cp310-macosx_14_0_arm64.whl · pymssql-2.3.13-cp310-cp310-macosx_15_0_x86_64.whl · pymssql-2.3.13-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl
v2.3.13 · released 2026-02-14 · Python >=3.9

Yes. pymssql is a stable, actively maintained driver with no known vulnerabilities, prebuilt wheels for common platforms, and LGPL licensing that permits both open-source and proprietary use. Install it if you need to connect Python to Microsoft SQL Server and prefer a lightweight, DB-API-compliant interface over heavier ORMs. The medium install friction (compiled extensions) is typical for database drivers and not a barrier.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • Requires a running Microsoft SQL Server instance or compatible database accessible at the specified server address; FreeTDS must be able to resolve and connect to the target server.
  • Prebuilt wheels are available for modern Python versions (3.9–3.14) across Linux, macOS, and Windows, with medium install friction due to compiled C extensions.
  • The package is actively maintained with recent security updates (CVE-2023-0464 fix in version 2.3.12).

License · maintenance · safety

copyleft license (copyleft) — Licensed under LGPL 2.1, a copyleft license that permits use in proprietary applications but requires source code disclosure and allows relinking if you modify the library. Derivative works must also be LGPL 2.1 or compatible.

last release 2026-02-14 (181 days) · last repo commit 2026-08-12 · 887 stars

0 known vulnerabilities (OSV.dev, 2026-08-14) · 54,853,934 downloads/mo, #540 on PyPI

Verify before relying

import pymssql

conn = pymssql.connect(server='localhost', user='sa', password='pwd', database='tempdb')
cursor = conn.cursor(as_dict=True)
cursor.execute('SELECT * FROM table WHERE id=%s', (1,))
for row in cursor:
    print(row)
conn.close()
  • Whether SSL/TLS support for Azure connections is fully tested and documented in current releases.
  • Performance characteristics and connection pooling capabilities compared to other SQL Server drivers.
  • Compatibility with SQL Server 2019+ specific features or newer T-SQL syntax.
Same gist for agents: .md · .json

What it is and what it does

pymssql is a lightweight Python database driver that implements the DB-API 2.0 (PEP-249) standard for Microsoft SQL Server. It wraps FreeTDS, an open-source implementation of the TDS protocol, to enable Python applications to connect to SQL Server instances and execute queries. The package handles connection management, cursor operations, parameter binding, and result fetching through a familiar Python interface.

The official wheels bundle a static copy of FreeTDS and include SSL support, making it straightforward to connect to on-premises SQL Server or Azure SQL Database without additional system dependencies on most platforms. It supports modern Python versions (3.9 through 3.14) and is actively maintained, with recent updates addressing security vulnerabilities in the underlying TDS library.

Use it for

  • Connect to on-premises or Azure SQL Server from a Python application and execute parameterized queries.
  • Migrate legacy VB.NET or C# applications that use SQL Server to Python while maintaining database compatibility.
  • Build data pipelines or ETL scripts that read from or write to SQL Server tables.
  • Develop web applications (Flask, Django) that require SQL Server as the primary database backend.
  • Query SQL Server from data science workflows where pandas or SQLAlchemy integration is needed.

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Worth it

Yes.

pymssql is a stable, actively maintained driver with no known vulnerabilities, prebuilt wheels for common platforms, and LGPL licensing that permits both open-source and proprietary use. Install it if you need to connect Python to Microsoft SQL Server and prefer a lightweight, DB-API-compliant interface over heavier ORMs. The medium install friction (compiled extensions) is typical for database drivers and not a barrier.

Install

pymssql on PyPI

Before you install

Prebuilt wheels are available for modern Python versions (3.9–3.14) across Linux, macOS, and Windows, with medium install friction due to compiled C extensions. The package is actively maintained with recent security updates (CVE-2023-0464 fix in version 2.3.12).

Requires a running Microsoft SQL Server instance or compatible database accessible at the specified server address; FreeTDS must be able to resolve and connect to the target server.

License in practice

Licensed under LGPL 2.1, a copyleft license that permits use in proprietary applications but requires source code disclosure and allows relinking if you modify the library. Derivative works must also be LGPL 2.1 or compatible.

Quickstart

import pymssql

conn = pymssql.connect(server='localhost', user='sa', password='pwd', database='tempdb')
cursor = conn.cursor(as_dict=True)
cursor.execute('SELECT * FROM table WHERE id=%s', (1,))
for row in cursor:
    print(row)
conn.close()

Verify before relying

  • Whether SSL/TLS support for Azure connections is fully tested and documented in current releases.
  • Performance characteristics and connection pooling capabilities compared to other SQL Server drivers.
  • Compatibility with SQL Server 2019+ specific features or newer T-SQL syntax.

Package facts

Licensecopyleft license copyleft
Python supportSupports the current Python release >=3.9
Install frictionMedium. Platform-specific wheel
Runtime dependenciesNone
MaintenanceActively maintained 181 days since the last release
Last repo commit
First released
Downloads54,853,934 / month, #540 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
Development Status :: 5 - Production/StableIntended Audience :: DevelopersOperating System :: Microsoft :: WindowsOperating System :: POSIXOperating System :: UnixProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonTopic :: DatabaseTopic :: Database :: Database Engines/ServersTopic :: Software Development :: Libraries :: Python Modules

Evidence: pymssql-2.3.13-cp310-cp310-macosx_14_0_arm64.whl; pymssql-2.3.13-cp310-cp310-macosx_15_0_x86_64.whl; pymssql-2.3.13-cp310-cp310-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pymssql-2.3.13-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pymssql-2.3.13-cp310-cp310-musllinux_1_2_aarch64.whl; pymssql-2.3.13-cp310-cp310-musllinux_1_2_x86_64.whl; pymssql-2.3.13-cp310-cp310-win_amd64.whl; pymssql-2.3.13-cp311-cp311-macosx_14_0_arm64.whl; pymssql-2.3.13-cp311-cp311-macosx_15_0_x86_64.whl; pymssql-2.3.13-cp311-cp311-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pymssql-2.3.13-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pymssql-2.3.13-cp311-cp311-musllinux_1_2_aarch64.whl; pymssql-2.3.13-cp311-cp311-musllinux_1_2_x86_64.whl; pymssql-2.3.13-cp311-cp311-win_amd64.whl; pymssql-2.3.13-cp312-cp312-macosx_14_0_arm64.whl; pymssql-2.3.13-cp312-cp312-macosx_15_0_x86_64.whl; pymssql-2.3.13-cp312-cp312-manylinux_2_27_aarch64.manylinux_2_28_aarch64.whl; pymssql-2.3.13-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl; pymssql-2.3.13-cp312-cp312-musllinux_1_2_aarch64.whl; pymssql-2.3.13-cp312-cp312-musllinux_1_2_x86_64.whl

Tags

Capabilities
python mssql database connectionsql server db-api driverpymssql connect querymicrosoft sql server pythonfreetds python wrapperpep-249 sql servermssql cursor execute
Topics
database-driversql-serverdb-api
PyPI keywords
mssqlSQL ServerdatabaseDB-API

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 › “sql server db-api driver”

  • pymssqlpymssql provides a Python DB-API interface to Microsoft SQL Server,…
  • JayDeBeApiJayDeBeApi bridges Python to Java JDBC database drivers, providing a…
  • sqlcipher3sqlcipher3 is a Python DB-API 2.0 interface to SQLCipher, providing…

Give your agent the search over MCP, or paste the wish link into any chat.

More Python Modules packages

idna Worth it
PyPI · Python Modules · released Jun 2026

Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.

Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.

BSD-3-Clausepure Python · 3.9+
1.8Bdownloads / mo
setuptools Worth it
PyPI · Python Modules · released Aug 2026

Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.

MITpure Python · 3.10+
1.6Bdownloads / mo
PyYAML Worth it
PyPI · Python Modules · released Sep 2025

PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.

MITcompiled wheel · 3.8+
1.2Bdownloads / mo
pydantic Worth it
PyPI · Python Modules · released May 2026

Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.

MITpure Python · 3.9+
1.1Bdownloads / mo
annotated-types Worth it
PyPI · Python Modules · released Jul 2026

Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.

Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…

MITpure Python · 3.10+
871.3Mdownloads / mo
typing-inspection Worth it
PyPI · Python Modules · released Aug 2026

Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.

MITpure Python · 3.10+
783.0Mdownloads / mo

See also mssql-python · pymgclient · PyMySQL · opentelemetry-instrumentation-pymssql · firebolt-sdk · intersystems-irispython · mssql-django · sqlalchemy-pytds · python-tds · teradatasql