Releases: Trippy3/aggregate_pr
Releases · Trippy3/aggregate_pr
v0.1.2
v0.1.1
v0.1.0
aggregate_pr
Get the merged PR of the specified GitHub repository.
Currently, output .parquet and .csv.
Note:
- Works with Python 3.10 or later.
- To access a given repository, please obtain an access token in advance.
Please refer to the official GitHub documentation.
Usage
$ make .venv
$ source .venv/bin/activate
(.venv) $ python aggregate_pullreq.py -h
usage: aggregate_pullreq.py [-h] [-t TOKEN_FILE] [-i] [-o OUT_DIR] addr
Retrieve the 100 latest merged PRs from the specified repository.
positional arguments:
addr GitHub Repository URL
options:
-h, --help show this help message and exit
-t TOKEN_FILE, --token-file TOKEN_FILE
GitHub Token file path. default: ./.token
-i, --init Get all merged PRs; specify if you want to retrieve more than 100 merged PRs.
-o OUT_DIR, --out-dir OUT_DIR
Specifies the directory to which the data will be output. default: ./data
(.venv) $ python aggregate_pullreq.py https://github.com/Trippy3/aggregate_pr
Data file output to /home/gretra/seventh_gene/seventh_src/aggregate_pr/data
The total number of merged PRs obtained and each average values are shown below.
shape: (1, 6)
┌─────────────┬───────────────┬─────────────────────┬─────────────────────┬───────────────────────┬───────────────────────┐
│ Total count ┆ Read time[hr] ┆ add [line/PR-count] ┆ del [line/PR-count] ┆ delta [line/PR-count] ┆ files[count/PR-count] │
│ --- ┆ --- ┆ --- ┆ --- ┆ --- ┆ --- │
│ u32 ┆ f64 ┆ f64 ┆ f64 ┆ f64 ┆ f64 │
╞═════════════╪═══════════════╪═════════════════════╪═════════════════════╪═══════════════════════╪═══════════════════════╡
│ 7 ┆ 0.67 ┆ 105.428571 ┆ 32.428571 ┆ 137.857143 ┆ 7.142857 │
└─────────────┴───────────────┴─────────────────────┴─────────────────────┴───────────────────────┴───────────────────────┘
(.venv) $ ls ./data/pr*
./data/pr.csv ./data/pr.db ./data/pr.parquet
- If you want to get PR for repositories, please pass a token file.
$ cat .token
ghp_XXXXXXXXXXXX
- If you want to get more than 100 PRs in the past, please specify the "--init" option.
Note: Depending on the number of PRs, it may take some time to retrieve them.
(.venv) $ python aggregate_pullreq.py https://github.com/Trippy3/aggregate_pr --init
v0.0.1
Aggregate pull requests for a specific repository on GitHub over a period of time.
Currently, two types of csv are output.
Note: Works with Python 3.10 or later.
Usage
$ make .venv
$ source .venv/bin/activate
(.venv) $ python aggregate_pullreq.py -h
usage: aggregate_pullreq.py [-h] [-t TOKEN_FILE] [-s START] [-e END] addr
positional arguments:
addr GitHub Repository URL
options:
-h, --help show this help message and exit
-t TOKEN_FILE, --token-file TOKEN_FILE
GitHub Token file path
-s START, --start START
Start Date. ex: 2023-01-21 deafult: Monday of the week.
-e END, --end END End Date. ex: 2023-01-24 default: datetime.now()
(.venv) $ python aggregate_pullreq.py https://github.com/Trippy3/aggregate_pr
Warning: Token file does not exist. path: None
output: {current dir}/aggregate_pr/aggregate_pr_all_20230122_20230128.csv
output: {current dir}/aggregate_pr/aggregate_pr_mean_20230122_20230128.csv
- If you want to get PR for private repositories, please pass a token file.
$ cat .token_file
ghp_XXXXXXXXXXXX
- If start and end dates are not specified, the default settings are used.
Note: Currently, only Japan Standard Time (JST) is supported.- The Monday of that week will be the start date.
- The present date and time will be the end date.