https://github.com/textbook/pr-analysis
How long does it take to merge PRs?
https://github.com/textbook/pr-analysis
Last synced: 2 months ago
JSON representation
How long does it take to merge PRs?
- Host: GitHub
- URL: https://github.com/textbook/pr-analysis
- Owner: textbook
- License: isc
- Created: 2022-11-01T14:40:58.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2023-01-10T18:03:56.000Z (over 3 years ago)
- Last Synced: 2025-01-08T07:52:21.287Z (over 1 year ago)
- Language: Python
- Homepage:
- Size: 16.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Pull Request Analysis
How long does it take to merge pull requests?
## Installation
Clone the repository to your local machine.
Dependencies are listed in `requirements.txt`. We recommend installing them in a virtualenv:
```shell
$ python3 -m venv ~/.virtualenvs/pr-analysis
$ source ~/.virtualenvs/pr-analysis/bin/activate
$ pip install -r requirements.txt
```
## Usage
Run `cli.py` and pass the appropriate arguments:
```shell
$ ./cli.py --help
usage: cli.py [-h] [--closed] [--created-after CREATED_AFTER] [--csv CSV]
[--json JSON] [--limit LIMIT] [--merged]
[--merged-before MERGED_BEFORE] [--pretty] [--quiet]
owner repo
Perform statistical analysis on merged pull requests
positional arguments:
owner Org or user
repo Repository
options:
-h, --help show this help message and exit
--closed Only include closed PRs
--created-after CREATED_AFTER
Filter by creation date
--csv CSV Save PR data to CSV file
--json JSON Save PR data to JSON file
--limit LIMIT Number of PRs to analyse
--merged Only include merged PRs
--merged-before MERGED_BEFORE
Filter by merge date (implies --merged)
--pretty Human-readable JSON
--quiet Suppress printed outputs
```
**Note** the CLI expects a valid [personal access token] (with the `repo` scope) as the `GITHUB_PAT` environment variable.
For example, to analyse the last 500 merged PRs and save in a human-readable JSON file:
```shell
GITHUB_PAT= ./cli.py --json path/to/output.json --limit=500 --pretty
```
[personal access token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token