Skip to content

Commit afb494c

Browse files
authored
Expand README (#10)
1 parent e2fb986 commit afb494c

2 files changed

Lines changed: 33 additions & 11 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -160,3 +160,5 @@ cython_debug/
160160
# and can be added to the global gitignore or merged into this file. For a more nuclear
161161
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
162162
#.idea/
163+
# MAC
164+
.DS_Store

README.md

Lines changed: 31 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# devstats
22

3-
This repository holds the devstats package. devstats uses 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
55
project.
66

77
## OAuth key for accessing GitHub
@@ -12,23 +12,43 @@ you need a personal access token with `public_repo` permission to access the Gra
1212
This code expects the personal access token to be in the environment variable
1313
`GRAPH_API_KEY`.
1414

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>`
1720

1821
## Query script
1922

2023
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
2225
`repo_name` are the names of the **org** and **repo** on GitHub, respectively.
2326

24-
First you need to install the required Python packages:
27+
To download the latest data for `pandas` use the following command:
2528

2629
```bash
27-
pip install -r requirements.txt
30+
devstats query.py pandas-dev pandas
2831
```
2932

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:
3134

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
54+
commit modified changes to git locally.

0 commit comments

Comments
 (0)