Replies: 1 comment
-
@pn17F2DD3 I'm assuming you want to count the number of reopened issues per repo, you can try something like this and modify it based on your requirements. I've tested it locally and works fine for me. (not the most efficient approach but can get you started) from github import Github
import datetime
# Replace 'your_token' with your actual GitHub personal access token
g = Github("your_token")
# Replace `owner` and `repo_name` with the desired values
repo = g.get_repo("owner/repo_name")
reopened_issues = []
for issue in repo.get_issues(state="all"):
events = issue.get_events()
for event in events:
if event.event == "reopened":
reopened_issues.append(issue)
break
print(f"Found {len(reopened_issues)} reopened issues:")
for issue in reopened_issues:
print(f"- Issue #{issue.number}: {issue.title}") Additionally, I see you posted this a week ago, you might find that posting your questions on platforms like Stack Overflow could get you faster responses for programming-related queries. It's also beneficial to include the specific code you've been working with or where you're encountering issues; this gives others a clearer understanding of your problem and helps them provide more targeted advice. Hope this helps, and happy coding! |
Beta Was this translation helpful? Give feedback.
-
I am writing a program to study patterns of action on reporting and resolving issues on GitHub. I want to count the number of reopened issues for a repository. I managed to count pull requests, commits, comments, and assignees. However, I am stuck with counting the number of reopened issues. In this regard, I would be grateful if anyone could share your insights and knowledge on PyGithub API to count reopened issues.
Beta Was this translation helpful? Give feedback.
All reactions