chromaconsole


Namechromaconsole JSON
Version 0.8.6.3 PyPI version JSON
download
home_pageNone
SummaryA small colorful module to change text colors in terminal
upload_time2024-06-13 06:18:01
maintainerNone
docs_urlNone
authorNone
requires_python>=3
licenseNone
keywords color console terminal text style
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # Chroma Console

Chroma console is a python package for adding color and style to terminal text output using ANSI escape codes.

* if ***requests*** is installed this package updates automaticaly
* some terminals still don't support *ANSI escape*

<br>

## Installation

```shell
pip install chromaconsole
```

<br>

### How styling works
This package works using ***[ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)***

<br>

## Functions
<details>
<summary>Click here to see all functions</summary>

```python
#styling
Styling.disable()
Styling.enable()
Style.reset()
Style.bold()
Style.faint()
Style.italic()
Style.underlined()
Style.slow_blink()
Style.rapid_blink()
Style.reverse()
Style.hidden()
Style.strikethrough()
Style.doubly_underlined()
Style.normal_intensity()
Style.not_italic()
Style.not_underlined()
Style.not_blinking()
Style.proportional_spacing()
Style.not_reversed()
Style.reveal()
Style.not_strikethrough()
Style.not_proportional_spacing()
Style.overlined()
Style.not_overlined()
Style.minecraft(*args)

#coloring
Color.text(*args)
Color.text_gradient("text", color, color)
Color.default_text()
Color.background(*args)
Color.background_gradient("text", color, color)
Color.default_background()
Color.Text.black()
Color.Text.red()
Color.Text.green()
Color.Text.yellow()
Color.Text.blue()
Color.Text.magenta()
Color.Text.cyan()
Color.Text.white()
Color.Text.br_black()
Color.Text.br_red()
Color.Text.br_green()
Color.Text.br_yellow()
Color.Text.br_blue()
Color.Text.br_magenta()
Color.Text.br_cyan()
Color.Text.br_white()
Color.Background.black()
Color.Background.red()
Color.Background.green()
Color.Background.yellow()
Color.Background.blue()
Color.Background.magenta()
Color.Background.cyan()
Color.Background.white()
Color.Background.br_black()
Color.Background.br_red()
Color.Background.br_green()
Color.Background.br_yellow()
Color.Background.br_blue()
Color.Background.br_magenta()
Color.Background.br_cyan()
Color.Background.br_white()

#some other things (not finished)
Console.clr_scr_to_end()
Console.clr_scr_to_begin()
Console.clr_entire_scr()
Console.clr_line_to_end()
Console.clr_line_to_begin()
Console.clr_entire_line()
Console.scroll_up(int)
Console.scroll_down(int)
Console.bell()
Console.save_cursor()
Console.restore_cursor()
Console.switch_alt_scr()
Console.switch_orig_scr()
Console.show_cursor()
Console.hide_cursor()
```
</details>

<br>

## Example usage

```python
from chromaconsole import *

print(f"{Color.Text.red()}here is red colored text{Style.reset()}")
print(f"{Color.text(r, g, b)}here is RGB colored text{Style.reset()}")
print(f"{Color.background(r, g, b)}here is RGB colored background{Style.reset()}")

print(f"{Color.text('#rrggbb')}here is HEX colored text{Style.reset()}")
print(f"{Color.background('#rrggbb')}here is HEX colored background{Style.reset()}")

print(f"{Style.bold()}Bold {Style.reset()}")
print(f"{Style.italic()}Italic {Style.reset()}")
print(f"{Style.underlined()}Underlined {Style.reset()}")
print(f"{Style.strikethrough()}Strikethrough {Style.reset()}")

print(f"{Style.bold()}{Style.italic()}bold+italic {Style.reset()}")
print(f"{Style.minecraft('§','§ahello §4world§r')}")
```

<br>

## .enable() and .disable():

After executing the `Styling.disable()` command, the system will no longer apply coloring and styling to the content. To re-enable these features, simply use the `Styling.enable()` command.

