-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update README with token instructions (#4)
* copy readme over from devstats-data repo * Make linter happy --------- Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
- Loading branch information
1 parent
644ca11
commit 56328c1
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,34 @@ | ||
# devstats | ||
|
||
This repository holds the devstats package. devstats uses the github API to | ||
generate developer statistics and a developer statistics report on a specified | ||
project. | ||
|
||
## OAuth key for accessing GitHub | ||
|
||
Per the [GitHub GraphQL API docs](https://developer.github.com/v4/guides/forming-calls/), | ||
you need a personal access token with `public_repo` permission to access the GraphQL API. | ||
|
||
This code expects the personal access token to be in the environment variable | ||
`GRAPH_API_KEY`. | ||
|
||
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. | ||
Then, when you want to use the code: `export GRAPH_API_KEY=<yourkey>` | ||
|
||
## Query script | ||
|
||
The `query.py` script can be used to collect data for other projects like | ||
so: `python query.py <repo_owner> <repo_name>` where `repo_owner` and | ||
`repo_name` are the names of the **org** and **repo** on GitHub, respectively. | ||
|
||
First you need to install the required Python packages: | ||
|
||
```bash | ||
pip install -r requirements.txt | ||
``` | ||
|
||
For example, to download the latest data for `pandas`: | ||
|
||
```bash | ||
python query.py pandas-dev pandas | ||
``` |