import requests
import getpass
import json

# Get username from Windows logged user
username = getpass.getuser()

# Input username for github Basic Auth
input_username = input(f'username({username}): ')

# Input password for github Basic Auth
password = getpass.getpass(prompt='Password: ', stream='*')

# If user left username empty, then Windows username will be used instead
if input_username:
    username = input_username

# Create a session
s = requests.Session()

# Sign in the session
s.get('https://api.github.com/user', auth=(username, password))

# Get profile details, returning a json response
r = s.get('https://api.github.com/user')

print(json.dumps(r.json(),indent=4))

fbe22afd4ff4de40550f7c8ccc70ffec521929f8
<mask token>

<mask token>
if input_username:
    username = input_username
<mask token>
s.get('https://api.github.com/user', auth=(username, password))
<mask token>
print(json.dumps(r.json(), indent=4))

<mask token>
username = getpass.getuser()
input_username = input(f'username({username}): ')
password = getpass.getpass(prompt='Password: ', stream='*')
if input_username:
    username = input_username
s = requests.Session()
s.get('https://api.github.com/user', auth=(username, password))
r = s.get('https://api.github.com/user')
print(json.dumps(r.json(), indent=4))

import requests
import getpass
import json
username = getpass.getuser()
input_username = input(f'username({username}): ')
password = getpass.getpass(prompt='Password: ', stream='*')
if input_username:
    username = input_username
s = requests.Session()
s.get('https://api.github.com/user', auth=(username, password))
r = s.get('https://api.github.com/user')
print(json.dumps(r.json(), indent=4))

import requests
import getpass
import json

# Get username from Windows logged user
username = getpass.getuser()

# Input username for github Basic Auth
input_username = input(f'username({username}): ')

# Input password for github Basic Auth
password = getpass.getpass(prompt='Password: ', stream='*')

# If user left username empty, then Windows username will be used instead
if input_username:
    username = input_username

# Create a session
s = requests.Session()

# Sign in the session
s.get('https://api.github.com/user', auth=(username, password))

# Get profile details, returning a json response
r = s.get('https://api.github.com/user')

print(json.dumps(r.json(),indent=4))
