coverage-badge


Namecoverage-badge JSON
Version 1.1.1 PyPI version JSON
download
home_pagehttps://github.com/dbrgn/coverage-badge
SummaryGenerate coverage badges for Coverage.py.
upload_time2024-04-24 21:06:18
maintainerNone
docs_urlNone
authorDanilo Bargen
requires_pythonNone
licenseMIT
keywords coverage badge shield
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage
            Coverage.py Badge
==================

.. |buildstatus| image:: https://github.com/dbrgn/coverage-badge/workflows/CI/badge.svg
    :alt: Build status
    :target: https://github.com/dbrgn/coverage-badge/actions?query=branch%3Amain
.. |downloads| image:: https://img.shields.io/pypi/dm/coverage-badge.svg
    :alt: PyPI Downloads
    :target: https://pypi.python.org/pypi/coverage-badge
.. |example| image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/example.svg
    :alt: Example coverage badge

|buildstatus| |downloads|

   ⚠️ coverage-badge is in maintenance mode. I might still do occasional updates
   and fixes from time to time, but there will be no added features. Most
   people using coverage-badge might want to use genbadge_ instead, which has
   more features (e.g. test badges, flake8 reports, etc).

A small script to generate coverage badges using Coverage.py.

Example of a generated badge: |example|

The badge template has been taken from shields.io_, therefore it should look
mostly good. (The spec is a bit stricter on the margins, but I can't easily do
text width calculations in Python so the margins might not always be 4px.)

.. _shields.io: http://shields.io/
.. _genbadge: https://smarie.github.io/python-genbadge/

Installation
------------
Run:

.. code-block::
    
    pip install coverage-badge


Usage
-----

First, run Coverage.py to generate the necessary coverage data. Then you can
either return the badge SVG to stdout::

    $ coverage-badge

...or write it to a file::

    $ coverage-badge -o coverage.svg

It's important that you run ``coverage-badge`` from the directory where the
``.coverage`` data file is located.

Different colors for cover ranges:

.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/15.svg
    :alt: 15%

.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/45.svg
    :alt: 45%

.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/65.svg
    :alt: 65%

.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/80.svg
    :alt: 80%

.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/93.svg
    :alt: 93%

.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/97.svg
    :alt: 97%

----

The full usage text::

    usage: __main__.py [-h] [-o FILEPATH] [-p] [-f] [-q] [-v]

    Generate coverage badges for Coverage.py.

    optional arguments:
      -h, --help   show this help message and exit
      -o FILEPATH  Save the file to the specified path.
      -p           Plain color mode. Standard green badge.
      -f           Force overwrite image, use with -o key.
      -q           Don't output any non-error messages.
      -v           Show version.

License
-------

