#!/usr/bin/python3
# SPDX-License-Identifier: Apache-2.0
from github import Github
github = Github("token")
org = github.get_organization('enarx')
sprint = {p.name: p for p in org.get_projects(state='open')}['Sprint']
sprint_columns = {c.name: c for c in sprint.get_columns()}
planning = {p.name: p for p in org.get_projects(state='open')}['Planning']
planning_columns = {c.name: c for c in planning.get_columns()}
for card in sprint_columns['Assigned'].get_cards():
# All archived issues on the board take the form of "notes" without an
# associated issue (strangely). So, if there's no content for that card,
# delete it from the board.
if card.get_content() is None:
card.delete()
for card in planning_columns['Triage'].get_cards():
# All archived issues on the board take the form of "notes" without an
# associated issue (strangely). So, if there's no content for that card,
# delete it from the board.
if card.get_content() is None:
card.delete()
Done. Here's the code I used: