{"id":19486264,"url":"https://github.com/textbook/pr-analysis","last_synced_at":"2026-05-15T06:42:06.565Z","repository":{"id":79361455,"uuid":"560455815","full_name":"textbook/pr-analysis","owner":"textbook","description":"How long does it take to merge PRs?","archived":false,"fork":false,"pushed_at":"2023-01-10T18:03:56.000Z","size":17,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-08T07:52:21.287Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/textbook.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-11-01T14:40:58.000Z","updated_at":"2022-11-01T14:42:14.000Z","dependencies_parsed_at":"2023-03-12T07:53:56.541Z","dependency_job_id":null,"html_url":"https://github.com/textbook/pr-analysis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fpr-analysis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fpr-analysis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fpr-analysis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/textbook%2Fpr-analysis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/textbook","download_url":"https://codeload.github.com/textbook/pr-analysis/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240723462,"owners_count":19847285,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-10T20:36:08.416Z","updated_at":"2026-05-15T06:42:06.524Z","avatar_url":"https://github.com/textbook.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pull Request Analysis\n\nHow long does it take to merge pull requests?\n\n## Installation\n\nClone the repository to your local machine.\n\nDependencies are listed in `requirements.txt`. We recommend installing them in a virtualenv:\n\n```shell\n$ python3 -m venv ~/.virtualenvs/pr-analysis\n$ source ~/.virtualenvs/pr-analysis/bin/activate\n$ pip install -r requirements.txt\n```\n\n## Usage\n\nRun `cli.py` and pass the appropriate arguments:\n\n```shell\n$ ./cli.py --help\nusage: cli.py [-h] [--closed] [--created-after CREATED_AFTER] [--csv CSV]\n              [--json JSON] [--limit LIMIT] [--merged]\n              [--merged-before MERGED_BEFORE] [--pretty] [--quiet]\n              owner repo\n\nPerform statistical analysis on merged pull requests\n\npositional arguments:\n  owner                 Org or user\n  repo                  Repository\n\noptions:\n  -h, --help            show this help message and exit\n  --closed              Only include closed PRs\n  --created-after CREATED_AFTER\n                        Filter by creation date\n  --csv CSV             Save PR data to CSV file\n  --json JSON           Save PR data to JSON file\n  --limit LIMIT         Number of PRs to analyse\n  --merged              Only include merged PRs\n  --merged-before MERGED_BEFORE\n                        Filter by merge date (implies --merged)\n  --pretty              Human-readable JSON\n  --quiet               Suppress printed outputs\n```\n\n**Note** the CLI expects a valid [personal access token] (with the `repo` scope) as the `GITHUB_PAT` environment variable.\n\nFor example, to analyse the last 500 merged PRs and save in a human-readable JSON file:\n\n```shell\nGITHUB_PAT=\u003ctoken\u003e ./cli.py \u003corg/user\u003e \u003crepo\u003e --json path/to/output.json --limit=500 --pretty\n```\n\n[personal access token]: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextbook%2Fpr-analysis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftextbook%2Fpr-analysis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftextbook%2Fpr-analysis/lists"}