Getting the perfect project for your open source contributions
import streamlit as st
from PIL import Image
import webbrowser
from streamlit_javascript import st_javascript

st.set_page_config(
        page_title="OpenMatch",
        page_icon="🎯",
        layout="wide",
        initial_sidebar_state="auto",
    )


url = st_javascript("await fetch('').then(r => window.parent.location.href)")

projectsUrl = url + "opensource_projects"
statsUrl = url + "show_stats_page"

image = Image.open('logo.png')

st.image(image, caption='OpenMatch logo',use_column_width=True, width=100)
st.markdown("<h1 style='text-align: center; color: white;'>OpenMatch</h1>", unsafe_allow_html=True)
st.markdown("<h5 style='text-align: center; color: white;font-family: 'arial'>OpenMatch: Match your coding skills!</h5>", unsafe_allow_html=True)
st.write("""

    "OpenMatch is the ultimate destination of your work goals. It helps you find cool projects to work on, just like finding hidden treasures. It's super fun and makes you feel like a tech superhero! So, if you're a coder, don't miss out on OpenMatch – it's awesome!,
         Especially for the festivals of ghw, hacktoberfest or hackquad, OpenMatch has got you covered!"
""")

st.divider()

btn1 = st.button("Get Started! 🔥, Please Find projects for me!")

if btn1:
    webbrowser.open(projectsUrl)
else:
    print('cool')    

btn2 = st.button('Yay! Please show me my stats, for my own knowledge!')

if btn2:
    webbrowser.open(statsUrl)

landing_page.py
You-now-Who/Openmatch
import streamlit as st
import requests
from collections import Counter
import pandas as pd
import webbrowser
import json

licenses = [
    "Any",
    "MIT License",
    "GNU General Public License (GPL) - GPL-3.0",
    "GNU General Public License (GPL) - GPL-2.0",
    "Apache License - Apache-2.0",
    "BSD License - BSD-3-Clause",
    "BSD License - BSD-2-Clause",
    "Mozilla Public License (MPL) - MPL-2.0",
    "GNU Lesser General Public License (LGPL) - LGPL-3.0",
    "GNU Lesser General Public License (LGPL) - LGPL-2.1",
    "Eclipse Public License (EPL) - EPL-2.0",
    "Common Development and Distribution License (CDDL) - CDDL-1.1",
    "ISC License",
    "Unlicense",
    "Creative Commons Licenses",
    "GNU Affero General Public License (AGPL) - AGPL-3.0",
]

def get_most_used_languages(token, name):
    api_end_point = "https://api.github.com/graphql"
    headers = {"Authorization": "Token " + token}
    query = """
    {
      user (login: "%s") {
        repositories (first: 100) {
          nodes {
            languages (first: 100) {
              nodes {
                name
              }
            }
          }
        }
      }
    }
    """ % name
    try:
        response = requests.post(api_end_point, json={"query": query}, headers=headers)
        response.raise_for_status()
        data = response.json()
        language_counts = Counter()
        for repo in data["data"]["user"]["repositories"]["nodes"]:
            for language in repo["languages"]["nodes"]:
                language_counts[language["name"]] += 1
        most_common_languages = language_counts.most_common(5)

        lang_list = []
        for lang in most_common_languages:
            lang_list.append(lang[0])
        return lang_list
    
    except Exception as e:
        # st.error(f"Error occurred while fetching languages: {e}")
        pass

def getOwnerAvatar(owner, token):
      # Try to get avatar of the owner or the organization

      endpoint = 'https://api.github.com/graphql'
      headers = {'Authorization': 'bearer ' + token}

      u_query = f"""{{
        user(login: "{owner}") {{
          avatarUrl
        }}
      }}
      """

      o_query = f"""{{
        organization(login: "{owner}") {{
          avatarUrl
        }}
      }}
      """

      user_response = requests.post(endpoint, json={'query': u_query}, headers=headers)
      org_response = requests.post(endpoint, json={'query': o_query}, headers=headers)

      if user_response.status_code == 200:
        data_u = json.loads(user_response.text)
        try:
          return data_u['data']['user']['avatarUrl']
        except:
          return None
      elif org_response.status_code == 200:
        data_o = json.loads(org_response.text)
        try:
          return data_o['data']['organization']['avatarUrl']
        except:
          return None
      else:
        return None

