datadog-api-client
The official Python client for the Datadog API, with typed models for every endpoint.
Repository Health
Technical Analysis
datadog-api-client is Datadog’s official Python SDK for its REST API. It gives you a fully typed, auto-generated client covering both the v1 and v2 API surfaces — monitors, dashboards, logs, metrics, events, incidents, SLOs, and much more — so you can automate and manage your Datadog account programmatically instead of clicking through the UI.
Because it is generated from Datadog’s OpenAPI specification, the client stays in lockstep with the API: every resource has a corresponding typed model and every endpoint a typed method, complete with request/response validation. It supports synchronous and asynchronous usage, request retries, and pagination helpers, making it the reliable foundation for infrastructure-as-code, custom tooling, and CI automation around Datadog.
What You Get
- Typed API classes and model objects for the full Datadog v1 and v2 API surface
- Auto-generated code kept in sync with Datadog’s OpenAPI specification
- Synchronous and asynchronous (asyncio) client variants
- Built-in request/response validation, retries, and pagination helpers
- Complete type hints (
py.typed) for editor and type-checker support
Common Use Cases
- Managing monitors, dashboards, and SLOs as code
- Querying metrics, logs, and events from scripts or services
- Automating Datadog configuration in CI/CD pipelines
- Building custom internal tooling on top of Datadog data
Under The Hood
Architecture — The package under src/datadog_api_client centers on a shared runtime — api_client.py (transport, serialization, auth), configuration.py (keys, servers, retries), rest.py (HTTP layer), model_utils.py (typed-model machinery), and exceptions.py — with per-version trees (v1/, v2/) each holding an api/ package of endpoint classes and a model/ package of typed request/response objects. The bulk of the code is generated from Datadog’s OpenAPI spec via generate.sh, so the runtime is hand-maintained while the surface is regenerated.
Tech Stack — Pure Python (3.8+), packaged with setuptools (setup.py/setup.cfg), linted with Ruff, and using urllib3-style transport with optional async support. Auth (including AWS and delegated auth) lives in dedicated modules.
Code Quality — A professionally maintained, high-health project: extensive tests/ (BDD-style, run via run-tests.sh/pytest), example checks (check-examples.sh), thorough docs, py.typed, and clear CONTRIBUTING/DEVELOPMENT/TESTING guides. Generation keeps the large model layer consistent.
API Design — Consistent and predictable because it is generated: every resource follows the same XxxApi + typed-model pattern. That uniformity is easy to learn per-endpoint, though the sheer size of the surface and verbose typed models mean more boilerplate than a hand-tuned client.
Used by 2 apps in this directory
Keep
Devops · Automation · Monitoring
The open-source AIOps and alert management platform that unifies 130+ monitoring tools into a single pane of glass with AI-powered correlation, deduplication, and workflow automation.
Rasa Open Source
AI Assistants · AI Development
Rasa Open Source is a Python machine learning framework for building contextual, multi-turn chatbots and voice assistants that understand natural language and maintain conversation state.