Description
otpauth is a Python library for two-step verification. It generates and checks one-time passwords, using HOTP, the counter-based code, and TOTP, the time-based code. You can generate a code for the current time, convert it to a string, and verify a code that a user enters with a single call. Version 2 is a redesign of the original otpauth package. It adds type hints for editors and drops Python 2 support, so the code is written for modern Python. The library installs from pip with one command. The documentation includes a simple guide, a user guide, an API reference and a changelog. The source is on GitHub under the authlib organisation, which also publishes the Authlib library for OAuth, JOSE and OpenID.…
Highlights
- HOTP and TOTP one-time password generation
- Verify codes with a single call
- Type hints for editor support
- Installs with pip install otpauth
- Guide, user guide, API reference and changelog
Ratings & Reviews
No ratings yet
Be the first to rate Otpauth.
People also visit
Totp RS
RFC-compliant TOTP implementation with ease of use as a goal and additionnal…
Otpauth FAQ
What is otpauth used for?
Two-step verification. It generates one-time passwords with HOTP and TOTP and checks the codes a user enters, for Python applications.
How do I install it?
Run pip install otpauth. The library is for Python and is written for modern versions of the language, without Python 2 support.
How do I check a code?
Create a TOTP object with your secret, call generate() for the current code, and call verify() to check a code. Use string_code() if you need the code as a string.
Is there a v1 version?
Yes. The original otpauth is documented at pythonhosted.org. The docs call v1 stable, so you can keep using it.
Where is the source?
On GitHub, under the authlib organisation.
What are the best Otpauth alternatives?
Popular alternatives to Otpauth include Totp RS, Authme and Otp.NET. See all Otpauth alternatives




