Skip to content

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

License

Notifications You must be signed in to change notification settings

apmechev/github_clones_badge

Repository files navigation

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

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages