Skip to content

Instantly share code, notes, and snippets.

@zeikomi552
Created August 10, 2020 00:57
Show Gist options
  • Save zeikomi552/dcc91100a68ba9b3f68484f92c092efe to your computer and use it in GitHub Desktop.
Save zeikomi552/dcc91100a68ba9b3f68484f92c092efe to your computer and use it in GitHub Desktop.
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