quickcolor


Namequickcolor JSON
Version 0.1.3 PyPI version JSON
download
home_pageNone
SummaryAscii text color code tagging for python prints and logs
upload_time2024-10-14 01:47:11
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseNone
keywords util utility
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # QuickColor

**QuickColor** is a Python library providing tags for color formatting sections of printable content. The tags can be flexibly used as part of any string as they simply resolve to the ASCII color codes interpreted by your terminal or terminal emulator.

## Installation

Use the package manager [pip](https://pip.pypa.io/en/stable/) to install **quickcolor**.

```bash
pip install quickcolor
```


## Library Usage For Color Application
```python
from quickcolor.color_def import color

# colorize printable content
print(f"{color.CGREEN2}This text is bold green{color.CEND}")
```
```python
from quickcolor.color_def import colors

# alternate method to colorize printable content
print(f"Formatting this phrase part to {colors.fg.yellow}display yellow{colors.off}")
```


## Library Usage For Color Stripping
```python
from quickcolor.color_filter import strip_ansi_esc_sequences_from_string

testString = f'{color.CYELLOW2}Yellow String!{color.CEND}'
print(testString)
print(f'No longer a {strip_ansi_esc_sequences_from_string(testString)}')
```
```python
from quickcolor.color_filter import strip_ansi_esc_sequences_from_input

testString = f'{color.CBLUE2}Blue String!{color.CEND}'
testBytes = testString.encode(encoding="utf-8")
print(testString)
print(testBytes)
print(f'No longer a {strip_ansi_esc_sequences_from_input(stringOrBytes = testBytes)}')
```


## CLI Utility

The following CLI is included with this package for visualizing available color fields and code combinations.

```bash
# qc -h
usage: qc [-h] {shell.colors,color.fields,strip.color.string,strip.color.input} ...

-.-.-. Color attributes for python scripts

positional arguments:
  {shell.colors,color.fields,strip.color.string,strip.color.input}
    shell.colors        display a color chart for current shell
    color.fields        display class color fields
    strip.color.string  strip color codes from a string
    strip.color.input   strip color codes from a byte input

options:
  -h, --help            show this help message and exit

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.
```


## License

[MIT](https://choosealicense.com/licenses/mit/)

## Acknowledgements
Inspiration for the color names came from [this StackOverflow reply](https://stackoverflow.com/a/39452138).
The color grid method inspiration came from [this StackOverflow reply](https://stackoverflow.com/a/21786287).
The regex content for the strip methods are also floting around StackOverflow.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "quickcolor",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": "Ed Waldner <waldevburry@proton.me>",
    "keywords": "util, utility",
    "author": null,
    "author_email": "Ed Waldner <waldevburry@proton.me>",
    "download_url": "https://files.pythonhosted.org/packages/9c/6e/0d116178ef531093a71db23dc26614edf0714842a4c3a2f2dc45c5ba9a6c/quickcolor-0.1.3.tar.gz",
    "platform": null,
    "description": "# QuickColor\n\n**QuickColor** is a Python library providing tags for color formatting sections of printable content. The tags can be flexibly used as part of any string as they simply resolve to the ASCII color codes interpreted by your terminal or terminal emulator.\n\n## Installation\n\nUse the package manager [pip](https://pip.pypa.io/en/stable/) to install **quickcolor**.\n\n```bash\npip install quickcolor\n```\n\n\n## Library Usage For Color Application\n```python\nfrom quickcolor.color_def import color\n\n# colorize printable content\nprint(f\"{color.CGREEN2}This text is bold green{color.CEND}\")\n```\n```python\nfrom quickcolor.color_def import colors\n\n# alternate method to colorize printable content\nprint(f\"Formatting this phrase part to {colors.fg.yellow}display yellow{colors.off}\")\n```\n\n\n## Library Usage For Color Stripping\n```python\nfrom quickcolor.color_filter import strip_ansi_esc_sequences_from_string\n\ntestString = f'{color.CYELLOW2}Yellow String!{color.CEND}'\nprint(testString)\nprint(f'No longer a {strip_ansi_esc_sequences_from_string(testString)}')\n```\n```python\nfrom quickcolor.color_filter import strip_ansi_esc_sequences_from_input\n\ntestString = f'{color.CBLUE2}Blue String!{color.CEND}'\ntestBytes = testString.encode(encoding=\"utf-8\")\nprint(testString)\nprint(testBytes)\nprint(f'No longer a {strip_ansi_esc_sequences_from_input(stringOrBytes = testBytes)}')\n```\n\n\n## CLI Utility\n\nThe following CLI is included with this package for visualizing available color fields and code combinations.\n\n```bash\n# qc -h\nusage: qc [-h] {shell.colors,color.fields,strip.color.string,strip.color.input} ...\n\n-.-.-. Color attributes for python scripts\n\npositional arguments:\n  {shell.colors,color.fields,strip.color.string,strip.color.input}\n    shell.colors        display a color chart for current shell\n    color.fields        display class color fields\n    strip.color.string  strip color codes from a string\n    strip.color.input   strip color codes from a byte input\n\noptions:\n  -h, --help            show this help message and exit\n\n-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.\n```\n\n\n## License\n\n[MIT](https://choosealicense.com/licenses/mit/)\n\n## Acknowledgements\nInspiration for the color names came from [this StackOverflow reply](https://stackoverflow.com/a/39452138).\nThe color grid method inspiration came from [this StackOverflow reply](https://stackoverflow.com/a/21786287).\nThe regex content for the strip methods are also floting around StackOverflow.\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Ascii text color code tagging for python prints and logs",
    "version": "0.1.3",
    "project_urls": {
        "Documentation": "https://github.com/ew98/quickcolor/wiki/QuickColor",
        "Homepage": "https://github.com/ew98/quickcolor",
        "Issues": "https://github.com/ew98/quickcolor/issues"
    },
    "split_keywords": [
        "util",
        " utility"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "05186ef4b2da5df8ff4a3b423b791ee3858e91d4dcd24880cdb033a2d2130840",
                "md5": "f9226bac1c3295e2e65501aeb5c808ef",
                "sha256": "253f39e9876b8eef0a0bf697d4cde984321e777693a0dcb8145117c82ee1135e"
            },
            "downloads": -1,
            "filename": "quickcolor-0.1.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f9226bac1c3295e2e65501aeb5c808ef",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 7347,
            "upload_time": "2024-10-14T01:47:10",
            "upload_time_iso_8601": "2024-10-14T01:47:10.555586Z",
            "url": "https://files.pythonhosted.org/packages/05/18/6ef4b2da5df8ff4a3b423b791ee3858e91d4dcd24880cdb033a2d2130840/quickcolor-0.1.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "9c6e0d116178ef531093a71db23dc26614edf0714842a4c3a2f2dc45c5ba9a6c",
                "md5": "573701281b4e734682a254351aa59b89",
                "sha256": "15fa9009c2afd04c8854e6dc26329ae73331771f136decd6bb1e45c0f9ef3fe2"
            },
            "downloads": -1,
            "filename": "quickcolor-0.1.3.tar.gz",
            "has_sig": false,
            "md5_digest": "573701281b4e734682a254351aa59b89",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7030,
            "upload_time": "2024-10-14T01:47:11",
            "upload_time_iso_8601": "2024-10-14T01:47:11.898139Z",
            "url": "https://files.pythonhosted.org/packages/9c/6e/0d116178ef531093a71db23dc26614edf0714842a4c3a2f2dc45c5ba9a6c/quickcolor-0.1.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-10-14 01:47:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ew98",
    "github_project": "quickcolor",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "quickcolor"
}
        
Elapsed time: 7.01002s