dodopayments
The official Python library for the Dodo Payments API
What it is and what it does
Dodopayments is the official Python client for the Dodo Payments REST API. It wraps HTTP calls to Dodo's payment endpoints with type-safe request and response objects, automatic pagination, and both sync and async execution modes. The library is built on httpx and pydantic, providing full type hints for IDE autocomplete and optional runtime type checking.
You use it to integrate Dodo Payments into Python applications—creating checkout sessions, listing payments, and managing transactions through a typed, ergonomic interface. It handles authentication via bearer token, environment switching (test vs. live mode), error classification (connection errors, rate limits, API errors), and optional aiohttp backend for async workloads.
Use it for:
- Build a checkout flow in a web app by creating sessions and retrieving session IDs for payment forms.
- Iterate through all payments in your account with automatic pagination, without manual page-fetching logic.
- Handle payment errors gracefully by catching specific exception types (RateLimitError, AuthenticationError, etc.).
- Use async/await in a high-concurrency service to make non-blocking payment API calls.
- Leverage type hints and Pydantic models to catch integration bugs early in development.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides a Python client library for the Dodo Payments REST API, with both synchronous and asynchronous interfaces, type-checked request and response handling, and automatic pagination.
Yes. The library is actively maintained (release 1 day old), has no known vulnerabilities, low install friction, permissive licensing, and provides a well-typed, ergonomic interface to Dodo Payments. Install it if you need to integrate Dodo Payments into a Python application. No significant blockers.
Install
dodopayments on PyPI
pip
pip install dodopaymentsuv
uv add dodopaymentspoetry
poetry add dodopaymentsInstalling dodopayments
Before you install
Low friction install with six common dependencies (anyio, distro, httpx, pydantic, sniffio, typing-extensions). Repository is actively maintained with a release 1 day old and no archived status.
License in practice
Apache-2.0 is permissive; you can use, modify, and distribute this library with minimal restrictions, provided you include a copy of the license and state significant changes.
Quickstart
pip install dodopayments
import os
from dodopayments import DodoPayments
client = DodoPayments(
bearer_token=os.environ.get("DODO_PAYMENTS_API_KEY"),
environment="test_mode",
)
response = client.checkout_sessions.create(
product_cart=[{"product_id": "pdt_example", "quantity": 1}]
)
print(response.session_id)
Requires Python 3.9 or later and a valid Dodo Payments API key set via environment variable.
Verify before relying
- Whether the library's error handling (APIConnectionError, APIStatusError subclasses) covers all real-world failure modes you expect.
- Performance characteristics of auto-pagination iterators under high-volume list operations.
- Whether aiohttp backend (optional extra) is production-ready for your concurrency requirements.
Package facts
| License | Apache-2.0 (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 6 — anyio, distro, httpx, pydantic, sniffio, typing-extensions |
| Maintenance | actively maintained — 1 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 84,110/month — #14,026 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: dodopayments-1.112.0-py3-none-any.whl
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
mollie-api-pythonPython client library for the Mollie payment…
permissive · top 15,000 on PyPI
modern-treasuryProvides a typed Python client library for the…
permissive · top 15,000 on PyPI
AdyenProvides official Python bindings for Adyen's…
permissive · top 5,000 on PyPI
gocardless-proA Python client library for the GoCardless API…
permissive · top 15,000 on PyPI
paypalrestsdkA REST client library for integrating PayPal…
unclear · top 5,000 on PyPI
beanstreamProvides a Python client library for the…
permissive · top 15,000 on PyPI
lithicProvides a typed Python client for the Lithic…
permissive · top 15,000 on PyPI
mercadopagoProvides Python bindings to integrate Mercado…
permissive · top 15,000 on PyPI
metronome-sdkProvides a Python client library for the…
permissive · top 15,000 on PyPI
razorpayPython client library for the Razorpay payment…
permissive · top 5,000 on PyPI