Skip to content

10xac/GitHub_Analyzer_API

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

GitHub API Task

Navigation

Introduction

This project creates a backend API using GitHub API as the source with endpoints for retrieving GitHub account users details and repositories associated with given username. The following information is returned by user and repo metadata endpoints respectively:

  • Profile
    • name
    • email
    • bio
    • total number of repos
    • number of followers
    • numbers following

  • Metadata per repo
    • Repo name
    • Clones
    • Forks
    • Contributors
    • Visitors
    • Number of Branches
    • Top 3 languages used in the repo (percentage showing their contribution)

Directory Structure

Modules

This directory has created modules and functions which are used for the routing. It has controller.py which is a python scripts which has self-written functions serve as a soure of imports for use in other section in the future when the need be.

Images

This directory has the images for the project. It has the images which demonstrates the usage of the API.

Tests

This directory has the tests for the modules (Yet to be built)

Setup

You should create a GitHub Token associated with the username to be used. The link here will guide you through the process: create GitHub Personal Acess Token

Create a python virtual environment with python 3.8, activate the environment and install the requirements. Then run the app.py to run the API Server.

pip install -r requirements.txt
python app.py

Endpoints

User

User_Demo

Request in the format host:port/user/{username}/{token}:

host:port/user/mdahwireng/XXXXXXXXXXXXXXXX

Response:

{
  "bio": null, 
  "email": "kaaymike@hotmail.co.uk", 
  "followers": 4, 
  "following": 3, 
  "name": "M. D. Ahwireng", 
  "repos": {
    "owned_private_repos": 6, 
    "public_repos": 29, 
    "total_private_repos": 6
  }
}

Repo_metadata

Repo_metadata_Demo

Request in the format host:port/repos_meta/{username}/{token}:

host:port/user/mdahwireng/XXXXXXXXXXXXXXXX

Response:

{
  "10academy_week2": {
    "branches": 2, 
    "branches_url": "https://api.github.com/repos/mdahwireng/10academy_week2/branches{/branch}", 
    "clones": {
      "count": 0, 
      "uniques": 0
    }, 
    "contributors": [
      "mdahwireng"
    ], 
    "contributors_url": "https://api.github.com/repos/mdahwireng/10academy_week2/contributors", 
    "forks": 0, 
    "languages": [
      [
        "Jupyter Notebook", 
        100.0
      ]
    ], 
    "languages_url": "https://api.github.com/repos/mdahwireng/10academy_week2/languages", 
    "total_commits": 4, 
    "visitors": {
      "count": 0, 
      "uniques": 0
    }
  }, 
  "2021-Better-Working-World-Data-Challenge": {
    "branches": 2, 
    "branches_url": "https://api.github.com/repos/mdahwireng/2021-Better-Working-World-Data-Challenge/branches{/branch}", 
    "clones": {
      "count": 0, 
      "uniques": 0
    }, 
    "contributors": [
      "patrickmuston1", 
      "codeindulgence", 
      "alexgleith", 
      "GypsyBojangles", 
      "jlkerches"
    ], 
    "contributors_url": "https://api.github.com/repos/mdahwireng/2021-Better-Working-World-Data-Challenge/contributors", 
    "forks": 0, 
    "languages": [
      [
        "Jupyter Notebook", 
        99.25
      ], 
      [
        "Python", 
        0.72
      ], 
      [
        "Shell", 
        0.02
      ]
    ], 
    "languages_url": "https://api.github.com/repos/mdahwireng/2021-Better-Working-World-Data-Challenge/languages", 
    "total_commits": 39, 
    "visitors": {
      "count": 1, 
      "uniques": 1
    }
  }, ...
}

Yet to be implemented endpoints

As this is a work in progress, there are endpoints yet to be added examples are:

  • Endpoint for repository code analysis
  • Endpoints for code analysis pertaining to specific languages like Python and JavaScript

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Jupyter Notebook 63.1%
  • Python 36.3%
  • Shell 0.6%