Skip to main content

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

Metadata

Release files for badges 0.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for badges 0.0.1
File Size Uploaded
badges-0.0.1.tar.gz 3.3 kB Details

Release files / badges-0.0.1.tar.gz

Download URL badges-0.0.1.tar.gz
Size 3.3 kB
Tags Source
SHA-256 checksum
How to use checksums
bb8f830525ffa07b074b3c502cab4278398d4bb8b267be447a1d64a62e9f09a5
BLAKE2b-256 checksum
How to use checksums
0514ce6d8c4a69ae54979e3e37ab0573f3242ebf1770785321648e88f4711e83
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.0.1 This release

1 release file

0.0.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page