Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added Github.py to Hacktoberfest 2025
  • Loading branch information
vishakha-kaithwas committed Oct 10, 2025
commit 300b0a02bd1040fbd926a5b85b967457eab63eb5
33 changes: 33 additions & 0 deletions Github.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import requests
import time

username = input("Enter your username here:")

def wrapper(fetch):
def timing():
start = time.time()
fetch()
end = time.time()
print(f"Total execution time: {end-start:.4f}")
return timing

@wrapper
def fetch():
api = f"https://api.github.com/users/{username}"
res = requests.get(api)

if res.status_code != 200:
print("Error fetching data")
return

else:
data = res.json()
print(f"Username : {username}")
print(f"Name: {data.get('name','N/A')}" )
print(f"Bio: {data.get('bio',None)}")
print(f"Public Repos: {data.get('public_repos',None)}")
print(f"Followers: {data.get('followers',None)}")
print(f"Following: {data.get('following',None)}")
print(f"Profile Link: {data.get('url',None)}")

fetch()