# What changed in pyotp

> 13 changes in pyotp 2 from its official release notes, upgrade guides and advisories: 3 breaking, 1 security, 2 new APIs and options. Each one cited. Sources checked 2026-11-27. HTML: https://unstale.sh/pypi/pyotp/

To see which of these apply to a repository, run `npx @unstale/cli init` in it.

## pyotp 2

### Breaking changes

- The required minimum Python version is now 3.10. (2.12.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.12.0)
- OTP secrets must contain at least 112 bits. (2.12.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.12.0)
- TOTP intervals are limited to 120 seconds. (2.12.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.12.0)

### Security

- OTP verification APIs are hardened. (2.11.2) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.11.2)

### New APIs and options

- Subclasses can override the minimum secret length. (2.12.1) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.12.1)
- Adds a TOTP method that verifies and returns the matching timecode. (2.11.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.11.0)

### Performance

- Performance is improved in the Steam class. (2.10.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.10.0)

### Fixes and other changes

- OTP configuration and URI parameters are validated, helping developers catch invalid values. (2.11.2) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.11.2)
- Respects initial_count=0 when generating an HOTP provisioning URI. (2.11.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.11.0)
- Fixes DST rollbacks and normalizes TOTP timestamp inputs. (2.11.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.11.0)
- The digest function is checked to prevent errors during OTP generation. (2.10.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.10.0)
- Non-standard otpauth parameters are ignored. (2.10.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.10.0)
- Fixes mis-parsing of encoded colons in issuer/account names. (2.10.0) — [release notes](https://github.com/pyauth/pyotp/releases/tag/v2.10.0)
