This is the legacy Python SDK for Azure DocumentDB, which was rebranded to Azure Cosmos DB. This `pydocumentdb` package is no longer maintained and has been superseded by the `azure-cosmos` package. Users should migrate to `azure-cosmos` for current development. The last stable version released under this name was 2.3.5.
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
from pydocumentdb.document_client import DocumentClient
from pydocumentdb import documents
Shows how to initialize the legacy DocumentDB client. This code is for the `pydocumentdb` package, which is no longer maintained. Users are strongly advised to migrate to `azure-cosmos` for any new development or existing applications connecting to Azure Cosmos DB.
import os
from pydocumentdb.document_client import DocumentClient
# These environment variables would be for an *old* DocumentDB account.
# Modern Azure Cosmos DB accounts use the azure-cosmos SDK.
HOST = os.environ.get("DOCUMENTDB_HOST", "https://your-old-documentdb-account.documents.azure.com:443/")
MASTER_KEY = os.environ.get("DOCUMENTDB_MASTER_KEY", "YOUR_OLD_MASTER_KEY")
if not HOST or not MASTER_KEY or HOST == "https://your-old-documentdb-account.documents.azure.com:443/":
print("Warning: Skipping DocumentDB client init. Please set DOCUMENTDB_HOST and DOCUMENTDB_MASTER_KEY for an *old* DocumentDB account.")
else:
try:
client = DocumentClient(HOST, {'masterKey': MASTER_KEY})
print(f"Successfully initialized legacy DocumentDB client for host: {HOST}")
# Example: Read databases (requires an active old DocumentDB account)
# databases = list(client.ReadDatabases())
# print(f"Found {len(databases)} databases.")
except Exception as e:
print(f"Error initializing legacy DocumentDB client: {e}")
Upgrade
Version history
Breaking-change detection hasn't run for this library yet.
Audit
Security & dependencies
CVE tracking and dependency tree are planned for a later release.
Agent activity
0 hits · last 30 days
No traffic data recorded yet.
Resources
No resource links recorded.