Skip to content

Commit

Permalink
Updating repository traffic
Browse files Browse the repository at this point in the history
  • Loading branch information
wumphlett committed Aug 27, 2022
1 parent 74630b3 commit 9fb006c
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 56 deletions.
4 changes: 2 additions & 2 deletions .traffic/clones.csv
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
date,total_clones,unique_clones
2022-08-25,1,1
2022-08-26,4,3
2022-08-25,84,16
2022-08-26,11,7
2022-08-27,4,3
35 changes: 18 additions & 17 deletions .traffic/clones_chart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
Total Clones per Day from 2022-08-25 to 2022-08-27

Repository Clones
4.00 ┤╭─
3.80 ┤│
3.60 ┤│
3.40 ┤│
3.20 ┤│
3.00 ┤│
2.80 ┤│
2.60 ┤│
2.40 ┤│
2.20 ┤│
2.00 ┤│
1.80 ┤│
1.60 ┤│
1.40 ┤│
1.20 ┤│
1.00 ┼╯
84.00 ┼╮
79.00 ┤│
74.00 ┤│
69.00 ┤│
64.00 ┤│
59.00 ┤│
54.00 ┤│
49.00 ┤│
44.00 ┤│
39.00 ┤│
34.00 ┤│
29.00 ┤│
24.00 ┤│
19.00 ┤│
14.00 ┤╰╮
9.00 ┤ ╰
4.00 ┤

Chart last updated - Sat Aug 27 20:12:40 2022 UTC
Chart last updated - Sat Aug 27 20:35:23 2022 UTC

4 changes: 2 additions & 2 deletions .traffic/views.csv
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
date,total_views,unique_views
2022-08-25,3,1
2022-08-26,2,1
2022-08-25,322,1
2022-08-26,21,3
35 changes: 18 additions & 17 deletions .traffic/views_chart.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@
Total Views per Day from 2022-08-25 to 2022-08-26

Repository Views
3.00 ┼╮
2.93 ┤│
2.87 ┤│
2.80 ┤│
2.73 ┤│
2.67 ┤│
2.60 ┤│
2.53 ┤│
2.47 ┤│
2.40 ┤│
2.33 ┤│
2.27 ┤│
2.20 ┤│
2.13 ┤│
2.07 ┤│
2.00 ┤╰
322.00 ┤
303.19 ┼╮
284.38 ┤│
265.56 ┤│
246.75 ┤│
227.94 ┤│
209.12 ┤│
190.31 ┤│
171.50 ┤│
152.69 ┤│
133.88 ┤│
115.06 ┤│
96.25 ┤│
77.44 ┤│
58.62 ┤│
39.81 ┤│
21.00 ┤╰

Chart last updated - Sat Aug 27 20:12:40 2022 UTC
Chart last updated - Sat Aug 27 20:35:23 2022 UTC

