pypi / pyotp
pyotp
What changed in pyotp 2, from its official release notes, upgrade guides and advisories. Sources checked 2026-11-27.
3 breaking1 security2 new APIs and options1 performance6 fixes and other
See which of these apply to your code, ranked, in your agent:
npx @unstale/cli initpyotp 213 changes
Breaking changes 3
The required minimum Python version is now 3.10.
OTP secrets must contain at least 112 bits.
TOTP intervals are limited to 120 seconds.
Security 1
OTP verification APIs are hardened.
New APIs and options 2
Subclasses can override the minimum secret length.
Adds a TOTP method that verifies and returns the matching timecode.
Performance 1
Performance is improved in the Steam class.
Fixes and other changes 6
OTP configuration and URI parameters are validated, helping developers catch invalid values.
Respects initial_count=0 when generating an HOTP provisioning URI.
Fixes DST rollbacks and normalizes TOTP timestamp inputs.
The digest function is checked to prevent errors during OTP generation.
Non-standard otpauth parameters are ignored.
Fixes mis-parsing of encoded colons in issuer/account names.