Created
August 10, 2020 00:57
-
-
Save zeikomi552/dcc91100a68ba9b3f68484f92c092efe to your computer and use it in GitHub Desktop.
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
import requests | |
import json | |
import pandas as pd | |
USERNAME = 'xxxxxx'' # github username | |
PASSWORD = 'xxxxxx' # github password | |
PAGE=2 | |
PER_PAGE=100 | |
# 1. create url text | |
url = 'https://api.github.com/users?page={0}&per_page={1}'.format(PAGE, PER_PAGE) # base url | |
# 2. create session | |
session = requests.Session() | |
session.auth = (USERNAME, PASSWORD) | |
# 3. GET request | |
response = session.get(url) | |
# 4. transform dataframe | |
df = pd.DataFrame(response.json()) | |
# 5. information | |
print(df.info()) | |
# 6. show login id list | |
print(df['login']) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment