skillfed

oathtool

One-time password generator

oathtool v2.4.0 119.3K downloads/30d#12,077 on PyPI41
Permissive license MIT Active released

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 oathtool

uv

uv add oathtool

poetry

poetry add oathtool

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: Only

Tags

totp code generatorone-time password otptime-based otpauthenticator code generatoroathtool command linepython totp library2fa code generation
totpauthenticationcryptography

More Cryptography packages