https://github.com/broadinstitute/repo-metrics-py
Science Score: 26.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.6%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: broadinstitute
- License: bsd-3-clause
- Language: Python
- Default Branch: main
- Size: 47.9 KB
Statistics
- Stars: 2
- Watchers: 2
- Forks: 0
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
Repo Metrics
This is a tool for retrieving metrics for a project from a few different places (currently just GitHub and DockerHub, but more to come later).
Current version: 0.0.1
Installation
pip install .
Usage
Currently, the only command for the tool is get. For example:
repo_metrics get -gh broadinstitute/gatk
Running the command above will retrieve metrics from the GATK GitHub repo, and write a selection of them to stdout as JSON.
Sources
Two sources of data are currently supported: GitHub and DockerHub. It is possible to retrieve data from both in one command:
repo_metrics get -gh broadinstitute/gatk -dh broadinstitute/gatk
When retrieving data for both, the keys for each value will be prefixed with the name of the source.
Private GitHub repos
It is possible to retrieve metrics from private GitHub repos by setting the GITHUB_TOKEN environment variable with a GitHub API token corresponding to an account that has access to that repo.
Output formats
Two output are currently supported: JSON and CSV. JSON is the default output format. Output format is specified using the -of option:
repo_metrics get -gh broadinstitute/gatk -of csv -o output.csv
You can also use the -a option with CSV output to append to the specified file.
Output config
The GitHub and DockerHub APIs both provide a lot of information that you mostly probably don't want to record over and over again. The tool provides functionality for filtering what values will actually be written to the output. You can provide a custom config for what values to include using a JSON file like this:
repo_metrics get -gh broadinstitute/gatk -dh broadinstitute/gatk -c config.json
where the contents of the config.json file are:
{
"github_fields": [
"forks",
"open_issues",
"watchers",
"stargazers_count",
"subscribers_count",
"download_count"
],
"dockerhub_fields": [
"star_count",
"pull_count"
]
}
There are also two built-in configurations that can be used without a file. The default (just_metrics) matches the configuration above. The other option is everything, which will give you every field for every specified source.
repo_metrics get -gh broadinstitute/gatk -dh broadinstitute/gatk -c everything
Timestamps
The tool can also include a timestamp in the output using the -t flag. This will be prepended to the output with the key date_and_time.
Development
To do development in this codebase, the python3 development package must be installed.
After installation the development environment can be set up by the following commands:
python3 -mvenv venv
. venv/bin/activate
pip install -r dev-requirements.txt
pip install -e .
Linting files
# run all linting commands
tox -e lint
# reformat all project files
black src tests setup.py
# sort imports in project files
isort -rc src tests setup.py
# check pep8 against all project files
flake8 src tests setup.py
# lint python code for common errors and codestyle issues
pylint src
Tests
# run all linting and test
tox
# run only (fast) unit tests
tox -e unit
# run only linting
tox -e lint
Note: If you run into "module not found" errors when running tox for testing, verify the modules are listed in test-requirements.txt and delete the .tox folder to force tox to refresh dependencies.
Versioning
We use bumpversion to maintain version numbers.
DO NOT MANUALLY EDIT ANY VERSION NUMBERS.
Our versions are specified by a 3 number semantic version system (https://semver.org/):
major.minor.patch
To update the version with bumpversion do the following:
bumpversion PART where PART is one of:
- major
- minor
- patch
This will increase the corresponding version number by 1.
Owner
- Name: Broad Institute
- Login: broadinstitute
- Kind: organization
- Location: Cambridge, MA
- Website: http://www.broadinstitute.org/
- Twitter: broadinstitute
- Repositories: 1,083
- Profile: https://github.com/broadinstitute
Broad Institute of MIT and Harvard
GitHub Events
Total
- Watch event: 2
- Delete event: 2
- Member event: 2
- Push event: 4
- Pull request event: 4
- Create event: 1
Last Year
- Watch event: 2
- Delete event: 2
- Member event: 2
- Push event: 4
- Pull request event: 4
- Create event: 1
Issues and Pull Requests
Last synced: 10 months ago
All Time
- Total issues: 0
- Total pull requests: 4
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Total issue authors: 0
- Total pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 4
- Average time to close issues: N/A
- Average time to close pull requests: less than a minute
- Issue authors: 0
- Pull request authors: 1
- Average comments per issue: 0
- Average comments per pull request: 0.0
- Merged pull requests: 4
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
Pull Request Authors
- KevinCLydon (4)
Top Labels
Issue Labels
Pull Request Labels
Dependencies
- python 3.10-slim build
- black * development
- bumpversion * development
- click * development
- cython * development
- flake8 * development
- isort ==4.3.21 development
- mypy ==0.770 development
- pylint * development
- python-dotenv * development
- requests * development
- sphinx * development
- sphinx-rtd-theme * development
- tox * development
- twine * development
- wheel * development
- coverage >=4.5 test
- mockito * test
- pytest * test
- pytest-cov * test
- requests-mock * test