termcolor


Nametermcolor JSON
Version 2.3.0 PyPI version JSON
download
home_page
SummaryANSI color formatting for output in terminal
upload_time2023-04-23 19:45:24
maintainerHugo van Kemenade
docs_urlNone
author
requires_python>=3.7
licenseMIT
keywords ansi ansi color ansi colour color colour formatting termcolor terminal
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # termcolor

[![PyPI version](https://img.shields.io/pypi/v/termcolor.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/termcolor)
[![Supported Python versions](https://img.shields.io/pypi/pyversions/termcolor.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/termcolor)
[![PyPI downloads](https://img.shields.io/pypi/dm/termcolor.svg)](https://pypistats.org/packages/termcolor)
[![GitHub Actions status](https://github.com/termcolor/termcolor/workflows/Test/badge.svg)](https://github.com/termcolor/termcolor/actions)
[![Codecov](https://codecov.io/gh/termcolor/termcolor/branch/main/graph/badge.svg)](https://codecov.io/gh/termcolor/termcolor)
[![Licence](https://img.shields.io/github/license/termcolor/termcolor.svg)](COPYING.txt)
[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)
[![Tidelift](https://tidelift.com/badges/package/pypi/termcolor)](https://tidelift.com/subscription/pkg/pypi-termcolor?utm_source=pypi-termcolor&utm_medium=referral&utm_campaign=readme)

## Installation

### From PyPI

```bash
python3 -m pip install --upgrade termcolor
```

### From source

```bash
git clone https://github.com/termcolor/termcolor
cd termcolor
python3 -m pip install .
```

### Demo

To see demo output, run:

```bash
python3 -m termcolor
```

## Example

```python
import sys

from termcolor import colored, cprint

text = colored("Hello, World!", "red", attrs=["reverse", "blink"])
print(text)
cprint("Hello, World!", "green", "on_red")

print_red_on_cyan = lambda x: cprint(x, "red", "on_cyan")
print_red_on_cyan("Hello, World!")
print_red_on_cyan("Hello, Universe!")

for i in range(10):
    cprint(i, "magenta", end=" ")

cprint("Attention!", "red", attrs=["bold"], file=sys.stderr)
```

## Text properties

| Text colors     | Text highlights    | Attributes  |
| --------------- | ------------------ | ----------- |
| `black`         | `on_black`         | `bold`      |
| `red`           | `on_red`           | `dark`      |
| `green`         | `on_green`         | `underline` |
| `yellow`        | `on_yellow`        | `blink`     |
| `blue`          | `on_blue`          | `reverse`   |
| `magenta`       | `on_magenta`       | `concealed` |
| `cyan`          | `on_cyan`          |             |
| `white`         | `on_white`         |             |
| `light_grey`    | `on_light_grey`    |             |
| `dark_grey`     | `on_dark_grey`     |             |
| `light_red`     | `on_light_red`     |             |
| `light_green`   | `on_light_green`   |             |
| `light_yellow`  | `on_light_yellow`  |             |
| `light_blue`    | `on_light_blue`    |             |
| `light_magenta` | `on_light_magenta` |             |
| `light_cyan`    | `on_light_cyan`    |             |

## Terminal properties

| Terminal     | bold    | dark | underline | blink      | reverse | concealed |
| ------------ | ------- | ---- | --------- | ---------- | ------- | --------- |
| xterm        | yes     | no   | yes       | bold       | yes     | yes       |
| linux        | yes     | yes  | bold      | yes        | yes     | no        |
| rxvt         | yes     | no   | yes       | bold/black | yes     | no        |
| dtterm       | yes     | yes  | yes       | reverse    | yes     | yes       |
| teraterm     | reverse | no   | yes       | rev/red    | yes     | no        |
| aixterm      | normal  | no   | yes       | no         | yes     | yes       |
| PuTTY        | color   | no   | yes       | no         | yes     | no        |
| Windows      | no      | no   | no        | no         | yes     | no        |
| Cygwin SSH   | yes     | no   | color     | color      | color   | yes       |
| Mac Terminal | yes     | no   | yes       | yes        | yes     | yes       |

            

Raw data

            {
    "_id": null,
    "home_page": "",
    "name": "termcolor",
    "maintainer": "Hugo van Kemenade",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "ANSI,ANSI color,ANSI colour,color,colour,formatting,termcolor,terminal",
    "author": "",
    "author_email": "Konstantin Lepa <konstantin.lepa@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/b8/85/147a0529b4e80b6b9d021ca8db3a820fcac53ec7374b87073d004aaf444c/termcolor-2.3.0.tar.gz",
    "platform": null,
    "description": "# termcolor\n\n[![PyPI version](https://img.shields.io/pypi/v/termcolor.svg?logo=pypi&logoColor=FFE873)](https://pypi.org/project/termcolor)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/termcolor.svg?logo=python&logoColor=FFE873)](https://pypi.org/project/termcolor)\n[![PyPI downloads](https://img.shields.io/pypi/dm/termcolor.svg)](https://pypistats.org/packages/termcolor)\n[![GitHub Actions status](https://github.com/termcolor/termcolor/workflows/Test/badge.svg)](https://github.com/termcolor/termcolor/actions)\n[![Codecov](https://codecov.io/gh/termcolor/termcolor/branch/main/graph/badge.svg)](https://codecov.io/gh/termcolor/termcolor)\n[![Licence](https://img.shields.io/github/license/termcolor/termcolor.svg)](COPYING.txt)\n[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)\n[![Tidelift](https://tidelift.com/badges/package/pypi/termcolor)](https://tidelift.com/subscription/pkg/pypi-termcolor?utm_source=pypi-termcolor&utm_medium=referral&utm_campaign=readme)\n\n## Installation\n\n### From PyPI\n\n```bash\npython3 -m pip install --upgrade termcolor\n```\n\n### From source\n\n```bash\ngit clone https://github.com/termcolor/termcolor\ncd termcolor\npython3 -m pip install .\n```\n\n### Demo\n\nTo see demo output, run:\n\n```bash\npython3 -m termcolor\n```\n\n## Example\n\n```python\nimport sys\n\nfrom termcolor import colored, cprint\n\ntext = colored(\"Hello, World!\", \"red\", attrs=[\"reverse\", \"blink\"])\nprint(text)\ncprint(\"Hello, World!\", \"green\", \"on_red\")\n\nprint_red_on_cyan = lambda x: cprint(x, \"red\", \"on_cyan\")\nprint_red_on_cyan(\"Hello, World!\")\nprint_red_on_cyan(\"Hello, Universe!\")\n\nfor i in range(10):\n    cprint(i, \"magenta\", end=\" \")\n\ncprint(\"Attention!\", \"red\", attrs=[\"bold\"], file=sys.stderr)\n```\n\n## Text properties\n\n| Text colors     | Text highlights    | Attributes  |\n| --------------- | ------------------ | ----------- |\n| `black`         | `on_black`         | `bold`      |\n| `red`           | `on_red`           | `dark`      |\n| `green`         | `on_green`         | `underline` |\n| `yellow`        | `on_yellow`        | `blink`     |\n| `blue`          | `on_blue`          | `reverse`   |\n| `magenta`       | `on_magenta`       | `concealed` |\n| `cyan`          | `on_cyan`          |             |\n| `white`         | `on_white`         |             |\n| `light_grey`    | `on_light_grey`    |             |\n| `dark_grey`     | `on_dark_grey`     |             |\n| `light_red`     | `on_light_red`     |             |\n| `light_green`   | `on_light_green`   |             |\n| `light_yellow`  | `on_light_yellow`  |             |\n| `light_blue`    | `on_light_blue`    |             |\n| `light_magenta` | `on_light_magenta` |             |\n| `light_cyan`    | `on_light_cyan`    |             |\n\n## Terminal properties\n\n| Terminal     | bold    | dark | underline | blink      | reverse | concealed |\n| ------------ | ------- | ---- | --------- | ---------- | ------- | --------- |\n| xterm        | yes     | no   | yes       | bold       | yes     | yes       |\n| linux        | yes     | yes  | bold      | yes        | yes     | no        |\n| rxvt         | yes     | no   | yes       | bold/black | yes     | no        |\n| dtterm       | yes     | yes  | yes       | reverse    | yes     | yes       |\n| teraterm     | reverse | no   | yes       | rev/red    | yes     | no        |\n| aixterm      | normal  | no   | yes       | no         | yes     | yes       |\n| PuTTY        | color   | no   | yes       | no         | yes     | no        |\n| Windows      | no      | no   | no        | no         | yes     | no        |\n| Cygwin SSH   | yes     | no   | color     | color      | color   | yes       |\n| Mac Terminal | yes     | no   | yes       | yes        | yes     | yes       |\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "ANSI color formatting for output in terminal",
    "version": "2.3.0",
    "split_keywords": [
        "ansi",
        "ansi color",
        "ansi colour",
        "color",
        "colour",
        "formatting",
        "termcolor",
        "terminal"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "67e1434566ffce04448192369c1a282931cf4ae593e91907558eaecd2e9f2801",
                "md5": "cbe178c09e30de0fdd352ae0e3828ea2",
                "sha256": "3afb05607b89aed0ffe25202399ee0867ad4d3cb4180d98aaf8eefa6a5f7d475"
            },
            "downloads": -1,
            "filename": "termcolor-2.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cbe178c09e30de0fdd352ae0e3828ea2",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 6872,
            "upload_time": "2023-04-23T19:45:22",
            "upload_time_iso_8601": "2023-04-23T19:45:22.671749Z",
            "url": "https://files.pythonhosted.org/packages/67/e1/434566ffce04448192369c1a282931cf4ae593e91907558eaecd2e9f2801/termcolor-2.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b885147a0529b4e80b6b9d021ca8db3a820fcac53ec7374b87073d004aaf444c",
                "md5": "cdc8a161ea7764b4146e9fa49f7947d3",
                "sha256": "b5b08f68937f138fe92f6c089b99f1e2da0ae56c52b78bf7075fd95420fd9a5a"
            },
            "downloads": -1,
            "filename": "termcolor-2.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "cdc8a161ea7764b4146e9fa49f7947d3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 12163,
            "upload_time": "2023-04-23T19:45:24",
            "upload_time_iso_8601": "2023-04-23T19:45:24.004491Z",
            "url": "https://files.pythonhosted.org/packages/b8/85/147a0529b4e80b6b9d021ca8db3a820fcac53ec7374b87073d004aaf444c/termcolor-2.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-04-23 19:45:24",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "lcname": "termcolor"
}
        
Elapsed time: 0.05851s