Skip to main content

Fork Purger

>> Delete all of your forked repositories on Github <<

python github_actions

Installation

  • Install using pip:

    pip install fork-purger
    

Exploration

  • Create and collect your Github user access token.

  • Inspect the --help menu. Run:

    fork-purger --help
    

    This will print the following:

    +-+-+-+-+ +-+-+-+-+-+-+
    |F|o|r|k| |P|u|r|g|e|r|
    +-+-+-+-+ +-+-+-+-+-+-+
    
    Usage: fork-purger [OPTIONS]
    
    Options:
    --username TEXT       Your Github username.  [required]
    --token TEXT          Your Github access token with delete permission.
                            [required]
    --debug / --no-debug  See full traceback in case of HTTP error.
    --delete              Delete the forked repos.
    --help                Show this message and exit.
    
  • 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:

    fork-purger --username <gh-username> --token <gh-access-token>
    

    You'll see the following output:

    +-+-+-+-+ +-+-+-+-+-+-+
    |F|o|r|k| |P|u|r|g|e|r|
    +-+-+-+-+ +-+-+-+-+-+-+
    
    These forks will be deleted:
    =============================
    
    https://api.github.com/repos/<gh-username>/ddosify
    https://api.github.com/repos/<gh-username>/delete-github-forks
    https://api.github.com/repos/<gh-username>/dependabot-core
    https://api.github.com/repos/<gh-username>/fork-purger
    
  • To delete the listed repositories, run the CLI with the --delete flag:

    fork-purger --username <gh-username> --token <gh-access-token> --delete
    

    The output should look similar to this:

    +-+-+-+-+ +-+-+-+-+-+-+
    |F|o|r|k| |P|u|r|g|e|r|
    +-+-+-+-+ +-+-+-+-+-+-+
    
    Deleting forked repos:
    =======================
    
    Deleting... https://api.github.com/repos/<gh-username>/ddosify
    Deleting... https://api.github.com/repos/<gh-username>/delete-github-forks
    Deleting... https://api.github.com/repos/<gh-username>/dependabot-core
    Deleting... https://api.github.com/repos/<gh-username>/fork-purger
    
  • 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.

    fork-purger --username <gh-username> --token <gh-access-token> --delete --debug
    

Architecture

Internally, 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:

fork-purger

Here, the square boxes are async functions and each one of them is dedicated to carrying out a single task.

In 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.

✨ 🍰 ✨

Metadata

Release files for fork-purger 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for fork-purger 1.0.1
File Size Uploaded Provenance Actions
fork_purger-1.0.1.tar.gz 5.8 kB Without provenance Details for fork_purger-1.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for fork-purger 1.0.1
File Interpreter ABI Platform Actions
fork_purger-1.0.1-py3-none-any.whl Python 3 none any Details for fork_purger-1.0.1-py3-none-any.whl

Total release size: 11.8 kB

Release files / fork_purger-1.0.1.tar.gz

Download URL fork_purger-1.0.1.tar.gz
Size 5.8 kB
Tags Source
SHA-256 checksum
How to use checksums
75e616ba9262b6acd7dcaeea1b8fd5651b4d477d869d7194d126c075b168453b
BLAKE2b-256 checksum
How to use checksums
f3e13ec1873ae05401ece449e7e9555d6d6a53dcfda8a1bf8f7dc8d7fe929452
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Release files / fork_purger-1.0.1-py3-none-any.whl

Download URL fork_purger-1.0.1-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
42c43f38ddc45ef84ffc3b4a8935801e9e46bfdcc8f2e684f6d418180818bbe8
BLAKE2b-256 checksum
How to use checksums
04dce1edaf39d02d0437fd21dc765fa603a88f56c30a0af0da18f8cedd3fcd00
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.10.4

Security for fork-purger 1.0.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page