Skip to content

Instantly share code, notes, and snippets.

@pj8912
Last active January 31, 2023 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pj8912/1f05e554389a91199fa07d3bf980f2b2 to your computer and use it in GitHub Desktop.
Save pj8912/1f05e554389a91199fa07d3bf980f2b2 to your computer and use it in GitHub Desktop.
building static badge url to use in documentation using python
#getting static url for badge using shields.io
#build string
#eg: https://shields.io/static/v1?label=flask&message=2.2.2&color=green
#inputs: label , message, color
print('Create shields.io static label\n')
label = input("Label: ")
message = input("Message: ")
colors = ['brightgreen','green','yellowgreen','yellow','orange','red','blue','lightgrey',
'success','important','critical', 'informational', 'inactive', 'blueviolet', 'ff69b4', '9cf']
print('Select color: \n')
for i in range(0, len(colors)):
print(i, '=>', colors[i])
color = input("Your Color: ")
color = colors[int(color)]
build_url = f"https://shields.io/static/v1?label={label}&message={message}&color={color}"
print('Your static badge url: ', build_url)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment