A script that retrieve the Pull Request (open, merged, and closed but not merged) and Issue created by Djangonauts.
- This script uses the
ghCLI to search and filter PRs and Issues. Check the gh CLI installation instructions. - After installing
ghauthenticate with a Github host.gh auth login
- Create a venv :
python3 -m venv venv source venv/bin/activate - Install
uvand then the dependency:pip install uv uv sync
Run python main.py without any arguments to pull last week's PR and Issue.
The script create an OUT.txt file inside the data folder.
Example OUT.txt
=== Djangonauts Report (2024-06-24 → 2024-06-30) ===
Open PRs: 0, Merged: 1, Issue: 0
Djangonaut Authors: Raffaella Suardini
--Merged--
🎉 Added link to the discord server inside FAQ.
Raffaella
https://github.com/django/django/pull/18257
No opened PRs
No closed PRs
--No Issue--
====================================
- Open PRs: Includes both open and draft Pull Requests.
- Merged PRs: Pull Requests that were successfully merged.
- Closed PRs: Pull Requests that were closed without being merged.
These may have been closed by the author or by a repository maintainer.
Options are available to choose the dates
usage: Djangonauts Statistics [-h] [-s START_DATE] [-e END_DATE] [-v]
Pulls info about the PRs open and merged and open Issue from last week.
options:
-h, --help show this help message and exit
-s, --start_date START_DATE
Filters PRs and Issues starting from `start_date`.e.g. 2024-01-28
-e, --end_date END_DATE
Filters PRs and Issues ending on `end_date`.e.g. 2024-01-28
-v, --verbose
The script needs 2 files inside the data folder: djangonauts.csv and repos.json
Needs two columns: Github username and Name. It's not case sensitive.
example:
Github username,Name
raffaellasuardini,Raffaella suardiniIt's a list of 2 Keys "owner" and "repos". An owner can have multiple repositories. If you need to check all the repositories of a certain owner use "*".
[
{
"owner": "django",
"repos": ["django"]
},
{
"owner": "wagtail",
"repos": ["wagtail"]
},
{
"owner": "django-commons",
"repos": ["django-debug-toolbar"]
},
{
"owner": "djangopackages",
"repos": ["djangopackages"]
},
{
"owner": "django-cms",
"repos": ["*"]
}
]This script is inspired by Django News PR Filter ❤️