Team Ai
Apppublic

afaqAhmadK/GithubRepo-Analyzer

sourceHugging Faceupdated 1y agoView on Hugging Face
1likes
App README

GitHub Repository Analyzer ๐Ÿ“Š

This project delves into any public GitHub repository to assess the health status of open-source projects. Specifically, it explores the following key areas:

  1. 1.Commit History ๐Ÿ•ฐ๏ธ
  2. 2.Most Active Users ๐Ÿง‘โ€๐Ÿ’ป

This project is additionally maintained on GitHub. Please note that both versions are maintained separately.

๐Ÿš€ How it Works

The analyzer collects data from two essential open-source GitHub API endpoints:

  • โ€”Contributors: https://api.github.com/repos/facebook/react/contributors
  • โ€”Commits: https://api.github.com/repos/facebook/react/commits

This collected JSON information is then consolidated and presented in various useful formats:

  1. 1.Streamlit Deployed App ๐ŸŒ: Access the live application here. (Please note: The link may occasionally be down. Feel free to email if you'd like it to be reactivated.)
  2. 2.Generated PDF Report ๐Ÿ“„
  3. 3.Supportive Visualizations (Images) ๐Ÿ–ผ๏ธ

Additional Notes:

  • โ€”When running the script locally via argparse, the PDF report and supporting images will be saved to your local machine.
  • โ€”When utilizing the Streamlit application, the PDF will only be saved upon clicking the 'Generate PDF' button.
  • โ€”All generated figures will be displayed directly within the Streamlit interface.

๐Ÿ“ File Structure & Explanation

Here's a breakdown of the project's key files:

  • โ€”main.py: ๐Ÿงฉ The central file that orchestrates different parts of the program.

Files located in the scripts/ directory:

  • โ€”app.py: ๐Ÿ“ฑ Contains the core Streamlit application logic.
  • โ€”contributors.py: ๐Ÿ“Š Gathers information about repository contributors, including:
  • โ€”Top and lowest contributors.
  • โ€”Respective bar-plot visualizations of their contributions.
  • โ€”commits.py: ๐Ÿ“œ Collects data regarding the repository's commit history, offering:
  • โ€”Prints authors by greatest commit count & timeline.
  • โ€”Enables in-line (CMD) visualization using Python's tabulate module.
  • โ€”Produces insightful visualizations such as:
  • โ€”Commits per day ๐Ÿ“…
  • โ€”Commits per day per user ๐Ÿ‘จโ€๐Ÿ’ป
  • โ€”Commit word cloud โ˜๏ธ
  • โ€”variables.py: โš™๏ธ Houses all global variables and their accompanying documentation.

๐Ÿš€ Getting Started: How to Run

You have several options to run this project:

  1. 1.Local Streamlit App ๐Ÿ–ฅ๏ธ:
  2. 2.First, fork the repository to your local machine.
  3. 3.Ensure you have Streamlit installed (pip install streamlit).
  4. 4.Run the application using: streamlit run app.py
  1. 1.Streamlit Community Cloud Deployment โ˜๏ธ:
  2. 2.Easily deploy the app using the Streamlit Community Cloud platform.
  1. 1.Command-Line Interface (CLI) with Argparse ๐Ÿ‘จโ€ terminals:
  2. 2.For help and available arguments, run: python main.py -h
  3. 3.You can specify the repository in two ways:
  4. 4.python main.py --repo facebook/react
  5. 5.python main.py --repo https://github.com/facebook/react
  6. 6.Both commands will work seamlessly.
  1. 1.Hugging Face Spaces Deployment โœจ:
  2. 2.The app is also deployed here. Feel free to check it out!

โœจ Sample Output

To see an example of the output when the script is run through the command line, please refer to the facebook/react directory within the repository.

Branch Details

  1. 1.main: main
  2. 2.hf-display: branch used to diagnose any display config problem on hugging face space interface

๐Ÿ’ก Possible Future Updates

We're always looking to improve! Here are some potential enhancements:

  1. 1.Docker Deployment ๐Ÿณ
  2. 2.Deployment on Additional Free-Hosted Cloud Services (Already Added! Check out this commit for the Hugging Face Spaces deployment) โœ…
  3. 3.Integration of More API Endpoints ๐Ÿ”—