--- id: anybadge version: "1.16.0" license: unclear license_treatment: permissive maintenance: active --- # anybadge — Simple, flexible badge generator for project badges. License: permissive · Maintenance: active · Downloads: 1.9M/mo ## What it is and what it does anybadge is a Python library and CLI tool for generating SVG badge images with dynamic coloring based on threshold rules. It lets you create badges by specifying a label, value, and a set of thresholds that map numeric ranges to colors—so a pylint score of 2.22 can automatically render red, while higher scores render green. The package supports both named colors (from Mozilla's CSS color keywords) and hex color codes. You can use it either by importing into Python code or by running commands directly from the shell. It's designed for projects that need badge generation without calling external services, making it useful for internal development, CI/CD pipelines, or environments where external badge services are unavailable or undesirable. The single dependency (packaging) and pure-Python wheel keep installation friction minimal. Use it for: - Generate pylint or code-quality score badges that change color based on thresholds in CI/CD pipelines. - Create custom metric badges for internal dashboards or README files without relying on external badge services. - Automate badge generation in build scripts to reflect real-time project health metrics. - Generate badges for documentation completeness or API compliance status with threshold-driven colors. - Build badges with both named colors and custom hex values for consistent project branding. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Generates SVG badge images with configurable thresholds and colors, usable as a Python library or command-line tool for adding badges to projects. Yes. anybadge is a lightweight, actively maintained tool with no security issues, permissive licensing, and low install friction. It solves a specific, real problem—generating SVG badges with threshold-based coloring—and is well-suited for CI/CD integration, internal projects, or any scenario where you need badge generation without external dependencies. ## Install pip install anybadge uv add anybadge poetry add anybadge ## Installing anybadge Before you install: Low friction: pure Python wheel with a single runtime dependency (packaging). Active maintenance with recent release (2025-01-11) and no known vulnerabilities. License in practice: MIT license (permissive): you can use, modify, and distribute anybadge freely in commercial and private projects with minimal restrictions. Quickstart: pip install anybadge import anybadge thresholds = {2: 'red', 4: 'orange', 8: 'yellow', 10: 'green'} badge = anybadge.Badge('pylint', 2.22, thresholds=thresholds) badge.write_badge('pylint.svg') Verify before relying: - Whether pre-built badge templates (e.g., 'pylint') cover your specific metrics or if custom thresholds are always required. - Performance characteristics when generating many badges in batch or in high-frequency CI/CD pipelines. - Specific use-case coverage for test coverage badges or other common metrics beyond the documented examples. ## Package facts - License: not declared (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 1.9M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags svg badge generator, project badge creation, threshold-based badge coloring, badge generation tool, python badge library, command line badge maker, ci status badge, badge-generation, svg, ci-cd [View on SkillFed](https://skillfed.io/packages/anybadge) · [View on PyPI](https://pypi.org/project/anybadge/)