Spaces:
Sleeping
Sleeping
Upload display_user_info.py
Browse files
github_analytics/display_user_info.py
ADDED
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import streamlit as st
|
2 |
+
|
3 |
+
|
4 |
+
def display_user_info(user_data):
|
5 |
+
"""Displays user information retrieved from GitHub API."""
|
6 |
+
if not user_data:
|
7 |
+
return
|
8 |
+
|
9 |
+
st.title("**User Info:**")
|
10 |
+
|
11 |
+
st.write(f"**Name:** {user_data['name']}")
|
12 |
+
st.write(f"**Username:** {user_data['login']}")
|
13 |
+
|
14 |
+
st.write("**User Image:**")
|
15 |
+
st.image(user_data["avatar_url"], width=100)
|
16 |
+
|
17 |
+
bio = user_data.get("bio", "N/A")
|
18 |
+
location = user_data.get("location", "N/A")
|
19 |
+
st.write(f"**Bio:** {bio}")
|
20 |
+
st.write(f"**Location:** {location}")
|
21 |
+
|
22 |
+
st.write("---") # Separator
|
23 |
+
|
24 |
+
st.metric("Repositories", user_data["public_repos"])
|
25 |
+
st.metric("Followers", user_data["followers"])
|
26 |
+
st.metric("Following", user_data["following"])
|