Cross-platform CLI tool to generate your Github profile's stats and summary.

Overview

ghs

Cross-platform CLI tool to generate your Github profile's stats and summary.

MIT License prs welcome platforms

Preview

Hop on to examples for other usecases.


Jump to:

Installation

Using pip

The stable version of this package is maintained on pypi, install using pip:

pip install ghs

Using source code

This can be useful when you want to do a code contribution to this project. You can test and verify your local changes before submitting a Pull Request.

  1. Clone the repository
git clone https://github.com/interviewstreet/ghs.git
  1. Navigate to the project root and create a virtual environment
python -m venv venv
  1. Activate the virtual environment
    • For macOS and linux, run source venv/bin/activate
    • For windows, run .\venv\Scripts\activate
  2. Install the cli by running the following command while you are in the project root
pip install .

Note: You need to reinstall by running the pip command if you want the cli to pick up your code changes.

Docker

docker build -t ghs:latest .
docker run -it ghs ghs --help

Github PAT

Generate a Github personal access token (https://github.com/settings/tokens) and use the ghs -t command to save it in the config file. This will be used to make the API requests to Github. A happy side-effect of this is that your private contributions are also considered while generating the stats and the summary of your username.

Please make sure that you give the following scopes to the token:

  • repo
  • read:user
  • read:packages

PS: Your Github PAT is not compromised by ghs. Please read the Privacy Notice to know more.

Usage

ghs [options]
Option Description
-v --version Print the cli version
-t --token-update Prompts the user for github PAT and saves it in the config file
-u <username> Print the general stats for the provided username
-s --summary Print the summary of the user. The username should be provided using the -u flag.
-c --copy-to-clipboard Copy the output to clipboard. Can be used with -u or -s.
-h --help Show the help message of the cli

Examples

ghs -u <username>

Prints the general Github stats for the given username.

copy to clipboard

Provide the -c flag to copy the output to your clipboard.

Other options for summary

In addition to getting the Github summary from the beginning, you can also get the summary of the last 12 months or you can provide your own custom duration.

Installation hiccups on windows

Could not install package due to Environment Error

It can be solved by scoping the installation. Add the flag --user to the pip command (pip install --user ghs).

Alternatively, you can install the tool inside a virtual environment

ghs command not found even after installing

Most likely the place where the command is installed is not in the system PATH. On windows, there are a few places where the packages might be installed. After confirming the location, add that directory to the PATH.

How to contribute?

Please see Contributing guidelines for more information.

Changelog

You can checkout Releases for the changelog.

Privacy Notice

ghs does not collect any data.

  • It has no home server. The Github PAT is stored locally in your machine.
  • It doesn't embed any kind of analytic hooks in its code.

The only time ghs connects to a remote server is when you want to generate the stats and summary of your github profile. The cli uses the Github GraphQL and Github Rest APIs to do so. The data collected via the APIs is not sent anywhere. It's displayed in your terminal or copied to your clipboard (only if you explicitly tell the tool to do so by providing the -c or --copy-to-clipboard flag).

License

MIT © HackerRank

Comments
  • bug: change in scope in github pat

    bug: change in scope in github pat

    Screenshot from 2022-04-06 16-37-58 The program asks for read:user , repo and read:packages scope for github pat. But GitHub has changed the structure of scopes. There is no read:user and read:packages scope. Github scopes (new) : https://docs.github.com/en/developers/apps/building-oauth-apps/scopes-for-oauth-app

    invalid 
    opened by jaiakash 3
  • Error: Query failed with status code: 401

    Error: Query failed with status code: 401

    I'm using this in Ubuntu 20.04 I've installed ghs using pip install ghs command and it's showing this error. I also tried using the source code and still shows the same error. I used this last month and it worked fine, maybe it's because of the Github Personal Access Token expired or something else. Is there a way to forget the user so it asks for new Access Token (It didn't ask for it this time)

    Screenshot from 2022-05-02 20-59-30

    opened by abhijhacodes 2
  • There is no options to fill the Required scopes

    There is no options to fill the Required scopes

    Hi

    ghs -t 
    
    
    Creating config file
    please enter your github pat: [ghp_xxxxxxxxxxxxxxxxxxxx]
    Error: The token does not have valid scopes.
     Required scopes: ['read:user', 'repo', 'read:packages'].
     Provided token scopes: ['repo']
    
    

    I have granted the permission to the repo, however, on the GitHub setting page, there is not an option to make a read, how can I set this?

    A suggestion is that, may you delete the judgment of read:* or make this optional

    opened by jianwang-ntu 2
  • `ghs` not working

    `ghs` not working

    Running ghs -u ratika-12 throws:

    Error: Query failed with status code: 401
    Traceback: 
      File "/Users/ratikaswami/ghs/venv/lib/python3.8/site-packages/ghs/ghs.py", line 293, in main_proxy
        main()
      File "/Users/ratikaswami/ghs/venv/lib/python3.8/site-packages/ghs/ghs.py", line 267, in main
        verify_github_username(args.username)
      File "/Users/ratikaswami/ghs/venv/lib/python3.8/site-packages/ghs/ghs.py", line 33, in verify_github_username
        if fetch_user_id(username) is None:
      File "/Users/ratikaswami/ghs/venv/lib/python3.8/site-packages/ghs/fetchers.py", line 129, in fetch_user_id
        raise Exception(f"Query failed with status code: {request.status_code}")
    
    opened by ratika-12 2
  • Bug: Unable to update token

    Bug: Unable to update token

    Hi, earlier I used the cli to generate the summary. Today I updated my token and tried to refresh/insert the new token but seems like the cli isn't accepting it. As a result the summary isn't generated backstage_bug

    Also is the token stored as a variable ? I don't see any .env file here even to manually update my token :thinking:

    bug 
    opened by ron-debajyoti 2
  • add: download badges in readme

    add: download badges in readme

    I have added download per month badge. But there is no "total download" badge available. See https://github.com/badges/shields/issues/4319

    Issue #2

    opened by jaiakash 2
  • Error: __enter__- Checking if the token is valid

    Error: __enter__- Checking if the token is valid

    Hey , whenever I try to enter my PAT key I always run into this error , I have ticked all required scopes while generating key and also added C:\Users\mahim\Appdata\Local\Programs\Python\Python39\lib\site-packages to the PATH image

    opened by mahimdashora 1
  • Create Desktop Assistant

    Create Desktop Assistant

    This is a code for a desktop assistant which will perform tasks like writing emails for you and extracting data from the net and opening and closing various apps in your pc.

    invalid 
    opened by manvendra542001 1
  • Documentation error for Windows

    Documentation error for Windows

    The admin, Your documentation for Windows Users for activating the virtual environment contains an error that doesn't allow the user to run this

    Step 3 . Activate the virtual environment

    For windows, run .\venv\Scripts\activate // error

    It should be source venv/Scripts/activate for Windows user Allow me to change it in your documentation so that next time no one faces the issue that I faced today.

    opened by iamakhileshmishra 0
  • Add CodeQL workflow for GitHub code scanning

    Add CodeQL workflow for GitHub code scanning

    Hi interviewstreet/ghs!

    This is a one-off automatically generated pull request from LGTM.com :robot:. You might have heard that we’ve integrated LGTM’s underlying CodeQL analysis engine natively into GitHub. The result is GitHub code scanning!

    With LGTM fully integrated into code scanning, we are focused on improving CodeQL within the native GitHub code scanning experience. In order to take advantage of current and future improvements to our analysis capabilities, we suggest you enable code scanning on your repository. Please take a look at our blog post for more information.

    This pull request enables code scanning by adding an auto-generated codeql.yml workflow file for GitHub Actions to your repository — take a look! We tested it before opening this pull request, so all should be working :heavy_check_mark:. In fact, you might already have seen some alerts appear on this pull request!

    Where needed and if possible, we’ve adjusted the configuration to the needs of your particular repository. But of course, you should feel free to tweak it further! Check this page for detailed documentation.

    Questions? Check out the FAQ below!

    FAQ

    Click here to expand the FAQ section

    How often will the code scanning analysis run?

    By default, code scanning will trigger a scan with the CodeQL engine on the following events:

    • On every pull request — to flag up potential security problems for you to investigate before merging a PR.
    • On every push to your default branch and other protected branches — this keeps the analysis results on your repository’s Security tab up to date.
    • Once a week at a fixed time — to make sure you benefit from the latest updated security analysis even when no code was committed or PRs were opened.

    What will this cost?

    Nothing! The CodeQL engine will run inside GitHub Actions, making use of your unlimited free compute minutes for public repositories.

    What types of problems does CodeQL find?

    The CodeQL engine that powers GitHub code scanning is the exact same engine that powers LGTM.com. The exact set of rules has been tweaked slightly, but you should see almost exactly the same types of alerts as you were used to on LGTM.com: we’ve enabled the security-and-quality query suite for you.

    How do I upgrade my CodeQL engine?

    No need! New versions of the CodeQL analysis are constantly deployed on GitHub.com; your repository will automatically benefit from the most recently released version.

    The analysis doesn’t seem to be working

    If you get an error in GitHub Actions that indicates that CodeQL wasn’t able to analyze your code, please follow the instructions here to debug the analysis.

    How do I disable LGTM.com?

    If you have LGTM’s automatic pull request analysis enabled, then you can follow these steps to disable the LGTM pull request analysis. You don’t actually need to remove your repository from LGTM.com; it will automatically be removed in the next few months as part of the deprecation of LGTM.com (more info here).

    Which source code hosting platforms does code scanning support?

    GitHub code scanning is deeply integrated within GitHub itself. If you’d like to scan source code that is hosted elsewhere, we suggest that you create a mirror of that code on GitHub.

    How do I know this PR is legitimate?

    This PR is filed by the official LGTM.com GitHub App, in line with the deprecation timeline that was announced on the official GitHub Blog. The proposed GitHub Action workflow uses the official open source GitHub CodeQL Action. If you have any other questions or concerns, please join the discussion here in the official GitHub community!

    I have another question / how do I get in touch?

    Please join the discussion here to ask further questions and send us suggestions!

    opened by lgtm-com[bot] 0
  • Feature Request: Associate roles with each duration for better context of summary

    Feature Request: Associate roles with each duration for better context of summary

    For the --summary tag, we provide 3 options. The 3rd option is to provide custom durations for which the summary needs to be generated. We can compliment this feature by also taking the roles associated with each duration as input.

    This would provide better context to the summary. For eg: it's expected that when you move to a leadership role in engineering, you tend to do more code reviews.

    enhancement 
    opened by makkoncept 0
Releases(v0.1.4)
Owner
HackerRank
Match Every Developer to the Right Job.
HackerRank
An unofficial styleguide and best practices summary for PyTorch

A PyTorch Tools, best practices & Styleguide This is not an official style guide for PyTorch. This document summarizes best practices from more than a

IgorSusmelj 1.5k Jan 5, 2023
Codebase for the Summary Loop paper at ACL2020

Summary Loop This repository contains the code for ACL2020 paper: The Summary Loop: Learning to Write Abstractive Summaries Without Examples. Training

Canny Lab @ The University of California, Berkeley 44 Nov 4, 2022
Fake-user-agent-traffic-geneator - Python CLI Tool to generate fake traffic against URLs with configurable user-agents

Fake traffic generator for Gartner Demo Generate fake traffic to URLs with custo

New Relic Experimental 3 Oct 31, 2022
Object tracking and object detection is applied to track golf puts in real time and display stats/games.

Putting_Game Object tracking and object detection is applied to track golf puts in real time and display stats/games. Works best with the Perfect Prac

Max 1 Dec 29, 2021
CVPR 2021 Official Pytorch Code for UC2: Universal Cross-lingual Cross-modal Vision-and-Language Pre-training

UC2 UC2: Universal Cross-lingual Cross-modal Vision-and-Language Pre-training Mingyang Zhou, Luowei Zhou, Shuohang Wang, Yu Cheng, Linjie Li, Zhou Yu,

Mingyang Zhou 28 Dec 30, 2022
Cross Quality LFW: A database for Analyzing Cross-Resolution Image Face Recognition in Unconstrained Environments

Cross-Quality Labeled Faces in the Wild (XQLFW) Here, we release the database, evaluation protocol and code for the following paper: Cross Quality LFW

Martin Knoche 10 Dec 12, 2022
git git《Transformer Meets Tracker: Exploiting Temporal Context for Robust Visual Tracking》(CVPR 2021) GitHub:git2] 《Masksembles for Uncertainty Estimation》(CVPR 2021) GitHub:git3]

