Skip to content

Commit

Permalink
update README with token instructions (#4)
Browse files Browse the repository at this point in the history
* copy readme over from devstats-data repo

* Make linter happy

---------

Co-authored-by: Jarrod Millman <jarrod.millman@gmail.com>
  • Loading branch information
munkm and jarrodmillman authored May 23, 2023
1 parent 644ca11 commit 56328c1
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
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
```

0 comments on commit 56328c1

Please sign in to comment.