1- # Github Analytics
1+ # GitMetrics
22
3- Scripts to extract multiple metrics from Github Projects.
3+ Scripts to extract multiple metrics from GitHub Projects.
44
55## Install
66
77``` bash
8- pip install git+ssh://git@github.com/datacebo/github-analytics
8+ pip install git+ssh://git@github.com/datacebo/gitmetrics
99```
1010
1111### Development
1212
1313For development, clone the repository and install ` dev-requirements.txt ` :
1414
1515``` bash
16- git clone git@github.com:datacebo/github-analytics
17- cd github-analytics
18- pip install -r dev-requirements.txt
16+ git clone git@github.com:datacebo/gitmetrics
17+ cd gitmetrics
18+ pip install -e .[test,dev]
1919```
2020
2121# Local Usage
2222
23- To collect metrics from github by running ` github-analytics ` on your computer you need to provide:
23+ To collect metrics from GitHub by running ` gitmetrics ` on your computer you need to provide:
2424
25- 1 . A Github Token. Documentation about how to create a Personal Access Token can be found
25+ 1 . A GitHub Token. Documentation about how to create a Personal Access Token can be found
2626 [ here] ( https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token )
27- 2 . A list of Github Repositories for which to collect the metrics. The repositories need
27+ 2 . A list of GitHub Repositories for which to collect the metrics. The repositories need
2828 to be given as ` {org-name}/{repo-name} ` , like ` sdv-dev/SDV ` .
29293 . (Optional) A filename where the output will be stored. If a name containing the ` .xlsx `
3030 extension is given (like ` path/to/my-filename.xlsx ` ), it will be used as provided.
@@ -36,44 +36,44 @@ To collect metrics from github by running `github-analytics` on your computer yo
3636## Python Interface
3737
3838In order to run the collection script from python, the ` collect_project_metrics ` function
39- needs to be imported from the ` github_analytics ` package and executed passing the values
39+ needs to be imported from the ` gitmetrics ` package and executed passing the values
4040indicated above.
4141
4242** NOTE** : For detailed output, logging must be enabled as shown in the example below.
4343
4444``` python3
4545>> > import logging
4646>> > logging.basicConfig(level = logging.INFO )
47- >> > from github_analytics import collect_project_metrics
47+ >> > from gitmetrics import collect_project_metrics
4848>> > repositories = [' sdv-dev/RDT' , ' sdv-dev/SDV' , ' sdv-dev/Copulas' , ' sdv-dev/CTGAN' ]
4949>> > output_name = ' sdv-dev'
5050>> > token = ' <my-github-token>'
5151>> > collect_project_metrics(token, repositories, output_name)
52- INFO :github_analytics .main:Getting information for repository sdv- dev/ RDT
52+ INFO :gitmetrics .main:Getting information for repository sdv- dev/ RDT
5353100 % | ███████████████████████████████████████████████████████████████| 143 / 143 [00 :00 < 00 :00 , 195. 00it / s]
5454100 % | ███████████████████████████████████████████████████████████████| 182 / 182 [00 :00 < 00 :00 , 364. 64it / s]
5555100 % | ███████████████████████████████████████████████████████████████| 37 / 37 [00 :00 < 00 :00 , 91020. 09it / s]
56- INFO :github_analytics .main:Getting information for repository sdv- dev/ SDV
56+ INFO :gitmetrics .main:Getting information for repository sdv- dev/ SDV
5757100 % | ███████████████████████████████████████████████████████████████| 389 / 389 [00 :02 < 00 :00 , 193. 20it / s]
5858100 % | ███████████████████████████████████████████████████████████████| 219 / 219 [00 :00 < 00 :00 , 231. 17it / s]
5959100 % | ███████████████████████████████████████████████████████████████| 561 / 561 [00 :03 < 00 :00 , 158. 39it / s]
60- INFO :github_analytics .main:Getting information for repository sdv- dev/ Copulas
60+ INFO :gitmetrics .main:Getting information for repository sdv- dev/ Copulas
6161100 % | ███████████████████████████████████████████████████████████████| 138 / 138 [00 :00 < 00 :00 , 333. 27it / s]
6262100 % | ███████████████████████████████████████████████████████████████| 143 / 143 [00 :00 < 00 :00 , 287. 29it / s]
6363100 % | ███████████████████████████████████████████████████████████████| 245 / 245 [00 :01 < 00 :00 , 204. 88it / s]
64- INFO :github_analytics .main:Getting information for repository sdv- dev/ CTGAN
64+ INFO :gitmetrics .main:Getting information for repository sdv- dev/ CTGAN
6565100 % | ███████████████████████████████████████████████████████████████| 113 / 113 [00 :00 < 00 :00 , 287. 26it / s]
6666100 % | ██████████████████████████████████████████████████████████████| 64 / 64 [00 :00 < 00 :00 , 134824. 44it / s]
6767100 % | ███████████████████████████████████████████████████████████████| 498 / 498 [00 :02 < 00 :00 , 171. 11it / s]
68- INFO :github_analytics .main:Getting 164 missing users
68+ INFO :gitmetrics .main:Getting 164 missing users
6969 99 % | ██████████████████████████████████████████████████████████████▌| 163 / 164 [00 :01 < 00 :00 , 121. 99it / s]
70- INFO :github_analytics .output:Creating file github- metrics- sdv- dev- 2021 - 11 - 12. xlsx
70+ INFO :gitmetrics .output:Creating file github- metrics- sdv- dev- 2021 - 11 - 12. xlsx
7171```
7272
7373
7474# # Command Line Interface
7575
76- In order to run the collection script from the command line, the `github - analytics collect` command
76+ In order to run the collection script from the command line, the `gitmetrics collect` command
7777must be called passing the following optional arguments:
7878
7979- `- c / -- config- file CONFIG_FILE ` : Path to the config file to use. Defaults to `config.yaml` .
@@ -91,13 +91,13 @@ must be called passing the following optional arguments:
9191 spreadsheet.
9292- `- n / -- not - incremental` : If indicated, collect data from scratch instead of doing it
9393 incrementally over the existing data.
94- - `- t / -- token` : Github token to use. If not given, it will be requested in a prompt.
94+ - `- t / -- token` : GitHub token to use. If not given, it will be requested in a prompt.
9595- `- l / -- logfile LOGFILE ` : Write logs to the indicated logfile.
9696- `- v / -- verbose` : Be more verbose.
9797
9898```bash
99- $ github - analytics github - p sdv- dev - c config.yaml
100- Please input your Github Token: < my- github- token>
99+ $ gitmetrics github - p sdv- dev - c config.yaml
100+ Please input your GitHub Token: < my- github- token>
1011012021 - 11 - 12 15 :42 :43 ,100 - INFO - Getting information for repository sdv- dev/ RDT
102102100 % | ███████████████████████████████████████████████████████████████| 143 / 143 [00 :00 < 00 :00 , 300. 87it / s]
103103100 % | ███████████████████████████████████████████████████████████████| 182 / 182 [00 :00 < 00 :00 , 324. 25it / s]
@@ -144,7 +144,7 @@ aggregation metrics for the entire project.
144144
145145# # Google Drive Integration
146146
147- Github Analytics is capable of reading and writing results in Google Spreadsheets.
147+ GitMetrics is capable of reading and writing results in Google Spreadsheets.
148148
149149For this to work, the following things are required:
150150
@@ -156,11 +156,11 @@ For this to work, the following things are required:
156156 the corresponding `settings.yaml` file , or passed via the `PYDRIVE_CREDENTIALS ` environment
157157 variable.
158158
159- # Github Analytics Configuration
159+ # GitMetrics Configuration
160160
161- The Github Analytics script can be configured using a YAML file that indicates which repositories
161+ The GitMetrics script can be configured using a YAML file that indicates which repositories
162162to collect and where to store the collected data, as well as when to execute the collection
163- of data using Github Actions.
163+ of data using GitHub Actions.
164164
165165For more details about how to configure this, check the [CONFIGURATION .md](CONFIGURATION .md)
166166document.
0 commit comments