Transformer Meets Tracker: Exploiting Temporal Context for Robust Visual Tracking Ning Wang, Wengang Zhou, Jie Wang, and Houqiang Li Accepted by CVPR

NingWang 236 Dec 22, 2022
Lacmus is a cross-platform application that helps to find people who are lost in the forest using computer vision and neural networks.

lacmus The program for searching through photos from the air of lost people in the forest using Retina Net neural nwtwork. The project is being develo

Lacmus Foundation 168 Dec 27, 2022
High performance Cross-platform Inference-engine, you could run Anakin on x86-cpu,arm, nv-gpu, amd-gpu,bitmain and cambricon devices.

Anakin2.0 Welcome to the Anakin GitHub. Anakin is a cross-platform, high-performance inference engine, which is originally developed by Baidu engineer

null 514 Dec 28, 2022
ONNX Runtime: cross-platform, high performance ML inferencing and training accelerator

ONNX Runtime is a cross-platform inference and training machine-learning accelerator. ONNX Runtime inference can enable faster customer experiences an

Microsoft 8k Jan 4, 2023
Cross-platform-profile-pic-changer - Script to change profile pictures across multiple platforms

cross-platform-profile-pic-changer script to change profile pictures across mult

null 4 Jan 17, 2022
[CVPR'21] Projecting Your View Attentively: Monocular Road Scene Layout Estimation via Cross-view Transformation

Projecting Your View Attentively: Monocular Road Scene Layout Estimation via Cross-view Transformation Weixiang Yang, Qi Li, Wenxi Liu, Yuanlong Yu, Y

null 118 Dec 26, 2022
A embed able annotation tool for end to end cross document co-reference

CoRefi CoRefi is an emebedable web component and stand alone suite for exaughstive Within Document and Cross Document Coreference Anntoation. For a de

PythicCoder 39 Dec 12, 2022
Camview - A CLI-tool used to stream CCTV online footage based on URL params

CamView A CLI-tool used to stream CCTV online footage based on URL params Get St

Finn Lancaster 54 Dec 9, 2022
ObjectDrawer-ToolBox: a graphical image annotation tool to generate ground plane masks for a 3D object reconstruction system

ObjectDrawer-ToolBox is a graphical image annotation tool to generate ground plane masks for a 3D object reconstruction system, Object Drawer.

null 77 Jan 5, 2023
Milano is a tool for automating hyper-parameters search for your models on a backend of your choice.

Milano (This is a research project, not an official NVIDIA product.) Documentation https://nvidia.github.io/Milano Milano (Machine learning autotuner

NVIDIA Corporation 147 Dec 17, 2022
High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.

What is xLearn? xLearn is a high performance, easy-to-use, and scalable machine learning package that contains linear model (LR), factorization machin

Chao Ma 3k Jan 3, 2023
High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.

What is xLearn? xLearn is a high performance, easy-to-use, and scalable machine learning package that contains linear model (LR), factorization machin

Chao Ma 2.8k Feb 12, 2021