{"id":25929810,"url":"https://github.com/microsoft/mssql-python","last_synced_at":"2025-04-09T21:13:01.925Z","repository":{"id":280492782,"uuid":"921684538","full_name":"microsoft/mssql-python","owner":"microsoft","description":null,"archived":false,"fork":false,"pushed_at":"2025-04-04T16:56:54.000Z","size":1225,"stargazers_count":76,"open_issues_count":16,"forks_count":5,"subscribers_count":7,"default_branch":"alpha","last_synced_at":"2025-04-09T21:12:55.979Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":"ROADMAP.md","authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-01-24T12:21:04.000Z","updated_at":"2025-04-09T18:24:49.000Z","dependencies_parsed_at":"2025-03-03T18:45:24.971Z","dependency_job_id":"d87a8be8-885f-45f3-9fbf-86d194c502cb","html_url":"https://github.com/microsoft/mssql-python","commit_stats":null,"previous_names":["microsoft/mssql-python"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmssql-python","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmssql-python/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmssql-python/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fmssql-python/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/mssql-python/tar.gz/refs/heads/alpha","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248111973,"owners_count":21049578,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-03-03T23:00:05.406Z","updated_at":"2025-04-09T21:13:01.902Z","avatar_url":"https://github.com/microsoft.png","language":"Python","readme":"# Microsoft Python Driver for SQL Server\n\n**mssql-python** is a Python driver for Microsoft SQL Server and the Azure SQL family of databases. It leverages Direct Database Connectivity (DDBC) that enables direct connections to SQL Server without requiring an external driver manager. Designed to comply with the [DB API 2.0](https://peps.python.org/pep-0249/) specification, this driver also introduces Pythonic enhancements for improved usability and functionality. It supports a full range of database operations, including connection management, query execution, and transaction handling.\n\n[Documentation](https://github.com/microsoft/mssql-python/wiki) | [Release Notes](https://github.com/microsoft/mssql-python/releases) | [Roadmap](https://github.com/microsoft/mssql-python/blob/main/ROADMAP.md)\n\n\u003e **Note:**\n\u003e This project is currently in an alpha phase, meaning it is still under active development. We are looking to validate core functionalities and gather initial feedback before a broader public launch. Please use with caution and avoid production environments.\n\u003e \n## Installation\n\nmssql-python can be installed with [pip](http://pypi.python.org/pypi/pip)\n```bash\npip install mssql-python\n```\n## Key Features\n### Supported Platforms \n\nWindows\n\n\u003e **Note:**\n\u003e Support for macOS and Linux is coming soon\n\u003e \n\n### DBAPI v2.0 Compliance\n\nThe Microsoft **mssql-python** module is designed to be fully compliant with the DB API 2.0 specification. This ensures that the driver adheres to a standardized interface for database access in Python, providing consistency and reliability across different database systems. Key aspects of DBAPI v2.0 compliance include:\n\n- **Connection Objects**: Establishing and managing connections to the database.\n- **Cursor Objects**: Executing SQL commands and retrieving results.\n- **Transaction Management**: Supporting commit and rollback operations to ensure data integrity.\n- **Error Handling**: Providing a consistent set of exceptions for handling database errors.\n- **Parameter Substitution**: Allowing the use of placeholders in SQL queries to prevent SQL injection attacks.\n\nBy adhering to the DB API 2.0 specification, the mssql-python module ensures compatibility with a wide range of Python applications and frameworks, making it a versatile choice for developers working with Microsoft SQL Server, Azure SQL Database, and Azure SQL Managed Instance.\n\n### Support for Microsoft Entra ID Authentication\n\nThe Microsoft mssql-python driver enables Python applications to connect to Microsoft SQL Server, Azure SQL Database, or Azure SQL Managed Instance using Microsoft Entra ID identities. It supports various authentication methods, including username and password, Microsoft Entra managed identity, and Integrated Windows Authentication in a federated, domain-joined environment. Additionally, the driver supports Microsoft Entra interactive authentication and Microsoft Entra managed identity authentication for both system-assigned and user-assigned managed identities.\n\n### Enhanced Pythonic Features\n\nThe driver offers a suite of Pythonic enhancements that streamline database interactions, making it easier for developers to execute queries, manage connections, and handle data more efficiently.\n\n## Getting Started Examples\n  \nConnect to SQL Server and execute a simple query:\n\n```python\nimport mssql_python\n\n# Establish a connection\n# Specify connection string\nconnection_string = \"SERVER=\u003cyour_server_name\u003e;DATABASE=\u003cyour_database_name\u003e;UID=\u003cyour_user_name\u003e;PWD=\u003cyour_password\u003e;Encrypt=yes;\"\nconnection = mssql_python.connect(connection_string)\n\n# Execute a query\ncursor = connection.cursor()\ncursor.execute(\"SELECT * from customer\")\nrows = cursor.fetchall()\n\nfor row in rows:\n    print(row)\n\n# Close the connection\nconnection.close()\n\n```\n\n## Still have questions?\n\nCheck out our [FAQ](https://github.com/microsoft/mssql-python/wiki/Frequently-Asked-Questions). Still not answered? Create an [issue](https://github.com/microsoft/mssql-python/issues/new/choose) to ask a question.\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## License\nThe mssql-python driver for SQL Server is licensed under the MIT license, except the dynamic-link libraries (DLLs) in the [libs](https://github.com/microsoft/mssql-python/tree/alphaChanges/mssql_python/libs) folder \nthat are licensed under MICROSOFT SOFTWARE LICENSE TERMS.\n\nPlease review the [LICENSE](LICENSE) file for more details.\n\n## Trademarks\n\nThis project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft \ntrademarks or logos is subject to and must follow \n[Microsoft's Trademark \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","funding_links":[],"categories":["others","Database Drivers"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmssql-python","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fmssql-python","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fmssql-python/lists"}