oathtool
One-time password generator
What it is and what it does
oathtool is a one-time password generator that produces TOTP (time-based one-time password) codes from a shared secret key. It wraps the oathtool functionality and exposes it both as a command-line utility and a Python API, making it suitable for integrating OTP generation into scripts, applications, or authentication workflows.
The package is designed for flexibility: you can use it as a standalone CLI tool, import it as a library in Python code, generate a standalone script, or install it via pipx for system-wide access. It depends on autocommand, importlib_resources, and path—all lightweight utilities—and requires Python 3.9 or later.
Use it for:
- Generate TOTP codes programmatically in a Python application for two-factor authentication flows.
- Use as a command-line tool to quickly generate one-time passwords during development or testing.
- Create a standalone script for offline OTP generation without a full Python environment.
- Integrate into automation or CI/CD pipelines that need to authenticate with TOTP-protected services.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Generates one-time passwords (TOTP codes) from a shared secret key, available as a command-line tool and Python API.
Yes. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and installs with low friction. It fills a straightforward need—TOTP generation—with both CLI and API interfaces. Install it if you need to generate one-time passwords in Python or from the command line.
Install
oathtool on PyPI
pip
pip install oathtooluv
uv add oathtoolpoetry
poetry add oathtoolInstalling oathtool
Before you install
Low install friction with three lightweight runtime dependencies. Actively maintained as of April 2026, with stable production status and support for current Python versions (3.9+).
License in practice
MIT license permits free use, modification, and distribution with minimal restrictions—suitable for both open-source and commercial projects.
Quickstart
pip install oathtool
Command-line:
python -m oathtool $key
Python API:
import oathtool
oathtool.generate_otp(key)
Requires Python 3.9 or later.
Verify before relying
- Whether the package wraps or reimplements the oathtool binary, and what system dependencies (if any) are required.
- Performance characteristics and any rate-limiting or retry behavior for OTP generation.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.9) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 3 — autocommand, importlib_resources, path |
| Maintenance | actively maintained — 468 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 119,319/month — #12,077 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: oathtool-2.4.0-py3-none-any.whl
Tags
More Cryptography packages
Certifi provides Mozilla's curated collection…
copyleft · top 100 on PyPI
cryptographycryptography provides cryptographic recipes and…
permissive · top 100 on PyPI
rsaPure-Python RSA encryption, decryption,…
permissive · top 1,000 on PyPI
pyOpenSSLpyOpenSSL wraps OpenSSL's SSL/TLS functionality…
permissive · top 1,000 on PyPI
azure-identityProvides Microsoft Entra ID token-based…
unclear · top 1,000 on PyPI
PyNaClPyNaCl provides Python bindings to libsodium…
permissive · top 1,000 on PyPI
PyOTPPyOTP generates and verifies one-time passwords…
permissive · top 1,000 on PyPI
authyPython client for the Twilio Authy two-factor…
permissive · top 15,000 on PyPI
django-otpAdds one-time password (OTP) support to Django…
permissive · top 5,000 on PyPI
keyrings.altProvides alternate keyring backend…
permissive · top 5,000 on PyPI
yubico-clientVerifies Yubico One Time Passwords (OTPs) using…
permissive · top 15,000 on PyPI
django-two-factor-authAdds complete two-factor authentication to…
permissive · top 5,000 on PyPI
authentik-clientA Python client library for the authentik…
permissive · top 15,000 on PyPI
jaraco.uiProvides command-line and user-interface…
permissive · top 15,000 on PyPI
django-allauth-2faAdds two-factor authentication to…
permissive · top 15,000 on PyPI