{"id":21572,"library":"mintotp","title":"MinTOTP - Minimal TOTP Generator","description":"Minimal TOTP (Time-based One-Time Password) generator library. Current version 0.3.0. No known release cadence; last updated 2021.","status":"maintenance","version":"0.3.0","language":"python","source_language":"en","source_url":"https://github.com/susam/mintotp","tags":["totp","authentication","one-time-password","security"],"install":[{"cmd":"pip install mintotp","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"mintotp is a module containing functions; direct import works.","wrong":"from mintotp import ...","symbol":"mintotp","correct":"import mintotp"}],"quickstart":{"code":"import mintotp\nimport time\n\n# Generate a TOTP using a secret (base32 encoded)\nsecret = \"JBSWY3DPEHPK3PXP\"\ntotp = mintotp.totp(secret)\nprint(totp)\n\n# Verify a code\ncode = input(\"Enter code: \")\ncurrent_time = int(time.time())\nprint(mintotp.totp(secret, current_time) == code)","lang":"python","description":"Generate and verify TOTP codes using a base32 secret."},"warnings":[{"fix":"Use a base32 encoder like `base64.b32encode(key_bytes)` to convert your secret.","message":"The secret must be base32 encoded (uppercase letters A-Z and digits 2-7). Providing a raw string will produce incorrect codes.","severity":"gotcha","affected_versions":"all"},{"fix":"Use `int(time.time())` for current time. If using a different step, pass as third argument.","message":"The default time step is 30 seconds. Ensure clock synchronization. The function expects Unix timestamps in seconds.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Ensure the secret has proper base32 padding (e.g., add '=' characters if needed).","cause":"The secret string length is not a multiple of 8 (base32 padding requirement).","error":"ValueError: Incompatible secret length"},{"fix":"Use `mintotp.totp(secret)` instead of `mintotp.generate(secret)`.","cause":"Trying to call a non-existent function. mintotp only provides `totp()` and `hotp()`.","error":"AttributeError: module 'mintotp' has no attribute 'generate'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}