Package: ghs
ghsCross-platform CLI tool to generate your Github profile's stats and summary.PreviewHop on toexamplesfor other usecases.Jump to:InstallationUsing pipUsing source codeDockerGithub PATUsageExamplesInstallation Hiccups on WindowsEnvironment errorghs command not foundHow to contribute?Steps for pushing a new updateChangelogPrivacy NoticeLicenseInstallationUsing pipThe stable version of this package is maintained on pypi, install using pip:pipinstallghsUsing source codeThis 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.Clone the repositorygitclonehttps://github.com/interviewstreet/ghs.gitNavigate to the project root and create a virtual environmentpython-mvenvvenvActivate the virtual environmentFor macOS and linux, runsource venv/bin/activateFor windows, run.\venv\Scripts\activateInstall the cli by running the following command while you are in the project rootpipinstall.Note: You need to reinstall by running the pip command if you want the cli to pick up your code changes.Dockerdockerbuild-tghs:latest.
dockerrun-itghsghs--helpGithub PATGenerate a Github personal access token (https://github.com/settings/tokens) and use theghs -tcommand 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:reporead:userread:packagesPS: Your Github PAT is not compromised by ghs. Please read thePrivacy Noticeto know more.Usageghs[options]OptionDescription-v--versionPrint the cli version-t--token-updatePrompts the user for github PAT and saves it in the config file-u <username>Print the general stats for the provided username-s--summaryPrint the summary of the user. The username should be provided using the-uflag.-c--copy-to-clipboardCopy the output to clipboard. Can be used with-uor-s.-h--helpShow the help message of the cliExamplesghs -u <username>Prints the general Github stats for the given username.copy to clipboardProvide the-cflag to copy the output to your clipboard.Other options for summaryIn 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 windowsCould not install package due to Environment ErrorIt can be solved by scoping the installation. Add the flag--userto the pip command (pip install --user ghs).Alternatively, you can install the tool inside a virtual environmentghs command not found even after installingMost likely the place where the command is installed is not in the systemPATH. On windows, there area few placeswhere the packages might be installed. After confirming the location,add that directoryto the PATH.How to contribute?Please seeContributing guidelinesfor more information.Steps for pushing a new updateBump the version inghs/__init__.py(we follow semantic versioning).Create an annotated tag for this commit with the version namegit tag -a v1.2.3 -m "v1.2.3". You can use this to publish a new release on the project's github page and the same can be used for maintaining the changelog.Make sure you havetwineandbuildinstalled.pip install build twineBuild the packagepython -m buildThis will create a source archive and a wheel inside thedistfolder. You can inspect them to make sure that they contain the correct files.Run twine sanity on the build filestwine check dist/*First push the package onTestPyPiso that you can test the updates without affecting the real PyPI indextwine upload -r testpypi dist/*Get the credentials for hackerrank dev PyPI account from karthik.Twine will list the package url on TestPyPI. You can test and confirm your changes by installing the package.Finally, run the following command to upload the package to PyPItwine upload dist/*Get the credentials for hackerrank PyPI account from karthik.Treat yourself with a scoop of tender coconut.ChangelogYou can checkoutReleasesfor the changelog.Privacy Noticeghs 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 theGithub GraphQLandGithub RestAPIs 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-cor--copy-to-clipboardflag).LicenseMIT© HackerRank