Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/casperdcl/ghstat
Plot summaries of lines of code written
https://github.com/casperdcl/ghstat
actions author code-analysis gist gistbox git github graph log pinned-gist plot readme statistics stats
Last synced: 6 days ago
JSON representation
Plot summaries of lines of code written
- Host: GitHub
- URL: https://github.com/casperdcl/ghstat
- Owner: casperdcl
- License: other
- Created: 2021-01-14T12:49:58.000Z (almost 4 years ago)
- Default Branch: v2
- Last Pushed: 2024-08-05T19:49:07.000Z (3 months ago)
- Last Synced: 2024-09-06T00:38:35.511Z (2 months ago)
- Topics: actions, author, code-analysis, gist, gistbox, git, github, graph, log, pinned-gist, plot, readme, statistics, stats
- Language: Python
- Homepage:
- Size: 75.2 KB
- Stars: 10
- Watchers: 1
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
Awesome Lists containing this project
- awesome-starred - casperdcl/ghstat - Plot summaries of lines of code written (statistics)
README
# ghstat
Automatically plot total lines of code (LoC) written.
![](https://gist.githubusercontent.com/casperdcl/7f351ce61f01cfcfb5cfa53097954435/raw/ghstats-5.svg)
![](https://gist.githubusercontent.com/casperdcl/7f351ce61f01cfcfb5cfa53097954435/raw/ghstats-a.png)
Full breakdown
## Usage
### Workflow
Requirements:
- `python3`
+ e.g. `uses: actions/setup-python@v2`
- secrets
+ a [personal access token][PAT] with scopes:
+ `repo`
+ `read:user` (optional)
+ `gist` (optional)
+ a [gist] ID which will store the generated graphs (optional)[PAT]: https://github.com/settings/tokens
[gist]: https://docs.github.com/en/free-pro-team@latest/github/writing-on-github/editing-and-sharing-content-with-gistsExample:
```yaml
name: ghstat
on:
push:
schedule:
- cron: '0 0 * * *' # every midnight
jobs:
ghstat:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
- uses: casperdcl/ghstat@v2
with:
github-token: ${{ secrets.GH_TOKEN }}
gist-id: ${{ secrets.GIST_ID }}
# user: casperdcl # default inferred from github-token
# author: 'Casper da Costa-Luis' # for `git log --author`, default inferred
# repos-incl: '' # space separated list (e.g. myuser/arepo myorg/arepo)
# repos-skip: '' # space separated list (e.g. myuser/arepo myorg/arepo conda-forge)
# lang-names: '' # space separated list (e.g. conf:INI cuh:Cuda)
```Using a `GIST_ID` of `7f351ce61f01cfcfb5cfa53097954435`, the result is visible at https://gist.github.com/casperdcl/7f351ce61f01cfcfb5cfa53097954435.
### Running locally
Python and `${GH_TOKEN}` are required; other env vars are optional.
```bash
python -m pip install -r requirements.txt
GH_TOKEN=... \
AUTHOR=... \
GH_USER=... \
REPOS_INCL=... \
REPOS_SKIP=... \
GH_GIST_ID=... \
LANG_NAMES=... \
bash ghstat.sh
```