MIT License, see `LICENSE.txt` file..

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/dbrgn/coverage-badge",
    "name": "coverage-badge",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "coverage badge shield",
    "author": "Danilo Bargen",
    "author_email": "mail@dbrgn.ch",
    "download_url": "https://files.pythonhosted.org/packages/e9/35/6f215857207371618275463f1f08ca0221fbd2969d83081fe3f3918f709f/coverage-badge-1.1.1.tar.gz",
    "platform": null,
    "description": "Coverage.py Badge\n==================\n\n.. |buildstatus| image:: https://github.com/dbrgn/coverage-badge/workflows/CI/badge.svg\n    :alt: Build status\n    :target: https://github.com/dbrgn/coverage-badge/actions?query=branch%3Amain\n.. |downloads| image:: https://img.shields.io/pypi/dm/coverage-badge.svg\n    :alt: PyPI Downloads\n    :target: https://pypi.python.org/pypi/coverage-badge\n.. |example| image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/example.svg\n    :alt: Example coverage badge\n\n|buildstatus| |downloads|\n\n   \u26a0\ufe0f coverage-badge is in maintenance mode. I might still do occasional updates\n   and fixes from time to time, but there will be no added features. Most\n   people using coverage-badge might want to use genbadge_ instead, which has\n   more features (e.g. test badges, flake8 reports, etc).\n\nA small script to generate coverage badges using Coverage.py.\n\nExample of a generated badge: |example|\n\nThe badge template has been taken from shields.io_, therefore it should look\nmostly good. (The spec is a bit stricter on the margins, but I can't easily do\ntext width calculations in Python so the margins might not always be 4px.)\n\n.. _shields.io: http://shields.io/\n.. _genbadge: https://smarie.github.io/python-genbadge/\n\nInstallation\n------------\nRun:\n\n.. code-block::\n    \n    pip install coverage-badge\n\n\nUsage\n-----\n\nFirst, run Coverage.py to generate the necessary coverage data. Then you can\neither return the badge SVG to stdout::\n\n    $ coverage-badge\n\n...or write it to a file::\n\n    $ coverage-badge -o coverage.svg\n\nIt's important that you run ``coverage-badge`` from the directory where the\n``.coverage`` data file is located.\n\nDifferent colors for cover ranges:\n\n.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/15.svg\n    :alt: 15%\n\n.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/45.svg\n    :alt: 45%\n\n.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/65.svg\n    :alt: 65%\n\n.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/80.svg\n    :alt: 80%\n\n.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/93.svg\n    :alt: 93%\n\n.. image:: https://cdn.rawgit.com/dbrgn/coverage-badge/main/media/97.svg\n    :alt: 97%\n\n----\n\nThe full usage text::\n\n    usage: __main__.py [-h] [-o FILEPATH] [-p] [-f] [-q] [-v]\n\n    Generate coverage badges for Coverage.py.\n\n    optional arguments:\n      -h, --help   show this help message and exit\n      -o FILEPATH  Save the file to the specified path.\n      -p           Plain color mode. Standard green badge.\n      -f           Force overwrite image, use with -o key.\n      -q           Don't output any non-error messages.\n      -v           Show version.\n\nLicense\n-------\n\nMIT License, see `LICENSE.txt` file..\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Generate coverage badges for Coverage.py.",
    "version": "1.1.1",
    "project_urls": {
        "Homepage": "https://github.com/dbrgn/coverage-badge"
    },
    "split_keywords": [
        "coverage",
        "badge",
        "shield"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "dcce169c449301104186189b47d66e3eb0ee267273f22aaab185e0ec46591938",
                "md5": "be4bcb5e66f5d61cf6d72540964f77e2",
                "sha256": "1d8e566ad47c37910fa2bbc74ea19972b171b5b4e40624b31b3e2f2d93680266"
            },
            "downloads": -1,
            "filename": "coverage_badge-1.1.1-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "be4bcb5e66f5d61cf6d72540964f77e2",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 6481,
            "upload_time": "2024-04-24T21:06:16",
            "upload_time_iso_8601": "2024-04-24T21:06:16.370876Z",
            "url": "https://files.pythonhosted.org/packages/dc/ce/169c449301104186189b47d66e3eb0ee267273f22aaab185e0ec46591938/coverage_badge-1.1.1-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "e9356f215857207371618275463f1f08ca0221fbd2969d83081fe3f3918f709f",
                "md5": "b602f6975dc0d3a75a71548a963f8273",
                "sha256": "42252df917404af6147380861228a4ace3d9a29804df8fc2d34a22b2bc4f45b6"
            },
            "downloads": -1,
            "filename": "coverage-badge-1.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "b602f6975dc0d3a75a71548a963f8273",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 5579,
            "upload_time": "2024-04-24T21:06:18",
            "upload_time_iso_8601": "2024-04-24T21:06:18.037365Z",
            "url": "https://files.pythonhosted.org/packages/e9/35/6f215857207371618275463f1f08ca0221fbd2969d83081fe3f3918f709f/coverage-badge-1.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-24 21:06:18",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dbrgn",
    "github_project": "coverage-badge",
    "travis_ci": false,
    "coveralls": true,
    "github_actions": true,
    "lcname": "coverage-badge"
}
        
Elapsed time: 0.24582s