Skip to content

Instantly share code, notes, and snippets.

@jackson-57
jackson-57 / delete_packages.py
Last active July 1, 2023 21:43
Python script to delete all GitHub Packages for a user
# Generated by ChatGPT, with human assistance. https://chat.openai.com/share/04da796e-fff7-402f-8608-a2439027395a
import requests
def list_packages(username, token):
packages = []
page = 1
per_page = 100 # Adjust as needed, maximum is 100
while True:
# Change `package_type` to fetch types of packages other than NuGet. Also change in `delete_packages`.