```python
from chromaconsole import Styling
#disable the coloring and styling
Styling.disable()
print(f"{Color.text(r, g, b)}text without color and style{Style.reset()}")
Styling.enable()
print(f"{Color.text(r, g, b)}text with color and style{Style.reset()}")
```

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "chromaconsole",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3",
    "maintainer_email": null,
    "keywords": "color, console, terminal, text, style",
    "author": null,
    "author_email": "Umit Tasdelen <umittadelen1277@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/0c/e3/846f87e46752882deb6c8df05d59034d923ef87ca0fdb5b88e1295f568ba/chromaconsole-0.8.6.3.tar.gz",
    "platform": null,
    "description": "# Chroma Console\r\n\r\nChroma console is a python package for adding color and style to terminal text output using ANSI escape codes.\r\n\r\n* if ***requests*** is installed this package updates automaticaly\r\n* some terminals still don't support *ANSI escape*\r\n\r\n<br>\r\n\r\n## Installation\r\n\r\n```shell\r\npip install chromaconsole\r\n```\r\n\r\n<br>\r\n\r\n### How styling works\r\nThis package works using ***[ANSI escape codes](https://en.wikipedia.org/wiki/ANSI_escape_code)***\r\n\r\n<br>\r\n\r\n## Functions\r\n<details>\r\n<summary>Click here to see all functions</summary>\r\n\r\n```python\r\n#styling\r\nStyling.disable()\r\nStyling.enable()\r\nStyle.reset()\r\nStyle.bold()\r\nStyle.faint()\r\nStyle.italic()\r\nStyle.underlined()\r\nStyle.slow_blink()\r\nStyle.rapid_blink()\r\nStyle.reverse()\r\nStyle.hidden()\r\nStyle.strikethrough()\r\nStyle.doubly_underlined()\r\nStyle.normal_intensity()\r\nStyle.not_italic()\r\nStyle.not_underlined()\r\nStyle.not_blinking()\r\nStyle.proportional_spacing()\r\nStyle.not_reversed()\r\nStyle.reveal()\r\nStyle.not_strikethrough()\r\nStyle.not_proportional_spacing()\r\nStyle.overlined()\r\nStyle.not_overlined()\r\nStyle.minecraft(*args)\r\n\r\n#coloring\r\nColor.text(*args)\r\nColor.text_gradient(\"text\", color, color)\r\nColor.default_text()\r\nColor.background(*args)\r\nColor.background_gradient(\"text\", color, color)\r\nColor.default_background()\r\nColor.Text.black()\r\nColor.Text.red()\r\nColor.Text.green()\r\nColor.Text.yellow()\r\nColor.Text.blue()\r\nColor.Text.magenta()\r\nColor.Text.cyan()\r\nColor.Text.white()\r\nColor.Text.br_black()\r\nColor.Text.br_red()\r\nColor.Text.br_green()\r\nColor.Text.br_yellow()\r\nColor.Text.br_blue()\r\nColor.Text.br_magenta()\r\nColor.Text.br_cyan()\r\nColor.Text.br_white()\r\nColor.Background.black()\r\nColor.Background.red()\r\nColor.Background.green()\r\nColor.Background.yellow()\r\nColor.Background.blue()\r\nColor.Background.magenta()\r\nColor.Background.cyan()\r\nColor.Background.white()\r\nColor.Background.br_black()\r\nColor.Background.br_red()\r\nColor.Background.br_green()\r\nColor.Background.br_yellow()\r\nColor.Background.br_blue()\r\nColor.Background.br_magenta()\r\nColor.Background.br_cyan()\r\nColor.Background.br_white()\r\n\r\n#some other things (not finished)\r\nConsole.clr_scr_to_end()\r\nConsole.clr_scr_to_begin()\r\nConsole.clr_entire_scr()\r\nConsole.clr_line_to_end()\r\nConsole.clr_line_to_begin()\r\nConsole.clr_entire_line()\r\nConsole.scroll_up(int)\r\nConsole.scroll_down(int)\r\nConsole.bell()\r\nConsole.save_cursor()\r\nConsole.restore_cursor()\r\nConsole.switch_alt_scr()\r\nConsole.switch_orig_scr()\r\nConsole.show_cursor()\r\nConsole.hide_cursor()\r\n```\r\n</details>\r\n\r\n<br>\r\n\r\n## Example usage\r\n\r\n```python\r\nfrom chromaconsole import *\r\n\r\nprint(f\"{Color.Text.red()}here is red colored text{Style.reset()}\")\r\nprint(f\"{Color.text(r, g, b)}here is RGB colored text{Style.reset()}\")\r\nprint(f\"{Color.background(r, g, b)}here is RGB colored background{Style.reset()}\")\r\n\r\nprint(f\"{Color.text('#rrggbb')}here is HEX colored text{Style.reset()}\")\r\nprint(f\"{Color.background('#rrggbb')}here is HEX colored background{Style.reset()}\")\r\n\r\nprint(f\"{Style.bold()}Bold {Style.reset()}\")\r\nprint(f\"{Style.italic()}Italic {Style.reset()}\")\r\nprint(f\"{Style.underlined()}Underlined {Style.reset()}\")\r\nprint(f\"{Style.strikethrough()}Strikethrough {Style.reset()}\")\r\n\r\nprint(f\"{Style.bold()}{Style.italic()}bold+italic {Style.reset()}\")\r\nprint(f\"{Style.minecraft('\u00a7','\u00a7ahello \u00a74world\u00a7r')}\")\r\n```\r\n\r\n<br>\r\n\r\n## .enable() and .disable():\r\n\r\nAfter executing the `Styling.disable()` command, the system will no longer apply coloring and styling to the content. To re-enable these features, simply use the `Styling.enable()` command.\r\n\r\n```python\r\nfrom chromaconsole import Styling\r\n#disable the coloring and styling\r\nStyling.disable()\r\nprint(f\"{Color.text(r, g, b)}text without color and style{Style.reset()}\")\r\nStyling.enable()\r\nprint(f\"{Color.text(r, g, b)}text with color and style{Style.reset()}\")\r\n```\r\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A small colorful module to change text colors in terminal",
    "version": "0.8.6.3",
    "project_urls": {
        "Bug_Tracker": "https://github.com/umittadelen/chromaconsole/issues",
        "Homepage": "https://github.com/umittadelen/chromaconsole"
    },
    "split_keywords": [
        "color",
        " console",
        " terminal",
        " text",
        " style"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "b0efb2631efe22e97706faeb9cabf1d946b67fca38e13e8adba80245f82e21cd",
                "md5": "1d264774df77f35de69617520ecdd7b6",
                "sha256": "7081513b873dff9500fb2426eee921e3fac76af1e9acfd2ee7490ec2cad72975"
            },
            "downloads": -1,
            "filename": "chromaconsole-0.8.6.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1d264774df77f35de69617520ecdd7b6",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3",
            "size": 10652,
            "upload_time": "2024-06-13T06:17:59",
            "upload_time_iso_8601": "2024-06-13T06:17:59.495498Z",
            "url": "https://files.pythonhosted.org/packages/b0/ef/b2631efe22e97706faeb9cabf1d946b67fca38e13e8adba80245f82e21cd/chromaconsole-0.8.6.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "0ce3846f87e46752882deb6c8df05d59034d923ef87ca0fdb5b88e1295f568ba",
                "md5": "66c2f4cb2d66934527129c727758988f",
                "sha256": "d4d09d414b963c8d226b337a5ed6bf7bd98c26efc22f76a89c98634ba363ca8f"
            },
            "downloads": -1,
            "filename": "chromaconsole-0.8.6.3.tar.gz",
            "has_sig": false,
            "md5_digest": "66c2f4cb2d66934527129c727758988f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3",
            "size": 9238,
            "upload_time": "2024-06-13T06:18:01",
            "upload_time_iso_8601": "2024-06-13T06:18:01.379409Z",
            "url": "https://files.pythonhosted.org/packages/0c/e3/846f87e46752882deb6c8df05d59034d923ef87ca0fdb5b88e1295f568ba/chromaconsole-0.8.6.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-06-13 06:18:01",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "umittadelen",
    "github_project": "chromaconsole",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "chromaconsole"
}
        
Elapsed time: 0.31194s