log_color


Namelog_color JSON
Version 2.1.0 PyPI version JSON
download
home_pageNone
SummarySimple log formatters for colored output.
upload_time2025-08-21 18:54:42
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseDO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright © 2016 Brant Watson <oldspiceap@gmail.com> This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ for more details. DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO.
keywords logging color formatter
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # LogColor
[![Stable Version](https://img.shields.io/pypi/v/log-color?color=blue)](https://pypi.org/project/log-color/)
[![Documentation Status](https://readthedocs.org/projects/log-color/badge/?version=latest)](https://log-color.readthedocs.io/en/latest/?badge=latest)
[![Downloads](https://img.shields.io/pypi/dm/log-color)](https://pypistats.org/packages/log-color)
![Test](https://github.com/induane/logcolor/actions/workflows/test.yml/badge.svg) ![Lint](https://github.com/induane/logcolor/actions/workflows/lint.yml/badge.svg)


When making command line interfaces, it's often useful to colorize the output to emphasize salient pieces of
information or otherwise enhance the user experience. Unfortunately it's quite cumbersome to add colorized outputs to
Python log messages.

## ColorFormatter

The ColorFormatter is a logging formatter that parses your log messages and adds color codes to the log messages.

![example](https://raw.githubusercontent.com/induane/logcolor/master/docs/source/images/example_logs.png)

## ColorStripper

The ColorStripper formatter is the inverse of the ColorFormatter. It strips the color information from your messages so
that you can log to a file without it being full of color codes.

## Installation
I'm on pypi!

```
$ pip install log_color
```

## Features

- Simple to use
- No external dependencies
- Compatibility with Python 3.7+, PyPy
- Fast! Compiled binaries are available for some systems!

## http://no-color.org/
LogColor honors the ``NO_COLOR`` environment variable.

## Developer Setup

This project uses [uv](https://docs.astral.sh/uv/ "UV Documentation") for dependency management, command running, etc... install it:

```bash
$ curl -LsSf https://astral.sh/uv/install.sh | sh
```

### Makefile

If you're on Linux or OSX, there is a ``Makefile`` with a number of helpful targets:

* ``make check-types`` Run ``mypy`` static code analysis tools
* ``make format-code`` Runs the [ruff](https://beta.ruff.rs/docs/) code formatter
* ``make check-code`` Validates no code formatting errors or import sorting errors (check only, makes no changes)
* ``make wheel`` Build Python ``.whl`` file for distribution
* ``make test`` Run the unittests
* ``make docs`` Build the documentation
* ``make freeze`` List all packages (and their version number) installed in the virtual environment
* ``make shell`` Launch an interactive Python shell in the virtual environment context
* ``make clean`` Remove any files that aren't part of the repo (build artifacts, test reports, etc...)
* ``make git-clean`` Runs the git ``fsck`` tool, prunes the reflog, etc...

**TIP:** *If you want to force a target to be re-evaluated (i.e. ``make env``) run make with the ``-B`` flag to force
it to evaluate.*

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "log_color",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "logging, color, formatter",
    "author": null,
    "author_email": "Brant Watson <oldspiceap@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/dc/0f/839813e28281d221ccf41d3eb550442eebb5fefd2e7498e271853b692229/log_color-2.1.0.tar.gz",
    "platform": null,
    "description": "# LogColor\n[![Stable Version](https://img.shields.io/pypi/v/log-color?color=blue)](https://pypi.org/project/log-color/)\n[![Documentation Status](https://readthedocs.org/projects/log-color/badge/?version=latest)](https://log-color.readthedocs.io/en/latest/?badge=latest)\n[![Downloads](https://img.shields.io/pypi/dm/log-color)](https://pypistats.org/packages/log-color)\n![Test](https://github.com/induane/logcolor/actions/workflows/test.yml/badge.svg) ![Lint](https://github.com/induane/logcolor/actions/workflows/lint.yml/badge.svg)\n\n\nWhen making command line interfaces, it's often useful to colorize the output to emphasize salient pieces of\ninformation or otherwise enhance the user experience. Unfortunately it's quite cumbersome to add colorized outputs to\nPython log messages.\n\n## ColorFormatter\n\nThe ColorFormatter is a logging formatter that parses your log messages and adds color codes to the log messages.\n\n![example](https://raw.githubusercontent.com/induane/logcolor/master/docs/source/images/example_logs.png)\n\n## ColorStripper\n\nThe ColorStripper formatter is the inverse of the ColorFormatter. It strips the color information from your messages so\nthat you can log to a file without it being full of color codes.\n\n## Installation\nI'm on pypi!\n\n```\n$ pip install log_color\n```\n\n## Features\n\n- Simple to use\n- No external dependencies\n- Compatibility with Python 3.7+, PyPy\n- Fast! Compiled binaries are available for some systems!\n\n## http://no-color.org/\nLogColor honors the ``NO_COLOR`` environment variable.\n\n## Developer Setup\n\nThis project uses [uv](https://docs.astral.sh/uv/ \"UV Documentation\") for dependency management, command running, etc... install it:\n\n```bash\n$ curl -LsSf https://astral.sh/uv/install.sh | sh\n```\n\n### Makefile\n\nIf you're on Linux or OSX, there is a ``Makefile`` with a number of helpful targets:\n\n* ``make check-types`` Run ``mypy`` static code analysis tools\n* ``make format-code`` Runs the [ruff](https://beta.ruff.rs/docs/) code formatter\n* ``make check-code`` Validates no code formatting errors or import sorting errors (check only, makes no changes)\n* ``make wheel`` Build Python ``.whl`` file for distribution\n* ``make test`` Run the unittests\n* ``make docs`` Build the documentation\n* ``make freeze`` List all packages (and their version number) installed in the virtual environment\n* ``make shell`` Launch an interactive Python shell in the virtual environment context\n* ``make clean`` Remove any files that aren't part of the repo (build artifacts, test reports, etc...)\n* ``make git-clean`` Runs the git ``fsck`` tool, prunes the reflog, etc...\n\n**TIP:** *If you want to force a target to be re-evaluated (i.e. ``make env``) run make with the ``-B`` flag to force\nit to evaluate.*\n",
    "bugtrack_url": null,
    "license": "DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE Version 2, December 2004 Copyright \u00a9 2016 Brant Watson <oldspiceap@gmail.com> This work is free. You can redistribute it and/or modify it under the terms of the Do What The Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See http://www.wtfpl.net/ for more details.  DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. You just DO WHAT THE FUCK YOU WANT TO. ",
    "summary": "Simple log formatters for colored output.",
    "version": "2.1.0",
    "project_urls": {
        "changelog": "https://github.com/induane/logcolor/blob/master/docs/source/changelog.rst",
        "documentation": "http://log-color.readthedocs.io/en/latest/",
        "homepage": "https://github.com/induane/logcolor",
        "repository": "https://github.com/induane/logcolor"
    },
    "split_keywords": [
        "logging",
        " color",
        " formatter"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "329538a8efda2c9fcb42a0fc8af91bc931ab256a375f0502cb2c7b84a2470a45",
                "md5": "ccca757d895a156f49c27fcfe21c948f",
                "sha256": "f63bc1d38bbfe063b269d92a95cb53fb15cb7f43d1b85668bc6a6d1940b7015a"
            },
            "downloads": -1,
            "filename": "log_color-2.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "ccca757d895a156f49c27fcfe21c948f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7396,
            "upload_time": "2025-08-21T18:54:41",
            "upload_time_iso_8601": "2025-08-21T18:54:41.264131Z",
            "url": "https://files.pythonhosted.org/packages/32/95/38a8efda2c9fcb42a0fc8af91bc931ab256a375f0502cb2c7b84a2470a45/log_color-2.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dc0f839813e28281d221ccf41d3eb550442eebb5fefd2e7498e271853b692229",
                "md5": "0ebeba7caa1b800927c1d7634a657388",
                "sha256": "b6856fbcb6b1f8c91ae1049eaa7e28775569b4fcd228348d552845389dd36e8e"
            },
            "downloads": -1,
            "filename": "log_color-2.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "0ebeba7caa1b800927c1d7634a657388",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 163053,
            "upload_time": "2025-08-21T18:54:42",
            "upload_time_iso_8601": "2025-08-21T18:54:42.402718Z",
            "url": "https://files.pythonhosted.org/packages/dc/0f/839813e28281d221ccf41d3eb550442eebb5fefd2e7498e271853b692229/log_color-2.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-21 18:54:42",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "induane",
    "github_project": "logcolor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "log_color"
}
        
Elapsed time: 1.43221s