{"id":13419345,"url":"https://github.com/rednafi/fork-purger","last_synced_at":"2025-10-24T05:44:48.724Z","repository":{"id":46377475,"uuid":"418261732","full_name":"rednafi/fork-purger","owner":"rednafi","description":"Delete all of your forked repositories on Github","archived":false,"fork":false,"pushed_at":"2023-10-02T18:44:14.000Z","size":57,"stargazers_count":30,"open_issues_count":2,"forks_count":3,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-09-21T09:10:50.343Z","etag":null,"topics":["asyncio","cli","fork","github","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rednafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-10-17T21:38:39.000Z","updated_at":"2024-06-01T10:33:06.000Z","dependencies_parsed_at":"2024-10-26T16:04:35.713Z","dependency_job_id":null,"html_url":"https://github.com/rednafi/fork-purger","commit_stats":{"total_commits":53,"total_committers":2,"mean_commits":26.5,"dds":0.09433962264150941,"last_synced_commit":"39ddb4fe013b85c0550933e59fc38c6343740683"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-purger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-purger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-purger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-purger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rednafi","download_url":"https://codeload.github.com/rednafi/fork-purger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":233350315,"owners_count":18662954,"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","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":["asyncio","cli","fork","github","python3"],"created_at":"2024-07-30T22:01:14.682Z","updated_at":"2025-09-17T08:31:47.939Z","avatar_url":"https://github.com/rednafi.png","language":"Python","readme":"\u003ch1\u003eFork Purger\u003cimg src='https://user-images.githubusercontent.com/30027932/137647315-66a6bcf2-7645-46cd-964d-4fe7375be30b.png' align='right' width='128' height='128'\u003e\u003c/h1\u003e\n\n\n\u003cstrong\u003e\u003e\u003e \u003ci\u003eDelete all of your forked repositories on Github\u003c/i\u003e \u003c\u003c\u003c/strong\u003e\n\n\n\u003c/div\u003e\n\n![python](https://img.shields.io/badge/Python-3776AB?style=for-the-badge\u0026logo=python\u0026logoColor=white)\n![github_actions](https://img.shields.io/badge/GitHub_Actions-2088FF?style=for-the-badge\u0026logo=github-actions\u0026logoColor=white)\n\n\n## Installation\n\n* Install using pip:\n\n    ```\n    pip install fork-purger\n    ```\n\n## Exploration\n\n* Create and collect your Github [user access token](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token).\n\n* Inspect the `--help` menu. Run:\n\n    ```\n    fork-purger --help\n    ```\n\n    This will print the following:\n\n    ```\n    +-+-+-+-+ +-+-+-+-+-+-+\n    |F|o|r|k| |P|u|r|g|e|r|\n    +-+-+-+-+ +-+-+-+-+-+-+\n\n    Usage: fork-purger [OPTIONS]\n\n    Options:\n    --username TEXT       Your Github username.  [required]\n    --token TEXT          Your Github access token with delete permission.\n                            [required]\n    --debug / --no-debug  See full traceback in case of HTTP error.\n    --delete              Delete the forked repos.\n    --help                Show this message and exit.\n    ```\n\n* By default, `fork-purger` runs in dry mode and doesn't do anything other than just listing the repositories that are about to be deleted. Run:\n\n    ```\n    fork-purger --username \u003cgh-username\u003e --token \u003cgh-access-token\u003e\n    ```\n\n    You'll see the following output:\n\n    ```\n    +-+-+-+-+ +-+-+-+-+-+-+\n    |F|o|r|k| |P|u|r|g|e|r|\n    +-+-+-+-+ +-+-+-+-+-+-+\n\n    These forks will be deleted:\n    =============================\n\n    https://api.github.com/repos/\u003cgh-username\u003e/ddosify\n    https://api.github.com/repos/\u003cgh-username\u003e/delete-github-forks\n    https://api.github.com/repos/\u003cgh-username\u003e/dependabot-core\n    https://api.github.com/repos/\u003cgh-username\u003e/fork-purger\n    ```\n\n* To delete the listed repositories, run the CLI with the `--delete` flag:\n\n    ```\n    fork-purger --username \u003cgh-username\u003e --token \u003cgh-access-token\u003e --delete\n    ```\n\n    The output should look similar to this:\n    ```\n    +-+-+-+-+ +-+-+-+-+-+-+\n    |F|o|r|k| |P|u|r|g|e|r|\n    +-+-+-+-+ +-+-+-+-+-+-+\n\n    Deleting forked repos:\n    =======================\n\n    Deleting... https://api.github.com/repos/\u003cgh-username\u003e/ddosify\n    Deleting... https://api.github.com/repos/\u003cgh-username\u003e/delete-github-forks\n    Deleting... https://api.github.com/repos/\u003cgh-username\u003e/dependabot-core\n    Deleting... https://api.github.com/repos/\u003cgh-username\u003e/fork-purger\n    ```\n\n* In case of exceptions, if you need more information, you can run the CLI with the `--debug` flag. This will print out the Python stack trace on the stdout.\n\n    ```\n    fork-purger --username \u003cgh-username\u003e --token \u003cgh-access-token\u003e --delete --debug\n    ```\n\n## Architecture\n\nInternally, `fork-purger` leverages Python's coroutine objects to collect the URLs of the forked repositories from GitHub and delete them asynchronously. Asyncio coordinates this workflow in a producer-consumer orientation which is choreographed in the `orchestrator` function. The following diagram can be helpful to understand how the entire workflow operates:\n\n![fork-purger](https://user-images.githubusercontent.com/30027932/138368621-67eda43a-a885-4bd2-b9fd-11bcee94de2a.png)\n\n\nHere, the square boxes are async functions and each one of them is dedicated to carrying out a single task.\n\nIn the first step, an async function calls a GitHub GET API to collect the URLs of the forked repositories. The `enqueue` function then aggregates those URLs and puts them in a `queue`. The `dequeue` function pops the URLs from the `queue` and sends them to multiple worker functions to achieve concurrency. Finally, the worker functions leverage a DELETE API to purge the forked repositories.\n\n\u003cdiv align=\"center\"\u003e\n\u003ci\u003e ✨ 🍰 ✨ \u003c/i\u003e\n\u003c/div\u003e\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednafi%2Ffork-purger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frednafi%2Ffork-purger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednafi%2Ffork-purger/lists"}