Skip to main content

Fetch your GH Repo stats

Project description

PyPI Version License Python Versions

GitHub Repo Stats

Fetch your repo stats from the GitHub API. Stats currently reported include:

  • Forks
  • Stars
  • Watchers
  • Clones Total
  • Clones Unique
  • Views Total
  • Views Unique

SetUp

In order to use tool, you will require a GitHub personal access token which will be used to authenticate you on each API call.

This should be set as an evironment variable named GH_TOKEN. Alternatively, you an pass it directly as an option into the cli with the -t / --auth-token flag.

Install

Install the latest version from PyPi with:

python -m pip install github-repo-stats

Use

Usage: cli.py [OPTIONS]

  Fetch GitHub repo stats!

  REQUIRES either a repos yaml file, an org name, or a user's name.

  Typical usage:

      $ gh-stats -r example.yaml

      $ gh-stats --repos example.yaml --output-file path/to/file.csv

Options:
  -r, --repos PATH        Yaml representation of Repos to Pull
  -o, --org TEXT          Pull stats for all repos owned by Org
  -u, --user TEXT         Pull stats for all repos owned by User
  -f, --output-file PATH  Output file path. Only supports CSV or JSON
  -t, --auth-token TEXT   GitHb Access Token
  --help                  Show this message and exit.

Development

For local development, you may find it easier to add an .env file to the project root with your GH_TOKEN. But setting it explicitly in the environment will also work.

All dev dependencies can be found in the requirements.txt file.

This project uses pytest for testing. If creating a PR, please use tox to run the tests against all supported Python versions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

github_repo_stats-0.1.2.tar.gz (15.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

github_repo_stats-0.1.2-py3-none-any.whl (5.3 kB view details)

Uploaded Python 3

File details

Details for the file github_repo_stats-0.1.2.tar.gz.

File metadata

  • Download URL: github_repo_stats-0.1.2.tar.gz
  • Upload date:
  • Size: 15.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.11.3

File hashes

Hashes for github_repo_stats-0.1.2.tar.gz
Algorithm Hash digest
SHA256 df9479a19c5e6bfb32f3b9c4aa379131aa9c1f1ff1787f546f45b53edd0ec797
MD5 bb25ff3adbbfe0d5130a08a76e05f600
BLAKE2b-256 a3203f2adec34a0eb4829185f8996fbc051e674d182c4ac6e29320a3c42a225f

See more details on using hashes here.

File details

Details for the file github_repo_stats-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for github_repo_stats-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5a0efd892389243393fdc9b28ad8a67147a7fd025c4dff9953a25954bf2eed17
MD5 1d2fd0e7033dfacbd0ccb5b668b2404f
BLAKE2b-256 3237b1787fde5226f697e3cd7b5ba6b97e9508880f3e60beb4b488d4bc04aa67

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page