{"id":21037448,"url":"https://github.com/vintasoftware/github-metrics","last_synced_at":"2025-10-12T13:06:11.212Z","repository":{"id":57434584,"uuid":"344896137","full_name":"vintasoftware/github-metrics","owner":"vintasoftware","description":"Script for fetching github metrics for your project.","archived":false,"fork":false,"pushed_at":"2023-03-07T20:50:01.000Z","size":121,"stargazers_count":24,"open_issues_count":3,"forks_count":3,"subscribers_count":15,"default_branch":"main","last_synced_at":"2025-10-12T13:03:01.730Z","etag":null,"topics":["github-api","script"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vintasoftware.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,"zenodo":null}},"created_at":"2021-03-05T18:14:56.000Z","updated_at":"2025-02-03T00:51:46.000Z","dependencies_parsed_at":"2025-05-15T14:40:16.947Z","dependency_job_id":"a356b747-290a-46b0-9eba-2bcbc1a82809","html_url":"https://github.com/vintasoftware/github-metrics","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/vintasoftware/github-metrics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fgithub-metrics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fgithub-metrics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fgithub-metrics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fgithub-metrics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vintasoftware","download_url":"https://codeload.github.com/vintasoftware/github-metrics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vintasoftware%2Fgithub-metrics/sbom","scorecard":{"id":922828,"data":{"date":"2025-08-18","repo":{"name":"github.com/vintasoftware/github-metrics","commit":"21173d95fc572863527dd88d7891222c16de3153"},"scorecard":{"version":"v5.2.1-41-g40576783","commit":"40576783fda6698350fcbbeaea760ff827433034"},"score":2.8,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#token-permissions"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#packaging"}},{"name":"Code-Review","score":6,"reason":"Found 5/8 approved changesets -- score normalized to 6","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#binary-artifacts"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#fuzzing"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: Dockerfile:1: pin your Docker image by updating python:3.9 to python:3.9@sha256:b93ed1cb6815be1d99908ab629d49680be28024c4183611ded45c425ecf7b907","Warn: pipCommand not pinned by hash: Dockerfile:20","Warn: pipCommand not pinned by hash: etc/release.sh:16","Info:   0 out of   1 containerImage dependencies pinned","Info:   0 out of   2 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#pinned-dependencies"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":4,"reason":"6 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-38","Warn: Project is vulnerable to: GHSA-6p56-wp2h-9hxr","Warn: Project is vulnerable to: GHSA-fpfv-jqm9-f5jm","Warn: Project is vulnerable to: GHSA-9hjg-9r4m-mvj7","Warn: Project is vulnerable to: GHSA-9wx4-h78v-vm56","Warn: Project is vulnerable to: PYSEC-2023-74 / GHSA-j8r2-6x86-q33q"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 29 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/40576783fda6698350fcbbeaea760ff827433034/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-25T06:12:01.696Z","repository_id":57434584,"created_at":"2025-08-25T06:12:01.696Z","updated_at":"2025-08-25T06:12:01.696Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279011469,"owners_count":26084947,"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","status":"online","status_checked_at":"2025-10-12T02:00:06.719Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["github-api","script"],"created_at":"2024-11-19T13:26:20.813Z","updated_at":"2025-10-12T13:06:11.160Z","avatar_url":"https://github.com/vintasoftware.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# github-metrics\n\n## About\n\nA script for getting your team PRs metrics.\n\n## Running\n\nThe run command takes the following arguments:\n\n`--metric`: The reference for the metric you'd like to calculate. If no metric is provided, it will calculate all metrics available.\n\n`--start-date`: The metric start date. Date in format YYYY-mm-dd\n\n`--end-date`: The metric cutoff date. Date in format YYYY-mm-dd\n\n`--exclude-authors`: Will exclude all PRs created by the listed authors. This argument must list usernames separated by a comma. Example: `--exclude_authors=pantoja,github_username,other_username`\n\n`--filter-authors`: Will take into consideration only the PRs created by the authors in this list. This argument must list usernames separated by a comma. Example: `--exclude_authors=pantoja,github_username,other_username`\n\n`--include-hotfixes`: Will include all hotfixes in the metric calculation. By default, this value is false.\n\n`--exclude-weekends`: Will exclude weekend time from time metrics (time to merge, time to open, time to review).\n\n#### [All]\n`github_metrics --start-date=2021-03-22 --end-date=2021-03-24`\n\n#### [Time To Merge](#ttm)\n`github_metrics --metric=ttm --start-date=2021-03-22 --end-date=2021-03-24`\n\n#### [Time to Review](#ttr)\n`github_metrics --metric=ttr --start-date=2020-11-10 --end-date=2020-11-18`\n\n#### [Time to Open](#tto)\n`github_metrics --metric=tto --start-date=2020-11-10 --end-date=2020-11-18`\n\n#### [Open to Merge Time](#otm)\n`github_metrics --metric=otm --start-date=2020-11-10 --end-date=2020-11-18`\n\n#### [Merge Rate](#mr)\n`github_metrics --metric=mr --start-date=2021-03-22 --end-date=2021-03-24`\n\n#### [Pull Request Size](#pr-size)\n`github_metrics --metric=pr_size --start-date=2020-11-10 --end-date=2020-11-18`\n\n#### [Pull Requests Count](#pr-size)\n`github_metrics --metric=prs_count --start-date=2020-11-10 --end-date=2020-11-18`\n\n#### [Hotfixes count](#hotfixes-count)\n`github_metrics --metric=hotfixes_count --start-date=2020-11-10 --end-date=2020-11-18`\n\n## Metrics available\n- \u003cb id=\"ttm\"\u003eTime To Merge (ttm):\u003c/b\u003e\nThe Time to Merge metric calculates time between the first commit of a given branch, and the merge action of it's pull request.\n\n- \u003cb id=\"ttr\"\u003eTime To Review (ttr):\u003c/b\u003e\nIt calculates the time a PR waited for, or has been waiting for the first review since the PR opened.\n\n- \u003cb id=\"tto\"\u003eTime To Open (tto):\u003c/b\u003e\nThe time elapsed between a user's first commit to a branch and opening a pull request for that branch.\n\n- \u003cb id=\"tto\"\u003eOpen To Merge Time (otm):\u003c/b\u003e\nReturns statistics related to the time between opening and merging a pull request.\n\n- \u003cb id=\"mr\"\u003eMerge Rate (mr):\u003c/b\u003e\nIt measures the total number of merged pull requests to the total number of developers active in this time period (number of merged PRS / dev). A value closer to 1 indicates that each developer is merging a PR. a higher number indicates more merged PRs than devs, and vice versa.\n\n- \u003cb id=\"pr-size\"\u003ePull Request Size (pr_size):\u003c/b\u003e\nIt generates metrics related to the number of lines added and deleted in a PR. The output will generate metrics related to the sum of different lines in a pr (lines added + lines deleted), and the addition rate metric (lines added / lines deleted). In the latter case, a higher the rate number means more lines are being added than deleted.\n\n- \u003cb id=\"prs-count\"\u003ePull Request Count (prs_count):\u003c/b\u003e\nIt generates metrics related to the number of PRs opened during the period.\n\n- \u003cb id=\"hotfixes-count\"\u003eHotfixes Count (hotfixes_count):\u003c/b\u003e\nThe number of hotfixes in the period.\n\n## Installing the project\n1. Install using `pip install github-metrics`\n2. Setup settings variable by running `github_metrics --setup`. You'll be asked to give following information:\n\n`Github username`: Your github account login\n\n`Enter a github token`: An access token generated with your github account. More information accessible through [this guide](https://docs.github.com/en/github/authenticating-to-github/creating-a-personal-access-token). The lib requires full repo access for it to work\n\n`Name of the organization`: The name of the organization where the repository is located\n\n`Repository name`: The repository name of the project of your choice\n\n**NOTE:** Running the `--setup` flag will overwrite the existing environment settings.\n\n## Project setup\n\n### Dependencies setup\n1. Create a virtual enviroment `virtualenv venv`\n2. Install dependencies with `pip install --editable .`\n\n### Setup with docker\n1. Run the command with `docker-compose run app {}`. e.g. `docker-compose run app github_metrics --metric=ttm --start-date=2021-03-22 --end-date=2021-03-24`\n\n### Project variables setup\n1. Create a .env file by copying from .env.example with `cp .env.example .env`\n2.  Fill settings variables:\n\n`REPOSITORY_NAME`: The name of the repository\n`ORG_NAME`: The name of the organization\n`GITHUB_LOGIN`: Your github account username\n`GITHUB_TOKEN`: The access token generated with your github account.\n\n![image](https://user-images.githubusercontent.com/38823219/117503308-27d1ab80-af57-11eb-845c-a8640cfe023d.png)\n\n\nRelease Process\n===============\n\nFor maintainers only:\n\n- Run `rm -rf build dist` to delete current build archives\n- Install dependencies with `pip install -r ./requirements.txt`. Make sure you are inside a virtual environment\n- Run ``bump2version \u003cminor|major|patch\u003e`` to update the version number (pick one of the options)\n\n    - Version number on ``github_metrics/__init__.py`` and ``setup.py`` will be updated automatically\n    - You can specify the ``--new_version`` flag in case you wish to manually set the newest version (if not provided, it will be done automatically based on the chosen option)\n- Build the artifacts with `python setup.py sdist bdist_wheel --universal`\n- Upload the new version with `twine upload dist/*`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvintasoftware%2Fgithub-metrics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvintasoftware%2Fgithub-metrics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvintasoftware%2Fgithub-metrics/lists"}