azure-cosmos
Microsoft Azure Cosmos Client Library for Python
Decision gist · record as of 2026-08-14
Yes. The package is production-stable, actively maintained, has no known vulnerabilities, and low install friction. Install it if you are building applications on Azure Cosmos DB SQL API and need a native Python client. Not relevant if your project uses a different Cosmos DB API (MongoDB, Gremlin, Cassandra, Table) or does not use Azure.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later; requires Azure Cosmos DB account with SQL API and valid account URI and key or AAD credentials
- Low install friction with only two runtime dependencies (azure-core and typing-extensions).
- Actively maintained with a recent release and no known vulnerabilities.
License · maintenance · safety
MIT License (permissive) — MIT License permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
last release 2026-07-29 (16 days) · last repo commit 2026-08-14 · 5,587 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 26,514,210 downloads/mo, #880 on PyPI
Alternatives
Verify before relying
pip install azure-cosmos
from azure.cosmos import CosmosClient
import os
URL = os.environ['ACCOUNT_URI']
KEY = os.environ['ACCOUNT_KEY']
client = CosmosClient(URL, credential=KEY)- Whether the package supports all Cosmos DB account types or only SQL API accounts
- Performance characteristics for large-scale document operations
- Specific regional failover behavior beyond preferred_locations configuration
What it is and what it does
Azure Cosmos DB SQL API client is a Python SDK for interacting with Microsoft's globally distributed NoSQL database service. It provides a high-level interface to create and manage databases, containers, and JSON documents stored in Cosmos DB accounts configured for the SQL API. The library handles authentication (both key-based and AAD), multi-region read preferences, and document lifecycle operations (create, read, update, delete, query).
The package abstracts the HTTP communication with Cosmos DB's REST endpoints through two core dependencies: azure-core for common Azure SDK patterns and typing-extensions for runtime type hints. It supports modern Python versions (3.9 through 3.13) and is actively maintained by Microsoft as part of the Azure SDK for Python ecosystem.
Use it for
- Build serverless applications that store and query JSON documents in a globally distributed database
- Migrate applications from on-premises databases to Azure's managed NoSQL service
- Implement multi-region read replicas for low-latency access across geographic regions
- Create document management systems with SQL-like queries on schemaless data
- Integrate Cosmos DB into Python web frameworks for application data persistence
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
Yes.
The package is production-stable, actively maintained, has no known vulnerabilities, and low install friction. Install it if you are building applications on Azure Cosmos DB SQL API and need a native Python client. Not relevant if your project uses a different Cosmos DB API (MongoDB, Gremlin, Cassandra, Table) or does not use Azure.
Install
azure-cosmos on PyPI
Before you install
Low install friction with only two runtime dependencies (azure-core and typing-extensions). Actively maintained with a recent release and no known vulnerabilities.
Requires Python 3.9 or later; requires Azure Cosmos DB account with SQL API and valid account URI and key or AAD credentials
License in practice
MIT License permits unrestricted use, modification, and distribution with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install azure-cosmos
from azure.cosmos import CosmosClient
import os
URL = os.environ['ACCOUNT_URI']
KEY = os.environ['ACCOUNT_KEY']
client = CosmosClient(URL, credential=KEY)
Verify before relying
- Whether the package supports all Cosmos DB account types or only SQL API accounts
- Performance characteristics for large-scale document operations
- Specific regional failover behavior beyond preferred_locations configuration
Package facts
| License | MIT License permissive |
| Python support | Supports the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 2 packagesazure-coretyping-extensions |
| Maintenance | Actively maintained 16 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 26,514,210 / month, #880 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.9 |
Evidence: azure_cosmos-4.16.3-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 › “azure document database”
- azure-cosmosPython client library for Azure Cosmos DB SQL API that manages…
- pydocumentdbPython client library for interacting with Azure Cosmos DB SQL API,…
- llama-index-vector-stores-azureaisearchIntegrates Azure AI Search as a vector store backend for LlamaIndex,…
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 pydocumentdb · PowerPlatform-Dataverse-Client · agent-framework-azure-cosmos · azure-data-tables · azure-mgmt-cosmosdb · azure-kusto-data · azure-storage-blob · azure-cosmosdb-table · msgraph-sdk · azure-mgmt-sql