Skip to main content

Count how many lines of code you commit on GitHub! (Count by file extension)

Project description

GitHub Commit Line Stats

Count how many lines of code you commit on GitHub! (Count by file extension)

python -m ghcls --token <YOUR GITHUB TOKEN>
usage: __main__.py [-h] -t TOKEN [-u USER] [-c CACHE] [-o OUTPUT] [-l LANGUAGE]

GitHub Commit Line Stats

options:
  -h, --help            show this help message and exit
  -t, --token TOKEN     GitHub Personal Access Token
  -u, --user USER       GitHub Username (Optional)
  -c, --cache CACHE     Cache directory for commits
  -o, --output OUTPUT   Output file for commit stats
  -l, --language LANGUAGE
                        Language detection function (default: importlib.import_module('ghcls').get_language_by_filename)

You can customize your language detector by changing get_language_by_filename, e.g.:

pip install ghcls[linguist]
python -m ghcls --token <YOUR GITHUB TOKEN> -l importlib.import_module('ghcls.extensions.linguist').get_language_by_filename
from ghcls import get_additions_of_user, get_language_by_filename
gh = Github(your_gh_token)
user = gh.get_user(your_username)
totals = get_additions_of_user(user, token, cache, get_language_by_filename)
# You can customize your language detector by changing get_language_by_filename
pathlib.Path(output).write_text(json.dumps(totals, indent=2))

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_commit_line_stats-1.2.1.tar.gz (4.0 kB view details)

Uploaded Source

Built Distribution

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

github_commit_line_stats-1.2.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file github_commit_line_stats-1.2.1.tar.gz.

File metadata

File hashes

Hashes for github_commit_line_stats-1.2.1.tar.gz
Algorithm Hash digest
SHA256 92ec1cb12ac1c278bba99f4b498a07cc16f8aae6c56deb9b13c12a34d4a58c69
MD5 b5867bd8365caaca7ad583c229eb03e1
BLAKE2b-256 7054d5f0d88c811bfdd3133edb80a1af2825acf6ad3d9013722c1bf75b2c3231

See more details on using hashes here.

File details

Details for the file github_commit_line_stats-1.2.1-py3-none-any.whl.

File metadata

File hashes

Hashes for github_commit_line_stats-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b873862d2b099d35ceaf1f24de864e00667c57806aabe2a49f137e90e282cdd4
MD5 545e503219d20f7b53fbc947da4436f7
BLAKE2b-256 8a55fab5edc414e055e73018610f7d584bb813a4ac361d0cebbe18b3926cd3cb

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