duo-client
Reference client for Duo Security APIs
What it is and what it does
Duo-client is the official Python reference implementation for Duo Security's cloud-based authentication and identity management APIs. It provides a unified interface to interact with Duo's Auth API (for authentication flows), Admin API (for user and device management), Accounts API (for account configuration), and Activity API (currently in public preview). The library handles HTTP communication, request signing, and response parsing, abstracting away the low-level details of Duo's REST endpoints.
The package is designed for developers integrating Duo's two-factor authentication or identity services into Python applications—whether for building custom authentication workflows, managing users and devices programmatically, or querying activity logs. It supports Python 3.7 and higher, uses TLS 1.2/1.3 via Python's ssl module and OpenSSL, and has minimal dependencies, making it straightforward to add to existing projects.
Use it for:
- Build custom authentication flows by integrating Duo's Auth API into a web application or service.
- Automate user and device provisioning by managing Duo accounts programmatically via the Admin API.
- Query and audit authentication activity and user behavior through the Activity API.
- Implement multi-factor authentication for internal tools or third-party integrations.
- Sync user directories or device inventories with Duo's backend via bulk Admin API operations.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Python client library for Duo Security's authentication, admin, accounts, and activity APIs, enabling integration with Duo's two-factor authentication and identity management services.
Yes. Duo-client is actively maintained, has low install friction, carries no known vulnerabilities, and is the official library for Duo Security integration. Install it if you need to integrate Duo authentication or identity management into a Python application. The activity endpoint is in public preview, so verify its stability for your use case if you plan to rely on it.
Install
duo-client on PyPI
pip
pip install duo-clientuv
uv add duo-clientpoetry
poetry add duo-clientInstalling duo-client
Before you install
Low install friction with a single pure-Python dependency (setuptools). Actively maintained with a recent release 169 days ago and ongoing repository activity. Tested against Python 3.7 through 3.12.
License in practice
BSD permissive license allows use in both open-source and proprietary projects with minimal restrictions.
Quickstart
pip install duo-client
import duo_client
# Example: initialize an Admin API client
admin_api = duo_client.Admin(
ikey='your_integration_key',
skey='your_secret_key',
host='api-xxxxxxxx.duosecurity.com'
)
Requires valid Duo Security API credentials (integration key, secret key, and API host) to authenticate with Duo's services.
Verify before relying
- Whether the activity endpoint preview is stable enough for production use, given its documented 'subject to change' status.
- Performance characteristics and rate-limiting behavior for high-volume API calls.
- Whether all four API modules (Auth, Admin, Accounts, Activity) are equally mature and production-ready.
Package facts
| License | BSD (permissive) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 1 — setuptools |
| Maintenance | actively maintained — 169 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 600,207/month — #5,822 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: duo_client-5.6.1-py3-none-any.whl
Tags
More Security packages
Provides Python bindings to the FreeDesktop.org…
permissive · top 1,000 on PyPI
msalMSAL for Python handles OAuth2 and OpenID…
permissive · top 1,000 on PyPI
joserfcjoserfc implements JOSE standards (JWS, JWE,…
permissive · top 1,000 on PyPI
AuthlibAuthlib provides a complete implementation of…
permissive · top 1,000 on PyPI
argon2-cffi-bindingsProvides low-level CFFI bindings to the…
permissive · top 1,000 on PyPI
adalADAL for Python authenticates applications with…
permissive · top 1,000 on PyPI
authentik-clientA Python client library for the authentik…
permissive · top 15,000 on PyPI
google-reauthProvides two-factor authentication reauth…
permissive · top 5,000 on PyPI
django-allauth-2faAdds two-factor authentication to…
permissive · top 15,000 on PyPI
googleauthenticationA meta package for connecting Python…
permissive · top 15,000 on PyPI
supertokens-pythonInterfaces a Python API with the SuperTokens…
permissive · top 15,000 on PyPI
gcloud-rest-authProvides Python client libraries for Google…
permissive · top 15,000 on PyPI
dj-rest-authProvides drop-in REST API endpoints for user…
permissive · top 5,000 on PyPI
django-two-factor-authAdds complete two-factor authentication to…
permissive · top 5,000 on PyPI
google-auth-oauthlibIntegrates oauthlib with google-auth to handle…
permissive · top 1,000 on PyPI
streamlit-authenticatorAdds user authentication and access control to…
permissive · top 15,000 on PyPI