Skip to main content

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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

otpauth-2.2.2.tar.gz (27.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

otpauth-2.2.2-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file otpauth-2.2.2.tar.gz.

File metadata

  • Download URL: otpauth-2.2.2.tar.gz
  • Upload date:
  • Size: 27.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for otpauth-2.2.2.tar.gz
Algorithm Hash digest
SHA256 d4306790ef1bfb3b18216cff7160328f89ea26a04f89079d7a60216f78084bcc
MD5 5231677ac2dfc28d2b9370e1cc4e9894
BLAKE2b-256 e7fb866e1f78f71b82b5c739fdc4fff024dbaf739f83353a078e7cac6a069533

See more details on using hashes here.

Provenance

The following attestation bundles were made for otpauth-2.2.2.tar.gz:

Publisher: pypi.yml on authlib/otpauth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file otpauth-2.2.2-py3-none-any.whl.

File metadata

  • Download URL: otpauth-2.2.2-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for otpauth-2.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b27c7da3cf3d69c30914bbfbf9e1ac69b9b7bd33c1f241f48d20edae8587fe7d
MD5 12bb1bd942d8653281f6236d53164f25
BLAKE2b-256 e856c00649368646688a6966ba736daf1509b9d814ba7dcdc91c3f364389b27f

See more details on using hashes here.

Provenance

The following attestation bundles were made for otpauth-2.2.2-py3-none-any.whl:

Publisher: pypi.yml on authlib/otpauth

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

2.2.2 This release

2 files

2.2.1

2 files

2.2.0

2 files

2.1.1

2 files

2.1.0

2 files

2.0.0

2 files

1.0.1

2 files

1.0

2 files

0.3.0

2 files

0.2.0

1 file

0.1.2

1 file

0.1.1

1 file

0.1.0

1 file

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page