def get_issues(token, langs, limit=10):
    
    endpoint = 'https://api.github.com/graphql'
    headers = {'Authorization': 'bearer ' + token}
  
    query = """
  {
    search(query: " language:""" + " language:".join(langs) + """", type: ISSUE, first: """ + str(limit) + """) {
      edges {
        node {
          ... on Issue {
            title
            body
            url
            repository {
              name
              owner {
                login
              }
            }
          }
        }
      }
    }
  }
  """
    
    r = requests.post(endpoint, json={'query': query}, headers=headers)

    data = json.loads(r.text)

    issues = data['data']['search']['edges']

    return issues

def get_repos(langs, token, filters, limit=10):

  endpoint = 'https://api.github.com/graphql'
  headers = {'Authorization': 'bearer ' + token}
  
  query = ""

  if filters != {}:
      query_string = ""
      available_filters = filters.keys()

      final_filters = []
    
    
      language_filters = " ".join([f'language:{lang}' for lang in langs])
      final_filters.append(language_filters)

      if "topics" in available_filters:
        if filters["topics"] != "":
          topics = filters["topics"].split(",")
          topic_filters = " ".join([f'topic:{topic}' for topic in topics])
          final_filters.append(topic_filters)

      if "min_stars" in available_filters:
        min_stars = filters["min_stars"]
        min_stars_filter = f"stars:>{min_stars}"
        final_filters.append(min_stars_filter)

      if "min_commits" in available_filters:
        min_commits = filters["min_commits"]
        min_commits_filter = f"commits:>{min_commits}"
        final_filters.append(min_commits_filter)

      if "min_issues" in available_filters:
        min_issues = filters["min_issues"]
        min_issues_filter = f"issues:>{min_issues}"
        final_filters.append(min_issues_filter)

      if "date" in available_filters:
        date = filters["date"]
        date_text = filters["date_text"]
        date_filter = f"created:{date_text}{date}"
        final_filters.append(date_filter)

      if "order_by" in available_filters:
        order_by = filters["order_by"]
        order_by_filter = f"sort:{order_by}"
        final_filters.append(order_by_filter)

      for f in final_filters:
        print(f)
        query_string += f + " "

      query = """
          {
            search(query: \" """ + query_string + """ \", type: REPOSITORY, first: """ + str(limit) +""") {
              edges {
                node {
                  ... on Repository {
                    name
                    description
                    owner {
                      login
                    }
                    url
                  }
                }
              }
            }
          }
          """
      pass

  else:
  
    query = """
  {
    search(query: "language:""" + " language:".join(langs) + """ ", type: REPOSITORY, first: """ + str(limit) +""") {
      edges {
        node {
          ... on Repository {
            name
            description
            owner {
              login
            }
            url
          }
        }
      }
    }
  }
  """

  r = requests.post(endpoint, json={'query': query}, headers=headers)

  data = json.loads(r.text)
  # return 0
  print(data)

  repos = data['data']['search']['edges']

  return repos

def get_open_issues(token, langs, limit=10):
    
    issues = get_issues(token, langs=langs, limit=limit)

    if issues:
        cards_per_row = 3
        num_rows = len(issues) // cards_per_row

        card_style = """
        <style>
        .card {
            background-color: #f4f4f4;
            padding: 10px;
            border-radius: 5px;
            margin: 10px;
            box-shadow: 2px 2px 5px #888888;
        }
        </style>
        """

        # Inject the CSS style into the Streamlit app
        st.markdown(card_style, unsafe_allow_html=True)

        # Remove all the issues that don't have a title
        issues = [issue for issue in issues if issue['node']]

        # Display repositories in cards layout
        for row in range(num_rows):
            columns = st.columns(cards_per_row)
            for i in range(cards_per_row):
                index = row * cards_per_row + i
                if index < len(issues):
                    issue = issues[index]['node']
                    print(issue.keys())
                    with columns[i]:
                        try:
                          st.write(f"**{issue['title']}**")
                          # show only first 100 characters of the body
                          st.write(issue['body'][:100] + '...')
                          st.markdown(f"[GitHub Link]({issue['url']})", unsafe_allow_html=True)
                        except:
                          st.write(f"**UNABLE TO FETCH ISSUE**")


