Skip to main content

OTP Auth

One time password implementations in Python. HOTP and TOTP.

Documentation: https://otp.authlib.org/ GitHub: https://github.com/authlib/otpauth

Usage

Most of the time, you would use a time based one time password. You can generate and verify the token with HOTP:

import otpauth

totp = otpauth.HOTP(b"user-secret")

# generate a code for now
code: int = totp.generate()

# you may want to convert it to string
str_code: str = totp.string_code(code)

# verify the code
totp.verify(code)  # => True
totp.verify(str_code)  # => True

License

Licensed under BSD. Please see LICENSE for licensing details.

Metadata

Release files for otpauth 2.2.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for otpauth 2.2.2
File Size Uploaded
otpauth-2.2.2.tar.gz 27.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for otpauth 2.2.2
File Interpreter ABI Platform
otpauth-2.2.2-py3-none-any.whl Python 3 none any Details

Total release size: 33.4 kB

Release files / otpauth-2.2.2.tar.gz

Download URL otpauth-2.2.2.tar.gz
Size 27.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d4306790ef1bfb3b18216cff7160328f89ea26a04f89079d7a60216f78084bcc
BLAKE2b-256 checksum
How to use checksums
e7fb866e1f78f71b82b5c739fdc4fff024dbaf739f83353a078e7cac6a069533
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release files / otpauth-2.2.2-py3-none-any.whl

Download URL otpauth-2.2.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
b27c7da3cf3d69c30914bbfbf9e1ac69b9b7bd33c1f241f48d20edae8587fe7d
BLAKE2b-256 checksum
How to use checksums
e856c00649368646688a6966ba736daf1509b9d814ba7dcdc91c3f364389b27f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 22, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

2.2.2 This release

2 release files

2.2.1

2 release files

2.2.0

2 release files

2.1.1

2 release files

2.1.0

2 release files

2.0.0

2 release files

1.0.1

2 release files

1.0

2 release files

0.3.0

2 release files

0.2.0

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page