Skip to main content

pybuilder-anybadge

GitHub Workflow Status PyPI version python

A pybuilder plugin that generates badges for your project. The plugin will generate badges using shields.io. However it can also create badges using anybadge if configured to do so.

To add this plugin into your pybuilder project, add the following line near the top of your build.py:

use_plugin('pypi:pybuilder_anybadge')

NOTE if you are using Pybuilder version v0.11.x, then specify the following version of the plugin:

use_plugin('pypi:pybuilder_anybadge', '~=0.1.6')

Pybuilder anybadge properties

The pybuilder task pyb anybadge will use anybadge to generate badges for your project by processing reports produced from various plugins; the badges that are currently supported are:

  • complexity - requires the pybuilder_radon plugin. Generate badge using cyclomatic complexity score of your most complicated function.
  • vulnerabilities - requires the pybuilder_bandit plugin. Generate badge using number of security vulnerabilities discovered by vulnerabilities.
  • coverage - requires the coverage plugin. Generate badge for overall unit test coverage.
  • python - Generate badge for version of Python being used

The plugin will write the respective badges to the docs/images folder. The following plugin properties are available to further configure badge generation.

Name Type Default Value Description
anybadge_exclude str '' Comma delimited string of badges to exclude from processing, valid values are 'complexity', 'vulnerabilities', 'coverage' and 'python'
anybadge_complexity_use_average bool False Use overall average complexity as score when generating complexity badge
anybadge_use_shields bool True Will use img.shields.io to create the badges, if False will use anybadge

Note the plugin will add the badge references but you must commit/push the changes (including svg files in the docs/images folder)

The plugin properties are set using project.set_property, the following is an example of how to set the properties:

project.set_property('anybadge_exclude', 'vulnerabilities,coverage')
project.set_property('anybadge_complexity_use_average', True)
project.set_property('anybadge_use_shields', True)

By default the plugin will use shields.io to create the badges:

coverage complexity vulnerabilities python

However, setting anybadge_use_shields to False will render the badges using anybadge and save them as svg files in the docs\images folder:

coverage complexity vulnerabilities python

Development

Clone the repository and ensure the latest version of Docker is installed on your development server.

Build the Docker image:

docker image build \
-t \
pybanybadge:latest .

Run the Docker container:

docker container run \
--rm \
-it \
-v $PWD:/code \
pybanybadge:latest \
bash

Execute the build:

pyb -X

Metadata

Release files for pybuilder-anybadge 0.3.4

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

Source distribution (sdist)

Source distribution for pybuilder-anybadge 0.3.4
File Size Uploaded Provenance
pybuilder-anybadge-0.3.4.tar.gz 6.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for pybuilder-anybadge 0.3.4
File Interpreter ABI Platform
pybuilder_anybadge-0.3.4-py3-none-any.whl Python 3 none any Details

Total release size: 12.8 kB

Release files / pybuilder-anybadge-0.3.4.tar.gz

Download URL pybuilder-anybadge-0.3.4.tar.gz
Size 6.2 kB
Tags Source
SHA-256 checksum
How to use checksums
2ac1f94dab5aa32b75bfe573dc642811f50e61b64072f730396be7d5e6872561
BLAKE2b-256 checksum
How to use checksums
8250812d7f9f4e5b01b9b29fda27c2819dec7d90d41d0f65c8c3fa4ff343b2aa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Release files / pybuilder_anybadge-0.3.4-py3-none-any.whl

Download URL pybuilder_anybadge-0.3.4-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
29d7baa0b7da6fd8ac437233d5b700a8e70d9db2e08602e3f44242dad449c45f
BLAKE2b-256 checksum
How to use checksums
9dc8576ec358d09a48b5e666511d17c37af4469e759d2fabe3cfeae45e7c0a34
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.9.19

Security for pybuilder-anybadge 0.3.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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