def get_opensource_projects(token, user, langs, filters, limit=10):

    repos = get_repos(langs, token, filters, limit)

    if repos:
        # Define the number of cards per row
        cards_per_row = 3

        # Calculate the number of rows required
        num_rows = len(repos) // cards_per_row

        # Define a CSS class for the card style
        card_style = """
        <style>
        .card {
            background-color: #f4f4f4;
            padding: 10px;
            border-radius: 5px;
            margin: 10px;
            box-shadow: 2px 2px 5px #888888;
        }
        </style>
        """

        # Inject the CSS style into the Streamlit app
        st.markdown(card_style, unsafe_allow_html=True)

        # Display repositories in cards layout
        for row in range(num_rows):
            columns = st.columns(cards_per_row)
            for i in range(cards_per_row):
                index = row * cards_per_row + i
                if index < len(repos):
                    repo = repos[index]['node']
                    owner = repo['owner']

                    avatarUrl = getOwnerAvatar(owner['login'], token)
                    if avatarUrl == None:
                        avatarUrl = 'https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png'
                    with columns[i]:
                        st.image(avatarUrl, width=100, output_format='PNG')
                        
                        st.write(index+1)
                        st.write(f"**{repo['name']}**")
                        # st.write(repo['description'])
                        # limit description to 100 words
                        try:
                          st.write(repo['description'][:500] + '...')
                        except:
                          st.write("No description available")
                        st.write(f"Author: {repo['owner']['login']}")
                        st.markdown(f"[GitHub Link]({repo['url']})", unsafe_allow_html=True)
                        # st.markdown('</div>', unsafe_allow_html=True)
    pass



st.set_page_config(
    page_title="GitHub Stats",
    page_icon="🎯",
    layout="wide",
    initial_sidebar_state="auto",
)

st.markdown("<h2 style='text-align: center; color: white;'>Let's find some open source projects for you to contribute!</h2><br><br>", unsafe_allow_html=True)

st.sidebar.subheader("GitHub Credentials")
githubName = st.sidebar.text_input("Enter your GitHub username", help="Enter your GitHub username to fetch your stats")
token = st.sidebar.text_input("Enter your GitHub personal access token", help="Generate a personal access token in your GitHub settings and enter it here.", type="password")

repo_limit = st.slider("Number of repositories to fetch", 0, 50, 9, 3)

filters = {}

try:
    langs = get_most_used_languages(token, githubName)

    options = st.multiselect("Select the languages you want to filter by", langs, default=langs)

    if options:
        langs = options

    show_extra_filters = st.checkbox("Show extra filters")

    if show_extra_filters:

      st.subheader("Extra Filters")
      chosen_filters = st.multiselect("Select the filters you want to apply", ["Topics", "Minimum Stars", "Minimum Commits", "Minimum Issues", "Date", "Order By", "License"], default=["Topics", "Minimum Stars", "Minimum Commits", "Minimum Issues", "Date", "Order By", "License"])

      if "Topics" in chosen_filters:
        filters["topics"] = st.text_input("Enter topics to filter by", help="Enter topics separated by commas. For example: hacktoberfest2023, AI, Rust, etc")
      if "Minimum Stars" in chosen_filters:
        filters["min_stars"] = st.number_input("Minimum Stars", min_value=0)
      if "Minimum Commits" in chosen_filters:
        filters["min_commits"] = st.number_input("Minimum Commits", min_value=0)
      if "Minimum Issues" in chosen_filters:
        filters["min_issues"] = st.number_input("Minimum Issues", min_value=0)
      if "Date" in chosen_filters:
        filters["date"] = st.date_input("Date", help="Enter the date after which the repositories were created")
        filters["date_text"] = st.selectbox("Date of creation", ["Before", "After", "On"])
      if "Order By" in chosen_filters:
        filters["order_by"] = st.radio("Order By", ["Stars", "Forks", "Recent"])
      if "License" in chosen_filters:
        filters["project_license"] = st.selectbox("License", licenses)


except Exception as e:
    langs = []
    # st.error(e)
    print(e)
    st.error("Please enter your GitHub username and token in the sidebar.")

btn_fetch_repos = st.button("Show Repositories")
btn_fetch_issues = st.button("Show Good First Issues")

if btn_fetch_repos and langs:
    if githubName and token:
        get_opensource_projects(token, user=githubName, langs=langs, filters=filters, limit=(repo_limit))
    else:
        st.error("Please enter your GitHub username and token in the sidebar.")

if btn_fetch_issues and langs:
    if githubName and token:
        get_open_issues(token, langs=langs, limit=(repo_limit))
    else:
        st.error("Please enter your GitHub username and token in the sidebar.")

