{"id":19423272,"url":"https://github.com/atomjoy/py2fa","last_synced_at":"2026-02-13T06:15:18.489Z","repository":{"id":224036093,"uuid":"762206609","full_name":"atomjoy/py2fa","owner":"atomjoy","description":"Desktop Python 2FA Authenticator Tkinter GUI app and script. The script generates two factor authentication codes for secret keys from json file.","archived":false,"fork":false,"pushed_at":"2024-02-25T13:53:08.000Z","size":295,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-17T10:07:50.017Z","etag":null,"topics":["2fa","desktop-2fa","desktop-google-authenticator","desktop-two-factor-authenticator","google-authenticator","google-authenticator-python","py2fa","python-2fa","python-2fa-authenticator","python-two-factor-authenticator"],"latest_commit_sha":null,"homepage":"https://github.com/atomjoy/py2fa","language":"Tcl","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/atomjoy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-23T09:51:05.000Z","updated_at":"2024-06-17T09:31:48.000Z","dependencies_parsed_at":"2024-11-10T17:41:10.604Z","dependency_job_id":null,"html_url":"https://github.com/atomjoy/py2fa","commit_stats":null,"previous_names":["atomjoy/pygauth"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/atomjoy/py2fa","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fpy2fa","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fpy2fa/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fpy2fa/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fpy2fa/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/atomjoy","download_url":"https://codeload.github.com/atomjoy/py2fa/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/atomjoy%2Fpy2fa/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274743034,"owners_count":25341132,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-12T02:00:09.324Z","response_time":60,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["2fa","desktop-2fa","desktop-google-authenticator","desktop-two-factor-authenticator","google-authenticator","google-authenticator-python","py2fa","python-2fa","python-2fa-authenticator","python-two-factor-authenticator"],"created_at":"2024-11-10T13:37:39.367Z","updated_at":"2026-02-13T06:15:18.444Z","avatar_url":"https://github.com/atomjoy.png","language":"Tcl","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Py2FA Google Authenticator in Python\n\nGoogle Authenticator desktop GUI and script application in Python with JSON secrets.\n\n## How to\n\nInstall python3 and modules\n\n```sh\n# Check\nwhich python3\n\n# Install\nsudo apt install python3 python3-pyotp python3-tk -y\n```\n\n### Add secrets\n\nFirst add your 2FA secrets to the **secrets.json** file (when enabling github two factor auth get secret key).\n\n```json\n{\n  \"atomjoy_github\": \"JBSWY3DPEHPK3PXP\",\n  \"moovspace_github\": \"JBSWY3DPEHPK3PXD\"\n}\n```\n\n### Run script\n\nThe script generates 2fa codes for secrets.\n\n```sh\n# Gui desktop app tkinter\npython3 main.py\n\n# Console script\npython3 auth.py\n\n# Console script (30 seconds loop)\npython3 2fa.py\n```\n\n### Output\n\n```sh\nLabel atomjoy_github Secret JBSWY3DPEHPK3PXP Code 280070\nLabel moovspace_github Secret JBSWY3DPEHPK3PXD Code 304997\n```\n\n## Random secret base32\n\n```py\n#!/usr/bin/python3\n\nimport pyotp\nimport time\n\n# Base32 secret\nsecret = pyotp.random_base32()\n\n# Code from secret\nx = pyotp.TOTP(secret)\ncode = x.now()\n\n# Show\nprint(secret)\nprint(code)\n\n# Code verified for current time\nprint(x.verify(code)) # True\n\n# time.sleep(35)\n# print(x.verify(code))\n```\n\n## Edit and copy PyF2A activator\n\nFor Linux Debian 12 Gnome 43+\n\n```sh\n# Edit this line change main.py file location\nExec=/bin/python3 /home/username/Dokumenty/github/py2fa-gui/main.py %u\n\n# And copy app activator file to\ncp py2fa.desktop /home/username/.local/share/applications\n```\n\n## Links\n\n- \u003chttps://pyauth.github.io/pyotp/\u003e\n- \u003chttps://medium.com/@olutomilayodolapo/how-to-retrieve-otp-from-authy-google-authenticator-with-python-53544575bcef\u003e\n- \u003chttps://github.com/grahammitchell/google-authenticator/blob/master/google-authenticator.py\u003e\n- \u003chttps://www.geeksforgeeks.org/two-factor-authentication-using-google-authenticator-in-python\u003e\n- \u003chttps://anzeljg.github.io/rin2/book2/2405/docs/tkinter/index.html\u003e\n- \u003chttps://www.pythontutorial.net/tkinter/tkinter-treeview\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Fpy2fa","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fatomjoy%2Fpy2fa","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fatomjoy%2Fpy2fa/lists"}