/github_clones_badge

Script to auto-create a badge of number of clones for your github repositories

Primary LanguagePythonGNU General Public License v3.0GPL-3.0

alt text PyPI version Build Status

github_clones_badge

Script to auto-create a badge of number of clones for your github repositories. Since GitHub's API only tracks the past 2 weeks of traffic, this tool saves all clone statistics into a dictionary and sums total number of clones starting 14 days before first run.

Installing:

pip install github_clones_badge

Running for one repo (That you own), once:

>>> from github_clones_badge import get_github_clones as ghc
>>> help(ghc)

>>> bc=ghc.badge_creator(repo='GRID_LRT')
7 Number of new entries
>>> bc.download_badge('/var/www/example.com/public_html/where_you_store_your_badges/') 
# These have to be stored on your server of course

Running for a repo that you are a collaborator of but don't own, once

In this case, the repouser's name is appended to the beginning of the badge name. This means one reponame for multiple users can be 'tracked'.

>>> from github_clones_badge import get_github_clones as ghc
>>> help(ghc)

>>> bc=ghc.badge_creator(repo='DDFacet', repouser='cyriltasse')
7 Number of new entries
>>> bc.download_badge('/var/www/example.com/public_html/where_you_store_your_badges/')
# These have to be stored on your server of course