Azure Cosmos DB Python Service
Builds production-grade, secure, and testable Azure Cosmos DB NoSQL services using Python and FastAPI.
This skill provides a comprehensive framework for implementing Azure Cosmos DB NoSQL services with a focus on clean architecture and security. It guides developers through setting up a singleton client with dual-authentication—supporting both Azure RBAC and local emulators—while implementing a five-tier Pydantic model hierarchy for data isolation. By following these TDD-aligned patterns, developers can ensure their database interactions are performant, secure against injection, and easily mockable for unit testing within FastAPI environments.
Key Features
01Security-first parameterized queries and partition key validation
020 GitHub stars
03Singleton client initialization with async threadpool wrapping
04Five-tier Pydantic model pattern for clean data separation
05Dual-authentication setup for RBAC and local emulator development
06Standardized TDD mocking patterns for pytest-based testing
Use Cases
01Developing scalable FastAPI backends requiring NoSQL document storage
02Implementing secure RBAC-based authentication for Azure cloud databases
03Building testable Python services with complex document-to-model mapping