if not githubName or not token:
    st.sidebar.warning("Please enter your GitHub username and token in the sidebar.")
pages/opensource_projects.py
You-now-Who/Openmatch
import base64
from datetime import datetime, timedelta
import streamlit as st
import requests
from collections import Counter
import pandas as pd
import webbrowser
import json
import plotly.express as px


def fix_json_values(json_to_fix):
    for k, v in json_to_fix.items():
        if str(v) == "False":
            json_to_fix[k] = "No"
        if str(v) == "None":
            json_to_fix[k] = "Not Available"
        if str(v) == "True":
            json_to_fix[k] = "Yes"
    return json_to_fix


def get_most_used_languages(token, name, appendRender=True):
    api_end_point = "https://api.github.com/graphql"
    headers = {"Authorization": "Token " + token}
    query = """
    {
      user (login: "%s") {
        repositories (first: 100) {
          nodes {
            languages (first: 100) {
              nodes {
                name
              }
            }
          }
        }
      }
    }
    """ % name
    try:
        response = requests.post(api_end_point, json={"query": query}, headers=headers)
        response.raise_for_status()
        data = response.json()
        language_counts = Counter()
        for repo in data["data"]["user"]["repositories"]["nodes"]:
            for language in repo["languages"]["nodes"]:
                language_counts[language["name"]] += 1
        most_common_languages = language_counts.most_common(5)
        
        df_languages = pd.DataFrame(most_common_languages, columns=["Language", "Count"])

        if appendRender:
            st.subheader("Most Used Languages")
            st.bar_chart(df_languages.set_index("Language"))
        else:
            lang_list = []
            for lang in most_common_languages:
                lang_list.append(lang[0])
            return lang_list
    except Exception as e:
        st.error(f"Error occurred while fetching languages: {e}")


import requests
import plotly.express as px
import streamlit as st

def get_user_info(token, name):
    
    graphql_query = f'''
    query {{
        user(login: "{name}") {{
            name
            email
            publicRepos: repositories(isFork: false, privacy: PUBLIC) {{
                totalCount
            }}
            privateRepos: repositories(isFork: false, privacy: PRIVATE) {{
                totalCount
            }}
            contributionsCollection {{
                contributionCalendar {{
                    totalContributions
                    weeks {{
                        contributionDays {{
                            date
                            contributionCount
                        }}
                    }}
                }}
            }}
            issues {{
                totalCount
            }}
        }}
    }}
    '''

    headers = {
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json",
    }

    try:
        response = requests.post(
            "https://api.github.com/graphql",
            headers=headers,
            json={"query": graphql_query},
        )
        response.raise_for_status()
        data = response.json()

        user_data = data.get("data", {}).get("user", {})

        contribution_calendar = user_data.get("contributionsCollection", {}).get("contributionCalendar", {})
        total_contributions = contribution_calendar.get("totalContributions", 0)
        issue_count = user_data.get("issues", {}).get("totalCount", 0)

        public_repos_count = user_data.get('publicRepos', {}).get('totalCount', 0)
        private_repos_count = user_data.get('privateRepos', {}).get('totalCount', 0)

        fig_repos = px.pie(
            names=['Public Repositories', 'Private Repositories'],
            values=[public_repos_count, private_repos_count],
            title=f"Public vs. Private Repositories for {name}",
            color_discrete_sequence=px.colors.sequential.Blackbody_r,
        )

        weeks = contribution_calendar.get("weeks", [])
        contributions_by_year = {}

        for week in weeks:
            for day in week.get("contributionDays", []):
                date = day.get("date")
                contribution_count = day.get("contributionCount")
                year = date.split("-")[0]
                if year not in contributions_by_year:
                    contributions_by_year[year] = 0
                contributions_by_year[year] += contribution_count

        year_labels = list(contributions_by_year.keys())
        contribution_counts = list(contributions_by_year.values())

        fig_contributions = px.bar(
            x=year_labels,
            y=contribution_counts,
            labels={"x": "Year", "y": "Total Contributions"},
            title=f"Total Contributions by you, boss for your account!",
        )

        fig_issues = px.bar(
            x=["Total Issues"],
            y=[issue_count],
            labels={"x": "Metric", "y": "Total Issues"},
            title=f"Total Issues Made by {name}",
        )

        st.subheader("User Information")
        st.write(f"Developer Name: {user_data.get('name', 'N/A')}")
        st.write(f"Contact Email: {user_data.get('email', 'N/A')}")
        st.write(f"Number of Public Repositories: {public_repos_count}")
        st.write(f"Number of Private Repositories: {private_repos_count}")
        st.write(f"Total Contributions: {total_contributions}")
        st.write(f"Total Issues: {issue_count}")

        st.plotly_chart(fig_repos)
        st.plotly_chart(fig_contributions)
        st.plotly_chart(fig_issues)

    except Exception as e:
        st.error(f"Error occurred while fetching user information: {e}")


