I created an equivalent project for people who wanted to create the same style of badges from Python (or from the command line): https://github.com/google/pybadges
Python example:
from pybadges import badge
s = badge(left_text='coverage',
right_text='23%',
right_color='red')
# s is a string that contains the badge data as an svg image.
print(s[:40]) # => <svg height="20" width="191.0" xmlns="ht
Python example:
Command line example: But there are lots more formatting options documented on the project page.