56 changes: 56 additions & 0 deletions =2.0.0
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
Collecting github-repo-traffic
Downloading github_repo_traffic-2.0.0-py3-none-any.whl (4.3 kB)
Collecting python-dotenv<0.21.0,>=0.20.0
Downloading python_dotenv-0.20.0-py3-none-any.whl (17 kB)
Collecting pandas<2.0.0,>=1.4.3
Downloading pandas-1.4.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (11.6 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 11.6/11.6 MB 88.0 MB/s eta 0:00:00
Collecting asciichartpy<2.0.0,>=1.5.25
Downloading asciichartpy-1.5.25-py2.py3-none-any.whl (7.2 kB)
Collecting PyGithub<2.0,>=1.55
Downloading PyGithub-1.55-py3-none-any.whl (291 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 291.7/291.7 kB 53.9 MB/s eta 0:00:00
Requirement already satisfied: setuptools in /opt/hostedtoolcache/Python/3.10.6/x64/lib/python3.10/site-packages (from asciichartpy<2.0.0,>=1.5.25->github-repo-traffic) (63.2.0)
Collecting pytz>=2020.1
Downloading pytz-2022.2.1-py2.py3-none-any.whl (500 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 500.6/500.6 kB 67.6 MB/s eta 0:00:00
Collecting python-dateutil>=2.8.1
Downloading python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 247.7/247.7 kB 55.4 MB/s eta 0:00:00
Collecting numpy>=1.21.0
Downloading numpy-1.23.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (17.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 17.0/17.0 MB 75.8 MB/s eta 0:00:00
Collecting deprecated
Downloading Deprecated-1.2.13-py2.py3-none-any.whl (9.6 kB)
Collecting pynacl>=1.4.0
Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 75.8 MB/s eta 0:00:00
Collecting pyjwt>=2.0
Downloading PyJWT-2.4.0-py3-none-any.whl (18 kB)
Collecting requests>=2.14.0
Downloading requests-2.28.1-py3-none-any.whl (62 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 62.8/62.8 kB 17.7 MB/s eta 0:00:00
Collecting cffi>=1.4.1
Downloading cffi-1.15.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (441 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 441.8/441.8 kB 57.0 MB/s eta 0:00:00
Collecting six>=1.5
Downloading six-1.16.0-py2.py3-none-any.whl (11 kB)
Collecting urllib3<1.27,>=1.21.1
Downloading urllib3-1.26.12-py2.py3-none-any.whl (140 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 140.4/140.4 kB 39.6 MB/s eta 0:00:00
Collecting certifi>=2017.4.17
Downloading certifi-2022.6.15-py3-none-any.whl (160 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.2/160.2 kB 39.0 MB/s eta 0:00:00
Collecting idna<4,>=2.5
Downloading idna-3.3-py3-none-any.whl (61 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.2/61.2 kB 18.9 MB/s eta 0:00:00
Collecting charset-normalizer<3,>=2
Downloading charset_normalizer-2.1.1-py3-none-any.whl (39 kB)
Collecting wrapt<2,>=1.10
Downloading wrapt-1.14.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (77 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 77.9/77.9 kB 23.6 MB/s eta 0:00:00
Collecting pycparser
Downloading pycparser-2.21-py2.py3-none-any.whl (118 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.7/118.7 kB 32.6 MB/s eta 0:00:00
Installing collected packages: pytz, wrapt, urllib3, six, python-dotenv, pyjwt, pycparser, numpy, idna, charset-normalizer, certifi, asciichartpy, requests, python-dateutil, deprecated, cffi, pynacl, pandas, PyGithub, github-repo-traffic
Successfully installed PyGithub-1.55 asciichartpy-1.5.25 certifi-2022.6.15 cffi-1.15.1 charset-normalizer-2.1.1 deprecated-1.2.13 github-repo-traffic-2.0.0 idna-3.3 numpy-1.23.2 pandas-1.4.3 pycparser-2.21 pyjwt-2.4.0 pynacl-1.5.0 python-dateutil-2.8.2 python-dotenv-0.20.0 pytz-2022.2.1 requests-2.28.1 six-1.16.0 urllib3-1.26.12 wrapt-1.14.1
50 changes: 32 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Repository Traffic
uses: wumphlett/repostats@v1.1.0
uses: wumphlett/repostats@v2.0.0
env:
TRAFFIC_ACTION_TOKEN: ${ secrets.TRAFFIC_ACTION_TOKEN }
```
Expand Down Expand Up @@ -52,28 +52,42 @@ daily.
4. Trigger the action to format your readme which will automatically commit the changes
1. Note, all changes that you want to make to your readme must now be made to the template instead of the readme in the root of the repo
## Running `github-repo-traffic` locally
You can use the package responsible for metric collection/aggregation locally instead of in a github action.
1. `pip install github-repo-stats`
2. Set the environment variables in `.env.example`
1. TRAFFIC_ACTION_TOKEN - a personal access token with repo permissions
2. GITHUB_REPOSITORY - the repo you're trying to collect metrics for (e.g. wumphlett/repostats)
3. GITHUB_WORKSPACE - your root directory (can be anything if you're not using readme formatting, else root of a repo)
4. TRAFFIC_DIR - the directory to store collected metrics (default `.traffic`)
3. Invoke the commands
1. `repo-data` - collects and aggregates metric data (make sure to run at least every two weeks for complete data)
2. `repo-readme` - formats a template readme with a views/clones chart
```

Total Views per Day from 2022-08-25 to 2022-08-26

Repository Views
3.00 ┼╮
2.93 ┤│
2.87 ┤│
2.80 ┤│
2.73 ┤│
2.67 ┤│
2.60 ┤│
2.53 ┤│
2.47 ┤│
2.40 ┤│
2.33 ┤│
2.27 ┤│
2.20 ┤│
2.13 ┤│
2.07 ┤│
2.00 ┤╰
322.00 ┤
303.19 ┼╮
284.38 ┤│
265.56 ┤│
246.75 ┤│
227.94 ┤│
209.12 ┤│
190.31 ┤│
171.50 ┤│
152.69 ┤│
133.88 ┤│
115.06 ┤│
96.25 ┤│
77.44 ┤│
58.62 ┤│
39.81 ┤│
21.00 ┤╰

Chart last updated - Sat Aug 27 20:12:40 2022 UTC
Chart last updated - Sat Aug 27 20:35:23 2022 UTC

```

0 comments on commit 9fb006c

Please sign in to comment.