Skip to content

Commit 478dc35

Browse files
committed
docs: Create aims.md and move content to it
1 parent db1c126 commit 478dc35

File tree

3 files changed

+41
-38
lines changed

3 files changed

+41
-38
lines changed

docs/README.md

Lines changed: 1 addition & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -4,42 +4,6 @@
44
A project to explore the Github GraphQL API for fun and to output data on repos, users and commits for reporting.
55

66

7-
## Aims
8-
9-
If you want to learn about GraphQL, GraphQL + Python integration, or to do reporting on Github data using the GraphQL API, then this project is for you. See the headings in this section.
10-
11-
12-
### GraphQL reference
13-
14-
If you came here just to look at GraphQL queries that get data from Github, see the [queries](/ghgql/queries) directory. You can paste those in Github's [GraphQL Explorer](https://developer.github.com/v4/explorer/) and run them against public data. For some queries you need to add JSON params in the query variables section.
15-
16-
If you want to download the results as text or CSV files or automate the requests for many pages of data, then follow the [documentation](#documentation) section below to setup the project then run the command-line Python scripts which generate the reports. The scripts use the GQL queries internally.
17-
18-
Why _GraphQL_ and not the _REST_ API? This project arose because of speed and rate limit issues with using _REST_ API for large volumes of commit data for _Github_. But, the _GraphQL_ API is about **100 times faster**, in many cases such as getting a page of 100 commits rather than one commit from the REST API commit endpoint. See the Datasources doc's [GraphQL benefits](/datasources.md#graphql-benefits) section for more details.
19-
20-
### GraphQL + Python reference
21-
22-
Another aim of this project is to explore how to run _GraphQL_ queries with _Python_. This work here can be used as a reference for programmers new to this area. The understanding of querying Github can be applied to other _GraphQL_ APIs.
23-
24-
No library specific to GraphQL or Github is used. Rather this project's scripts use Python [requests](https://requests.kennethreitz.org/en/master/) to send a query string and optional query parameters to the GraphQL API.
25-
26-
The project includes Python scripts and _GraphQL_ queries of varying complexity. Some reports multiple pages of data. Some accept command-line arguments. One of them reads required report data from a config file.
27-
28-
### Reporting
29-
30-
The reporting goal of this project is to fetch stats about Github repos of interest and generate reports.
31-
32-
The GraphQL API is used to get this data at scale, which enables quick reporting on a even large Github organization or user account with many repos. This project's reports generally fetch data in a single request that otherwise take 100 or more requests to the REST API. Additionally, some of the report script in this project have pagination built in, to get data beyond the first page.
33-
34-
The response data is parsed and then printed on the screen or written to CSV reports.
35-
36-
Here is an outline of the report scripts available in this project, with links to them in usage document.
37-
38-
- [Demos reports](/usage.md#demo-reports) - A few simple scripts.
39-
- [Repo summary reports](/usage.md#repo-summary-reports) - Get metadata about reports or counts of commits.
40-
- [Commit reports](/usage.md#commit-reports) - Get the _git_ commit history across multiple repos and to see how your organization or team members contribute.
41-
42-
437
## Project requirements
448

459
You need the following to run this project:
@@ -54,6 +18,7 @@ You need the following to run this project:
5418

5519
See the following guides so you can use this project to generate some reports for yourself on users or repos you are interested in. Note that these only cover the case of a Unix-style environment.
5620

21+
- [Aims](/aims.md) - The main purposes for this project and how they could benefit you.
5722
- [Installation](/installation.md) - Setup project environment and configs.
5823
- [Usage](/usage.md) - Run scripts to generate reports.
5924
- [Datasources](/datasources.md) - Info and links around APIs.

docs/aims.md

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Aims
2+
3+
If you want to learn about GraphQL, GraphQL + Python integration, or to do reporting on Github data using the GraphQL API, then this project is for you.
4+
5+
6+
## GraphQL reference
7+
8+
If you came here just to look at GraphQL queries that get data from Github, see the [queries](/ghgql/queries) directory. You can paste those in Github's [GraphQL Explorer](https://developer.github.com/v4/explorer/) and run them against public data. For some queries you need to add JSON params in the query variables section.
9+
10+
If you want to download the results as text or CSV files or automate the requests for many pages of data, then follow the [documentation](#documentation) section below to setup the project then run the command-line Python scripts which generate the reports. The scripts use the GQL queries internally.
11+
12+
Why _GraphQL_ and not the _REST_ API? This project arose because of speed and rate limit issues with using _REST_ API for large volumes of commit data for _Github_. But, the _GraphQL_ API is about **100 times faster**, in many cases such as getting a page of 100 commits rather than one commit from the REST API commit endpoint. See the Datasources doc's [GraphQL benefits](/datasources.md#graphql-benefits) section for more details.
13+
14+
## GraphQL + Python reference
15+
16+
Another aim of this project is to explore how to run _GraphQL_ queries with _Python_. This work here can be used as a reference for programmers new to this area. The understanding of querying Github can be applied to other _GraphQL_ APIs.
17+
18+
No library specific to GraphQL or Github is used. Rather this project's scripts use Python [requests](https://requests.kennethreitz.org/en/master/) to send a query string and optional query parameters to the GraphQL API.
19+
20+
The project includes Python scripts and _GraphQL_ queries of varying complexity. Some reports multiple pages of data. Some accept command-line arguments. One of them reads required report data from a config file.
21+
22+
## Reporting
23+
24+
The reporting goal of this project is to fetch stats about Github repos of interest and then generate reports.
25+
26+
The GraphQL API is used to get this data at scale, which enables quick reporting on a even large Github organization or user account with many repos. This project's reports generally fetch data in a single request that otherwise take 100 or more requests to the REST API. Additionally, some of the report script in this project have pagination built in, to get data beyond the first page.
27+
28+
The response data is parsed and then printed on the screen or written to CSV reports.
29+
30+
See the [usage](/usage.md) page for details on what reports you get.

docs/usage.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22

33
Follow in the instructions in this section to run the scripts in this project.
44

5+
**Table of contents**
6+
7+
- [Activate environment](#activate-environment)
8+
- [Demos reports](#demo-reports) - A few simple scripts.
9+
- [Repo summary reports](#repo-summary-reports) - Get metadata about reports or counts of commits.
10+
- [Commit reports](#commit-reports) - Get the _git_ commit history across multiple repos and to see how your organization or team members contribute.
11+
12+
513
## Activate environment
614

715
Activate the virtual environment and navigate to the app directory.
@@ -15,7 +23,7 @@ $ cd ghgql
1523
Note: If you use the _VS Code_ IDE and open a terminal _after_ the Python Extension has loaded, this will be done for you because of the configs that come with this project.
1624

1725

18-
## Demos reports
26+
## Demo reports
1927

2028
Run the simple demo scripts, which take no inputs or configs (other than access token). They showcase querying the GraphQL and printing the JSON responses to the screen.
2129

@@ -149,7 +157,7 @@ To change the report output, update and save the config then rerun the report.
149157
150158
### Experimental scripts
151159
152-
Run the [query.py](/ghgql/query.py) script along with the path of target queries form the [queries](/ghgql/queries) directory.
160+
Run the `ghgql/query.py` script along with the path of target queries form the `ghgql/queries` directory.
153161
154162
You can view the query text first, to see what variables are needed. As you will get an API error printed to the console if you omit a required variable.
155163

0 commit comments

Comments
 (0)