Skip to content

raffaellasuardini/djangonauts-stats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Djangonauts Stats

A script that retrieve the Pull Request (open, merged, and closed but not merged) and Issue created by Djangonauts.

Installation

  1. This script uses the gh CLI to search and filter PRs and Issues. Check the gh CLI installation instructions.
  2. After installing gh authenticate with a Github host.
    gh auth login 
  3. Create a venv :
    python3 -m venv venv
    source venv/bin/activate
  4. Install uv and then the dependency:
    pip install uv
    uv sync

Usage

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

 ====================================

State of the PRs

  • 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

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

File needed

The script needs 2 files inside the data folder: djangonauts.csv and repos.json

djangonauts.csv

Needs two columns: Github username and Name. It's not case sensitive.

example:

Github username,Name
raffaellasuardini,Raffaella suardini

repos.json

It'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": ["*"]
  }
]

Credits

This script is inspired by Django News PR Filter ❤️

About

A script to retrieve PRs and Issue from Djangonauts

Resources

Stars

Watchers

Forks

Languages