bdauvergne/python-oath

Python implementation of HOTP, TOTP and OCRA algorithms from OATH

Python

128

127 commits

updated Jul 8, 2026

See the code

README

Python OATH
===========

.. image:: https://github.com/bdauvergne/python-oath/workflows/CI/badge.svg
        :target: https://github.com/bdauvergne/python-oath/actions

.. image:: https://img.shields.io/pypi/dm/oath
        :target: https://pypi.org/project/oath/

python-oath is a package implementing the three main OATH specifications:
 - HOTP, an event based one-time password standard -- OTP -- using HMAC signatures,
 - TOTP, a time based OTP,
 - OCRA, a mixed OTP / signature system based on HOTP for complex use cases.

 It's Python 3 ready.

Getting started
===============

The main APIs are:

 - hotp, to generate a password.
 - accept_hotp, to check a received password,
 - totp and accept_totp, the same for the TOTP standard.
 - GoogleAuthenticator to parse Google Authenticator URI
 - from_b32key to create a a GoogleAuthenticator object from a simple base32 key

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

bdauvergne/python-oath

Python implementation of HOTP, TOTP and OCRA algorithms from OATH

Python

128

127 commits

updated Jul 8, 2026

See the code

README

Python OATH
===========

.. image:: https://github.com/bdauvergne/python-oath/workflows/CI/badge.svg
        :target: https://github.com/bdauvergne/python-oath/actions

.. image:: https://img.shields.io/pypi/dm/oath
        :target: https://pypi.org/project/oath/

python-oath is a package implementing the three main OATH specifications:
 - HOTP, an event based one-time password standard -- OTP -- using HMAC signatures,
 - TOTP, a time based OTP,
 - OCRA, a mixed OTP / signature system based on HOTP for complex use cases.

 It's Python 3 ready.

Getting started
===============

The main APIs are:

 - hotp, to generate a password.
 - accept_hotp, to check a received password,
 - totp and accept_totp, the same for the TOTP standard.
 - GoogleAuthenticator to parse Google Authenticator URI
 - from_b32key to create a a GoogleAuthenticator object from a simple base32 key

Not written in Markdown, so it's shown here as plain text — view it formatted on GitHub.

Project health

Overall

3.4/10

Maintained

4/10

Code review

2/10
OpenSSF Scorecard

PyPI

Latest release

1.4.5 · Jul 8, 2026

Releases this year

1

Significant stargazers

Miguel Grinberg

12,947 followers · starred Feb 2015

DS/Charlie

4 followers · starred Jul 2026

Christophe Simonis

166 followers · starred Nov 2010