Fetch Github China users by Python with Github GraphQL API.
Create config.yml
as config file at project root directory, and write this line below:
token: xxx
Follow the steps in "Creating a personal access token" to create a token and fill in config file. The scope requires repo, admin:org and user to fetch data.
pip install -r requirements.txt
python main.py
Executing GraphQL query to fetching Github China's users.
Parameters:
num
: How many users you want to fetch?batch_size
: How many users to fetch in a request?
Transform data to Pandas DataFrame.
Write DataFrame to file. Notice: you must run toDataFrame()
before calling this function.
Parameters:
fileName
: The file name you want to write.mode
: Writing modea
: append to filew
: overwrite the file
This project is licensed under the terms of the MIT license.