badge image class
Project description
Install
$ [sudo] pip install badges
Features
- md, rst support
- autoformat strings with instance and class variables
- minimalistic design, easy subclassing
- CircleCI, Travis, ... badge classes
Examples
# format attributes - {attrname}
>>> class CustomBadge(badges.Badge):
branch = "master"
link = "https://site.com/{fullname}"
image = "https://site.com/{fullname}?branch={branch}.svg"
>>> CustomBadge(fullname="owner/repo")
'[![](https://site.com/owner/repo?branch=master.svg)](https://site.com/owner/repo)'
# format @property - {0.propname}
>>> class CustomBadge(badges.Badge):
branch = "master"
link = "https://site.com/{0.fullname}"
image = "https://site.com/{0.fullname}?branch={branch}.svg"
@property
def fullname(self):
return "/".join(os.getcwd().split("/")[-2:])
>>> CustomBadge()
'[![](https://site.com/owner/repo?branch=master.svg)](https://site.com/owner/repo)'
Sources
badges/badge.Badge
badges/bettercodehub.Bettercodehub(GitBadge)
badges/circleci.Circleci(GitBadge)
badges/codeclimate.Codeclimate(GitBadge)
badges/codecov.Codecov(GitBadge)
badges/codefactor.Codefactor(GitBadge)
badges/gitbadge.GitBadge(Badge)
badges/scrutinizer.Scrutinizer(GitBadge)
badges/semaphoreci.Semaphoreci(GitBadge)
badges/sonarcloud.Sonarcloud(Badge)
badges/travis.Travis(GitBadge)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
badges-0.0.1.tar.gz
(3.3 kB
view details)
File details
Details for the file badges-0.0.1.tar.gz
.
File metadata
- Download URL: badges-0.0.1.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bb8f830525ffa07b074b3c502cab4278398d4bb8b267be447a1d64a62e9f09a5 |
|
MD5 | 01674cd9ef7a603d57a1d198ee497bcc |
|
BLAKE2b-256 | 0514ce6d8c4a69ae54979e3e37ab0573f3242ebf1770785321648e88f4711e83 |