def fetch_custom_commit_history(selected_repo, name, token):
    base_url = "https://api.github.com/graphql"
    headers = {"Authorization": "Bearer " + token}

    query = """
    {
        repository(owner: "%s", name: "%s") {
            defaultBranchRef {
                target {
                    ... on Commit {
                        history {
                            totalCount
                            nodes {
                                oid
                                message
                                committedDate
                            }
                        }
                    }
                }
            }
        }
    }
    """ % (name, selected_repo)

    try:
        response = requests.post(base_url, json={"query": query}, headers=headers)
        response.raise_for_status()
        data = response.json()

        
        commit_nodes = data["data"]["repository"]["defaultBranchRef"]["target"]["history"]["nodes"]
        commit_data = {
            "OID": [commit["oid"] for commit in commit_nodes],
            "Message": [commit["message"] for commit in commit_nodes],
            "Date": [commit["committedDate"] for commit in commit_nodes],
            "Commit Count": list(range(1, len(commit_nodes) + 1))
        }

        return commit_data

    except Exception as e:
        print(e)
        st.error(f"bro, see error: {e}")
        return 


def fetch_commit_history(token, name, num_days):
    st.title("Your last commits (details)")

    base_url = "https://api.github.com/graphql"
    headers = {
        "Authorization": f"Bearer {token}",
        "Content-Type": "application/json"
    }

    query = """
    {
      user(login: "%s") {
        contributionsCollection(from: "%sT00:00:00Z", to: "%sT23:59:59Z") {
          contributionCalendar {
            totalContributions
            weeks {
              contributionDays {
                date
                contributionCount
              }
            }
          }
        }
      }
    }
    """ % (name, (datetime.now() - timedelta(days=num_days)).date(), datetime.now().date())

    try:
        response = requests.post(base_url, headers=headers, json={"query": query})
        response.raise_for_status()
        data = response.json()

        contributions = data["data"]["user"]["contributionsCollection"]["contributionCalendar"]["weeks"]
        commit_data = pd.DataFrame(
            [(datetime.strptime(day["date"], "%Y-%m-%d").date(), day["contributionCount"]) for week in contributions for day in week["contributionDays"]],
            columns=["Date", "Commits"]
        )

        st.subheader("Recent Commits")
        st.write(commit_data)

        st.subheader("Commit History Chart")
        st.line_chart(commit_data.set_index("Date")["Commits"])
    except Exception as e:
        st.error(f"Error occurred while fetching commit history: {e}")


def get_pull_requests(token, name):
    base_url = "https://api.github.com/graphql"
    headers = {"Authorization": "Bearer " + token}

    query = """
    {
        user(login: "%s") {
            contributionsCollection {
                pullRequestContributionsByRepository {
                    contributions {
                        totalCount
                    }
                    repository {
                        name
                    }
                }
            }
        }
    }
    """ % name

    try:
        response = requests.post(base_url, json={"query": query}, headers=headers)
        response.raise_for_status()
        data = response.json()
        contributions = data["data"]["user"]["contributionsCollection"]["pullRequestContributionsByRepository"]

        repository_names = [contribution["repository"]["name"] for contribution in contributions]
        pull_request_counts = [contribution["contributions"]["totalCount"] for contribution in contributions]

        df = pd.DataFrame({"Repository": repository_names, "Pull Requests": pull_request_counts})

        st.subheader("Pull Requests Over Time")
        fig = px.bar(df, x="Repository", y="Pull Requests", title="Pull Requests Over Time")
        st.plotly_chart(fig)

    except Exception as e:
        st.error(f"Error occurred while fetching pull request data: {e}")


def get_most_active_day(token, name):
    base_url = "https://api.github.com"
    api_end_point = f"{base_url}/users/{name}/events"
    headers = {"Authorization": "Token " + token}

    try:
        response = requests.get(api_end_point, headers=headers)
        response.raise_for_status()
        events = response.json()

        day_counter = Counter()
        for event in events:
            day = pd.Timestamp(event["created_at"]).day_name()
            day_counter[day] += 1

        most_active_days = day_counter.most_common()
        if most_active_days:
            st.subheader("Most Active Days")

            df_days = pd.DataFrame(most_active_days, columns=["Day", "Commits/Pushes"])

            st.line_chart(df_days.set_index("Day"))
        else:
            st.info("No commit/push activity found.")
    except Exception as e:
        st.error(f"Error occurred while fetching most active days: {e}")





st.set_page_config(
    page_title="GitHub Stats",
    page_icon="🎯",
    layout="wide",
    initial_sidebar_state="auto",
)


st.markdown("<h2 style='text-align: center; color: white;'>Let's get to know your GitHub stats!</h2><br><br>", unsafe_allow_html=True)

st.sidebar.subheader("GitHub Credentials")
githubName = st.sidebar.text_input("Enter your GitHub username", help="Enter your GitHub username to fetch your stats")
token = st.sidebar.text_input("Enter your GitHub personal access token", help="Generate a personal access token in your GitHub settings and enter it here.", type="password")
num_days = st.sidebar.slider("Select the number of days for commit history", 1, 365, 125)
st.title("GitHub Repository Stats")

base_url = "https://api.github.com/graphql"
headers = {"Authorization": "Bearer " + token}

query = """
{
    user(login: "%s") {
        repositories(first: 100) {
            nodes {
                name
            }
        }
    }
}
""" % githubName

try:
    response = requests.post(base_url, json={"query": query}, headers=headers)
    response.raise_for_status()
    data = response.json()
    
    repo_nodes = data["data"]["user"]["repositories"]["nodes"]
    repo_names = [repo["name"] for repo in repo_nodes]

    selected_repo = st.sidebar.selectbox('Please choose a repository', options=repo_names, key='project_stats_selectbox')

    

except Exception as e:
    st.error(f"Error occurred while fetching repositories: {e}")
    

btn = st.button("Get your token from github developer settings 😎(opens in a new tab)")
st.markdown("<p>Click on the new token button, generate a new token with all the permissions for the repo granted, and copy and paste it here, PLEASE!!</p>", unsafe_allow_html=True)

if btn:
    url_feedback = "https://github.com/settings/tokens?type=beta"
    webbrowser.open(url_feedback)

st.markdown("<br>", unsafe_allow_html=True)

col1, col2, col3, col4 = st.columns(4)


def get_csv_download_link(df):
    csv = df.to_csv(index=False)
    b64 = base64.b64encode(csv.encode()).decode()
    href = f'<a href="data:file/csv;base64,{b64}" download="commit_history.csv">Download CSV</a>'
    return href
    
def show_commit_history(selected_repo, name, token):
    if selected_repo:
        st.subheader(f"Stats are here, boss for : {selected_repo}")

        commit_data = fetch_custom_commit_history(selected_repo, name, token)
        if commit_data is not None:
            st.subheader(f'Commit History for {selected_repo}')

            
            commit_df = pd.DataFrame(commit_data)
            st.write(commit_df)

            
            fig = px.line(commit_df, x="Date", y="Commit Count", title="Commit History")
            st.plotly_chart(fig)

            
            st.markdown(get_csv_download_link(commit_df), unsafe_allow_html=True)

if col1.button("Show My Stats"):
    if githubName and token:
        get_user_info(token, githubName)
        get_most_used_languages(token, githubName)
    else:
        st.error("Please enter your GitHub username and token in the sidebar.")

if col2.button("Show Recent Commits"):
    if githubName and token:
        fetch_commit_history(token, githubName, num_days)
    else:
        st.error("Please enter your GitHub username and token in the sidebar.")

if col3.button("Show Additional Stats"):
    if githubName and token:
        get_pull_requests(token, githubName)
        get_most_active_day(token, githubName)
    else:
        st.error("Please enter your GitHub username and token in the sidebar.")

if col4.button("Show My Project Stats"):
    if githubName and token:
        
        show_commit_history(selected_repo, githubName, token)
    else:
        st.error("Please enter your GitHub username and token in the sidebar.")




pages/show_stats_page.py
You-now-Who/Openmatch