You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This repository holds the devstats package. devstatsuses the github API to
4
-
generate developer statistics and a developer statistics report on a specified
3
+
This repository holds the `devstats` package. `devstats` is a Python command line tool that uses the GitHub GraphQL API to
4
+
generate developer statistics and a developer statistics report for a specified
5
5
project.
6
6
7
7
## OAuth key for accessing GitHub
@@ -12,23 +12,43 @@ you need a personal access token with `public_repo` permission to access the Gra
12
12
This code expects the personal access token to be in the environment variable
13
13
`GRAPH_API_KEY`.
14
14
15
-
You can [create a personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) on GitHub and save it somewhere you trust.
16
-
Then, when you want to use the code: `export GRAPH_API_KEY=<yourkey>`
15
+
You can [create a personal access token](https://help.github.com/en/github/authenticating-to-github/creating-a-personal-access-token-for-the-command-line) on GitHub. Save the token in a trusted location.
16
+
17
+
Finally, add the token to your environment using:
18
+
19
+
`export GRAPH_API_KEY=<yourkey>`
17
20
18
21
## Query script
19
22
20
23
The `query.py` script can be used to collect data for other projects like
21
-
so: `python query.py <repo_owner> <repo_name>` where `repo_owner` and
24
+
so: `devstats query.py <repo_owner> <repo_name>` where `repo_owner` and
22
25
`repo_name` are the names of the **org** and **repo** on GitHub, respectively.
23
26
24
-
First you need to install the required Python packages:
27
+
To download the latest data for `pandas` use the following command:
25
28
26
29
```bash
27
-
pip install -r requirements.txt
30
+
devstats query.py pandas-dev pandas
28
31
```
29
32
30
-
For example, to download the latest data for `pandas`:
33
+
The command will collect information from GitHub and generate two output files in the same directory where you ran it as follows:
31
34
32
-
```bash
33
-
python query.py pandas-dev pandas
34
-
```
35
+
`packagename_issues.json`: this file contains information about issues for the repository of interest.
36
+
`packagename_PRs.json`: this file contains information associated with pull requests for the repository of interest.
37
+
38
+
## Development instructions
39
+
40
+
If you wish to contribute to devstats:
41
+
42
+
1. Fork and clone the repository
43
+
2. Create a new branch with your proposed feature or change to the package repository
44
+
45
+
### Code Style / Pre-commit
46
+
47
+
We use `pre-commit` to ensure the code style is consistent. To install pre-commit locally:
48
+
49
+
1. First install pre-commit: `pip install pre-commit`
50
+
2. Install all of the pre-commit hooks by running `pre-commit install`
51
+
52
+
Once you have `pre-commit` installed, the code stylers and linters
53
+
defined in the `pre-commit-config.yaml` will run each time you
0 commit comments