[](https://github.com/jakob-bagterp/colorist-for-python/releases/latest)
[](https://www.python.org)
[](https://github.com/jakob-bagterp/colorist-for-python/blob/master/LICENSE.md)
[](https://codecov.io/gh/jakob-bagterp/colorist-for-python)
[](https://github.com/jakob-bagterp/colorist-for-python/actions/workflows/codeql.yml)
[](https://github.com/jakob-bagterp/colorist-for-python/actions/workflows/test.yml)
[](https://pepy.tech/project/colorist)
# π Colorist for Python π
Lightweight Python package that makes it easy and fast to print colored text in the terminal.
Ready to try? See [how to install](https://jakob-bagterp.github.io/colorist-for-python/getting-started/installation/).
## Getting Started
### Print Line of Colored Text
How to print a full line of colored text in the terminal:
```python
from colorist import green, yellow, red
green("This is GREEN!")
yellow("This is YELLOW!")
red("This is RED!")
```
How it appears in the terminal:

### Print Mixed Text Colors
How to customize colors inside a paragraph and print it in the terminal:
```python
from colorist import Color
print(f"I want {Color.RED}red{Color.OFF} color inside this paragraph")
print(f"Both {Color.GREEN}green{Color.OFF} and {Color.YELLOW}yellow{Color.OFF} are nice colors")
```
How it appears in the terminal:

## Other Styling Options
### Print Bright Colors
Most terminals support bright colors that stand more out:
```python
from colorist import BrightColor
print(f"I want {BrightColor.CYAN}cyan{BrightColor.OFF} color inside this paragraph")
```
How it appears in the terminal:

Remember to use `Color.OFF` or `BrightColor.OFF` every time you want to revert back to the default terminal text style. Otherwise, the color may spill over and into other terminal messages.
### Print Background Colors
```python
from colorist import bg_green, bg_yellow, bg_red
bg_green("This is GREEN background!")
bg_yellow("This is YELLOW background!")
bg_red("This is RED background!")
```
How it appears in the terminal:

Background colors can also be mixed inside a paragraph:
```python
from colorist import BgColor
print(f"I want {BgColor.RED}red{BgColor.OFF} background color inside this paragraph")
print(f"Both {BgColor.GREEN}green{BgColor.OFF} and {BgColor.YELLOW}yellow{BgColor.OFF} are nice background colors")
```
How it appears in the terminal:

```python
from colorist import BgBrightColor
print(f"I want {BgBrightColor.CYAN}cyan{BgBrightColor.OFF} background color inside this paragraph")
```
How it appears in the terminal:

As with text colors, remember to use `BgColor.OFF` or `BgBrightColor.OFF` every time you want to revert back to the default terminal text style. Otherwise, the color may spill over and into other terminal messages.
## Foreground Text
| Color | Full Text Function | Custom | Example |
| ----- | ------------------ | ------ | ------- |
|  | `green("text")` | `Color.GREEN` |  |
|  | `yellow("text")` | `Color.YELLOW` |  |
|  | `red("text")` | `Color.RED` |  |
|  | `magenta("text")` | `Color.MAGENTA` |  |
|  | `blue("text")` | `Color.BLUE` |  |
|  | `cyan("text")` | `Color.CYAN` |  |
|  | `white("text")` | `Color.WHITE` |  |
|  | `black("text")` | `Color.BLACK` |  |
| - | - | `Color.DEFAULT` | - |
| - | - | `Color.OFF` | - |
|  | `bright_green("text")` | `BrightColor.GREEN` |  |
|  | `bright_yellow("text")` | `BrightColor.YELLOW` |  |
|  | `bright_red("text")` | `BrightColor.RED` |  |
|  | `bright_magenta("text")` | `BrightColor.MAGENTA` |  |
|  | `bright_blue("text")` | `BrightColor.BLUE` |  |
|  | `bright_cyan("text")` | `BrightColor.CYAN` |  |
|  | `bright_white("text")` | `BrightColor.WHITE` |  |
|  | `bright_black("text")` | `BrightColor.BLACK` |  |
| - | - | `BrightColor.DEFAULT` | - |
| - | - | `BrightColor.OFF` | - |
## Background
| Color | Full Text Function | Custom | Example |
| ----- | ------------------ | ------ | ------- |
|  | `bg_green("text")` | `BgColor.GREEN` |  |
|  | `bg_yellow("text")` | `BgColor.YELLOW` |  |
|  | `bg_red("text")` | `BgColor.RED` |  |
|  | `bg_magenta("text")` | `BgColor.MAGENTA` |  |
|  | `bg_blue("text")` | `BgColor.BLUE` |  |
|  | `bg_cyan("text")` | `BgColor.CYAN` |  |
|  | `bg_white("text")` | `BgColor.WHITE` |  |
|  | `bg_black("text")` | `BgColor.BLACK` |  |
| - | - | `BgColor.DEFAULT` | - |
| - | - | `BgColor.OFF` | - |
|  | `bg_bright_green("text")` | `BgBrightColor.GREEN` |  |
|  | `bg_bright_yellow("text")` | `BgBrightColor.YELLOW` |  |
|  | `bg_bright_red("text")` | `BgBrightColor.RED` |  |
|  | `bg_bright_magenta("text")` | `BgBrightColor.MAGENTA` |  |
|  | `bg_bright_blue("text")` | `BgBrightColor.BLUE` |  |
|  | `bg_bright_cyan("text")` | `BgBrightColor.CYAN` |  |
|  | `bg_bright_white("text")` | `BgBrightColor.WHITE` |  |
|  | `bg_bright_black("text")` | `BgBrightColor.BLACK` |  |
| - | - | `BgBrightColor.DEFAULT` | - |
| - | - | `BgBrightColor.OFF` | - |
# Thank You for Supporting
## Donate
This module is free to use. And if you like it, feel free to [buy me a coffee](https://github.com/sponsors/jakob-bagterp).
## Contribute
If you have suggestions or changes to the module, feel free to add to the code and create a [pull request](https://github.com/jakob-bagterp/colorist-for-python/pulls).
## Report Bugs
Report bugs and issues [here](https://github.com/jakob-bagterp/colorist-for-python/issues).
# 3-Clause BSD License
Copyright (c) 2022 β present, Jakob Bagterp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS βAS ISβ AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Raw data
{
"_id": null,
"home_page": "https://jakob-bagterp.github.io/colorist-for-python/",
"name": "colorist",
"maintainer": "Jakob Bagterp",
"docs_url": null,
"requires_python": ">=3.10",
"maintainer_email": "jakob_bagterp@hotmail.com",
"keywords": "python, colors, terminal",
"author": "Jakob Bagterp",
"author_email": "jakob_bagterp@hotmail.com",
"download_url": "https://files.pythonhosted.org/packages/5a/94/53e9fe12e0354768778e14d204cd6b81f70f30cdb74cf0fbf3ee89ae08e1/colorist-1.8.3.tar.gz",
"platform": null,
"description": "[](https://github.com/jakob-bagterp/colorist-for-python/releases/latest)\n[](https://www.python.org)\n[](https://github.com/jakob-bagterp/colorist-for-python/blob/master/LICENSE.md)\n[](https://codecov.io/gh/jakob-bagterp/colorist-for-python)\n[](https://github.com/jakob-bagterp/colorist-for-python/actions/workflows/codeql.yml)\n[](https://github.com/jakob-bagterp/colorist-for-python/actions/workflows/test.yml)\n[](https://pepy.tech/project/colorist)\n\n# \ud83c\udf08 Colorist for Python \ud83c\udf08\nLightweight Python package that makes it easy and fast to print colored text in the terminal.\n\nReady to try? See [how to install](https://jakob-bagterp.github.io/colorist-for-python/getting-started/installation/).\n\n## Getting Started\n### Print Line of Colored Text\nHow to print a full line of colored text in the terminal:\n\n```python\nfrom colorist import green, yellow, red\n\ngreen(\"This is GREEN!\")\nyellow(\"This is YELLOW!\")\nred(\"This is RED!\")\n```\n\nHow it appears in the terminal:\n\n\n\n### Print Mixed Text Colors\nHow to customize colors inside a paragraph and print it in the terminal:\n\n```python\nfrom colorist import Color\n\nprint(f\"I want {Color.RED}red{Color.OFF} color inside this paragraph\")\n\nprint(f\"Both {Color.GREEN}green{Color.OFF} and {Color.YELLOW}yellow{Color.OFF} are nice colors\")\n```\n\nHow it appears in the terminal:\n\n\n\n## Other Styling Options\n### Print Bright Colors\nMost terminals support bright colors that stand more out:\n\n```python\nfrom colorist import BrightColor\n\nprint(f\"I want {BrightColor.CYAN}cyan{BrightColor.OFF} color inside this paragraph\")\n```\n\nHow it appears in the terminal:\n\n\n\nRemember to use `Color.OFF` or `BrightColor.OFF` every time you want to revert back to the default terminal text style. Otherwise, the color may spill over and into other terminal messages.\n\n### Print Background Colors\n```python\nfrom colorist import bg_green, bg_yellow, bg_red\n\nbg_green(\"This is GREEN background!\")\nbg_yellow(\"This is YELLOW background!\")\nbg_red(\"This is RED background!\")\n```\n\nHow it appears in the terminal:\n\n\n\nBackground colors can also be mixed inside a paragraph:\n\n```python\nfrom colorist import BgColor\n\nprint(f\"I want {BgColor.RED}red{BgColor.OFF} background color inside this paragraph\")\n\nprint(f\"Both {BgColor.GREEN}green{BgColor.OFF} and {BgColor.YELLOW}yellow{BgColor.OFF} are nice background colors\")\n```\n\nHow it appears in the terminal:\n\n\n\n```python\nfrom colorist import BgBrightColor\n\nprint(f\"I want {BgBrightColor.CYAN}cyan{BgBrightColor.OFF} background color inside this paragraph\")\n```\n\nHow it appears in the terminal:\n\n\n\nAs with text colors, remember to use `BgColor.OFF` or `BgBrightColor.OFF` every time you want to revert back to the default terminal text style. Otherwise, the color may spill over and into other terminal messages.\n\n## Foreground Text\n| Color | Full Text Function | Custom | Example |\n| ----- | ------------------ | ------ | ------- |\n|  | `green(\"text\")` | `Color.GREEN` |  |\n|  | `yellow(\"text\")` | `Color.YELLOW` |  |\n|  | `red(\"text\")` | `Color.RED` |  |\n|  | `magenta(\"text\")` | `Color.MAGENTA` |  |\n|  | `blue(\"text\")` | `Color.BLUE` |  |\n|  | `cyan(\"text\")` | `Color.CYAN` |  |\n|  | `white(\"text\")` | `Color.WHITE` |  |\n|  | `black(\"text\")` | `Color.BLACK` |  |\n| - | - | `Color.DEFAULT` | - |\n| - | - | `Color.OFF` | - |\n|  | `bright_green(\"text\")` | `BrightColor.GREEN` |  |\n|  | `bright_yellow(\"text\")` | `BrightColor.YELLOW` |  |\n|  | `bright_red(\"text\")` | `BrightColor.RED` |  |\n|  | `bright_magenta(\"text\")` | `BrightColor.MAGENTA` |  |\n|  | `bright_blue(\"text\")` | `BrightColor.BLUE` |  |\n|  | `bright_cyan(\"text\")` | `BrightColor.CYAN` |  |\n|  | `bright_white(\"text\")` | `BrightColor.WHITE` |  |\n|  | `bright_black(\"text\")` | `BrightColor.BLACK` |  |\n| - | - | `BrightColor.DEFAULT` | - |\n| - | - | `BrightColor.OFF` | - |\n\n## Background\n| Color | Full Text Function | Custom | Example |\n| ----- | ------------------ | ------ | ------- |\n|  | `bg_green(\"text\")` | `BgColor.GREEN` |  |\n|  | `bg_yellow(\"text\")` | `BgColor.YELLOW` |  |\n|  | `bg_red(\"text\")` | `BgColor.RED` |  |\n|  | `bg_magenta(\"text\")` | `BgColor.MAGENTA` |  |\n|  | `bg_blue(\"text\")` | `BgColor.BLUE` |  |\n|  | `bg_cyan(\"text\")` | `BgColor.CYAN` |  |\n|  | `bg_white(\"text\")` | `BgColor.WHITE` |  |\n|  | `bg_black(\"text\")` | `BgColor.BLACK` |  |\n| - | - | `BgColor.DEFAULT` | - |\n| - | - | `BgColor.OFF` | - |\n|  | `bg_bright_green(\"text\")` | `BgBrightColor.GREEN` |  |\n|  | `bg_bright_yellow(\"text\")` | `BgBrightColor.YELLOW` |  |\n|  | `bg_bright_red(\"text\")` | `BgBrightColor.RED` |  |\n|  | `bg_bright_magenta(\"text\")` | `BgBrightColor.MAGENTA` |  |\n|  | `bg_bright_blue(\"text\")` | `BgBrightColor.BLUE` |  |\n|  | `bg_bright_cyan(\"text\")` | `BgBrightColor.CYAN` |  |\n|  | `bg_bright_white(\"text\")` | `BgBrightColor.WHITE` |  |\n|  | `bg_bright_black(\"text\")` | `BgBrightColor.BLACK` |  |\n| - | - | `BgBrightColor.DEFAULT` | - |\n| - | - | `BgBrightColor.OFF` | - |\n\n# Thank You for Supporting\n## Donate\nThis module is free to use. And if you like it, feel free to [buy me a coffee](https://github.com/sponsors/jakob-bagterp).\n\n## Contribute\nIf you have suggestions or changes to the module, feel free to add to the code and create a [pull request](https://github.com/jakob-bagterp/colorist-for-python/pulls).\n\n## Report Bugs\nReport bugs and issues [here](https://github.com/jakob-bagterp/colorist-for-python/issues).\n\n# 3-Clause BSD License\n\nCopyright (c) 2022 \u2013 present, Jakob Bagterp\n\nRedistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:\n\n1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.\n\n2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.\n\n3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \u201cAS IS\u201d AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n",
"bugtrack_url": null,
"license": "3-Clause BSD License",
"summary": "Colorist for Python",
"version": "1.8.3",
"project_urls": {
"API Reference": "https://jakob-bagterp.github.io/colorist-for-python/reference/",
"Bug Tracker": "https://github.com/jakob-bagterp/colorist-for-python/issues",
"Documentation": "https://jakob-bagterp.github.io/colorist-for-python/",
"Download": "https://pypi.org/project/colorist/",
"Homepage": "https://jakob-bagterp.github.io/colorist-for-python/",
"Release Notes": "https://github.com/jakob-bagterp/colorist-for-python/releases",
"Source Code": "https://github.com/jakob-bagterp/colorist-for-python"
},
"split_keywords": [
"python",
" colors",
" terminal"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "43cc4d7b4167d9d1f5a08b2cc3b888a1d04e879a1f36b6d3ae372b797431fc1f",
"md5": "95ea4a7ace5c3c37f7d31e1b6238de4a",
"sha256": "71845994a2c30ba582e563876685e5add5151237463ea27672314ed196a61821"
},
"downloads": -1,
"filename": "colorist-1.8.3-py3-none-any.whl",
"has_sig": false,
"md5_digest": "95ea4a7ace5c3c37f7d31e1b6238de4a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.10",
"size": 39503,
"upload_time": "2024-11-03T12:38:28",
"upload_time_iso_8601": "2024-11-03T12:38:28.507172Z",
"url": "https://files.pythonhosted.org/packages/43/cc/4d7b4167d9d1f5a08b2cc3b888a1d04e879a1f36b6d3ae372b797431fc1f/colorist-1.8.3-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "5a9453e9fe12e0354768778e14d204cd6b81f70f30cdb74cf0fbf3ee89ae08e1",
"md5": "acb8ec1794e27d540037c5f3ffa6bdc0",
"sha256": "8a6741feae39eebfe25436f2c9f564072f3c0c37bdabc5cc75a35149b483b72c"
},
"downloads": -1,
"filename": "colorist-1.8.3.tar.gz",
"has_sig": false,
"md5_digest": "acb8ec1794e27d540037c5f3ffa6bdc0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.10",
"size": 21474,
"upload_time": "2024-11-03T12:38:29",
"upload_time_iso_8601": "2024-11-03T12:38:29.785487Z",
"url": "https://files.pythonhosted.org/packages/5a/94/53e9fe12e0354768778e14d204cd6b81f70f30cdb74cf0fbf3ee89ae08e1/colorist-1.8.3.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-11-03 12:38:29",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "jakob-bagterp",
"github_project": "colorist-for-python",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"requirements": [],
"tox": true,
"lcname": "colorist"
}