.. contents:: **tcolorpy**
:backlinks: top
:depth: 2
Summary
============================================
tcolopy is a Python library to apply true color for terminal text.
|PyPI pkg ver| |conda pkg ver| |Supported Python implementations| |Supported Python versions| |CI status| |CodeQL| |coverage|
.. |PyPI pkg ver| image:: https://badge.fury.io/py/tcolorpy.svg
:target: https://badge.fury.io/py/tcolorpy
:alt: PyPI package version
.. |conda pkg ver| image:: https://anaconda.org/conda-forge/tcolorpy/badges/version.svg
:target: https://anaconda.org/conda-forge/tcolorpy
:alt: conda-forge package version
.. |Supported Python implementations| image:: https://img.shields.io/pypi/implementation/tcolorpy.svg
:target: https://pypi.org/project/tcolorpy
:alt: Supported Python implementations
.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/tcolorpy.svg
:target: https://pypi.org/project/tcolorpy
:alt: Supported Python versions
.. |CI status| image:: https://github.com/thombashi/tcolorpy/actions/workflows/ci.yml/badge.svg
:target: https://github.com/thombashi/tcolorpy/actions/workflows/ci.yml
:alt: CI status of Linux/macOS/Windows
.. |CodeQL| image:: https://github.com/thombashi/tcolorpy/actions/workflows/github-code-scanning/codeql/badge.svg
:target: https://github.com/thombashi/tcolorpy/actions/workflows/github-code-scanning/codeql
:alt: CodeQL
.. |coverage| image:: https://coveralls.io/repos/github/thombashi/tcolorpy/badge.svg?branch=master
:target: https://coveralls.io/github/thombashi/tcolorpy?branch=master
:alt: Test coverage: coveralls
Installation
============================================
Installation: pip
------------------------------
::
pip install tcolorpy
Installation: conda
------------------------------
::
conda install -c conda-forge tcolorpy
Usage
============================================
Library usage
--------------------------------------------
:Sample Code:
.. code-block:: python
from tcolorpy import tcolor
print(tcolor("tcolopy example", color="#ee1177", styles=["bold", "italic", "underline"]))
:Output:
.. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/oneline.png
:scale: 60%
:alt: https://github.com/thombashi/tcolorpy/blob/master/ss/oneline.png
You can set the following ``tcolor`` arguments:
- ``color``/``bg_color``
- color names (``"red"``, ``"green"``, etc.) or color code (``"#RRGGBB"``)
- ``styles``
- ``"bold"``, ``"italic"``, etc.
Other examples
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Apply true color and styles to text:
.. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/styles.png
:scale: 60%
:alt: https://github.com/thombashi/tcolorpy/blob/master/ss/styles.png
`example source code <https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_styles.py>`__
You can also specify colors by name:
.. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/ansi_colors.png
:scale: 60%
:alt: https://github.com/thombashi/tcolorpy/blob/master/ss/ansi_colors.png
`example source code <https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_colors.py>`__
CLI usage
--------------------------------------------
``tcolorpy`` can be used via CLI:
::
$ python3 -m tcolorpy "tcolopy example" -c "#ee1177" -s bold,italic,underline
Command help
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
::
usage: __main__.py [-h] [-c COLOR] [-b BG_COLOR] [-s STYLES] [--encode ENCODE] string
positional arguments:
string string to apply styles.
options:
-h, --help show this help message and exit
-c COLOR, --color COLOR
specify a color code (#XXXXXX) or a name. valid names are: black, red, green, yellow, blue, magenta, cyan, white, lightblack, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, lightwhite
-b BG_COLOR, --bg-color BG_COLOR
specify a background color code (#XXXXXX) or a name. valid names are: black, red, green, yellow, blue, magenta, cyan, white, lightblack, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, lightwhite
-s STYLES, --styles STYLES
specify a comma-separated style. valid values are: bold, dim, italic, underline, blink, invert, strike
--encode ENCODE output a text encoded with the specified encoding
Dependencies
============================================
Python 3.7+
no external dependencies.
Raw data
{
"_id": null,
"home_page": "https://github.com/thombashi/tcolorpy",
"name": "tcolorpy",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.7",
"maintainer_email": null,
"keywords": "ANSI escape, terminal color, truecolor",
"author": "Tsuyoshi Hombashi",
"author_email": "tsuyoshi.hombashi@gmail.com",
"download_url": "https://files.pythonhosted.org/packages/af/f6/b17885354c5addfb93c14f3ed7172c33494f989dd5f83c0340d2c8fa3b69/tcolorpy-0.1.6.tar.gz",
"platform": null,
"description": ".. contents:: **tcolorpy**\n :backlinks: top\n :depth: 2\n\n\nSummary\n============================================\ntcolopy is a Python library to apply true color for terminal text.\n\n|PyPI pkg ver| |conda pkg ver| |Supported Python implementations| |Supported Python versions| |CI status| |CodeQL| |coverage|\n\n.. |PyPI pkg ver| image:: https://badge.fury.io/py/tcolorpy.svg\n :target: https://badge.fury.io/py/tcolorpy\n :alt: PyPI package version\n\n.. |conda pkg ver| image:: https://anaconda.org/conda-forge/tcolorpy/badges/version.svg\n :target: https://anaconda.org/conda-forge/tcolorpy\n :alt: conda-forge package version\n\n.. |Supported Python implementations| image:: https://img.shields.io/pypi/implementation/tcolorpy.svg\n :target: https://pypi.org/project/tcolorpy\n :alt: Supported Python implementations\n\n.. |Supported Python versions| image:: https://img.shields.io/pypi/pyversions/tcolorpy.svg\n :target: https://pypi.org/project/tcolorpy\n :alt: Supported Python versions\n\n.. |CI status| image:: https://github.com/thombashi/tcolorpy/actions/workflows/ci.yml/badge.svg\n :target: https://github.com/thombashi/tcolorpy/actions/workflows/ci.yml\n :alt: CI status of Linux/macOS/Windows\n\n.. |CodeQL| image:: https://github.com/thombashi/tcolorpy/actions/workflows/github-code-scanning/codeql/badge.svg\n :target: https://github.com/thombashi/tcolorpy/actions/workflows/github-code-scanning/codeql\n :alt: CodeQL\n\n.. |coverage| image:: https://coveralls.io/repos/github/thombashi/tcolorpy/badge.svg?branch=master\n :target: https://coveralls.io/github/thombashi/tcolorpy?branch=master\n :alt: Test coverage: coveralls\n\n\nInstallation\n============================================\n\nInstallation: pip\n------------------------------\n::\n\n pip install tcolorpy\n\nInstallation: conda\n------------------------------\n::\n\n conda install -c conda-forge tcolorpy\n\n\nUsage\n============================================\n\nLibrary usage\n--------------------------------------------\n\n:Sample Code:\n .. code-block:: python\n\n from tcolorpy import tcolor\n\n print(tcolor(\"tcolopy example\", color=\"#ee1177\", styles=[\"bold\", \"italic\", \"underline\"]))\n\n:Output:\n .. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/oneline.png\n :scale: 60%\n :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/oneline.png\n\nYou can set the following ``tcolor`` arguments:\n\n- ``color``/``bg_color``\n - color names (``\"red\"``, ``\"green\"``, etc.) or color code (``\"#RRGGBB\"``)\n- ``styles``\n - ``\"bold\"``, ``\"italic\"``, etc.\n\n\nOther examples\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\nApply true color and styles to text:\n\n.. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/styles.png\n :scale: 60%\n :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/styles.png\n\n `example source code <https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_styles.py>`__\n\nYou can also specify colors by name:\n\n.. figure:: https://cdn.jsdelivr.net/gh/thombashi/tcolorpy@master/ss/ansi_colors.png\n :scale: 60%\n :alt: https://github.com/thombashi/tcolorpy/blob/master/ss/ansi_colors.png\n\n `example source code <https://github.com/thombashi/tcolorpy/blob/master/examples/ansi_colors.py>`__\n\n\nCLI usage\n--------------------------------------------\n``tcolorpy`` can be used via CLI:\n\n::\n\n $ python3 -m tcolorpy \"tcolopy example\" -c \"#ee1177\" -s bold,italic,underline\n\nCommand help\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n::\n\n usage: __main__.py [-h] [-c COLOR] [-b BG_COLOR] [-s STYLES] [--encode ENCODE] string\n\n positional arguments:\n string string to apply styles.\n\n options:\n -h, --help show this help message and exit\n -c COLOR, --color COLOR\n specify a color code (#XXXXXX) or a name. valid names are: black, red, green, yellow, blue, magenta, cyan, white, lightblack, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, lightwhite\n -b BG_COLOR, --bg-color BG_COLOR\n specify a background color code (#XXXXXX) or a name. valid names are: black, red, green, yellow, blue, magenta, cyan, white, lightblack, lightred, lightgreen, lightyellow, lightblue, lightmagenta, lightcyan, lightwhite\n -s STYLES, --styles STYLES\n specify a comma-separated style. valid values are: bold, dim, italic, underline, blink, invert, strike\n --encode ENCODE output a text encoded with the specified encoding\n\n\nDependencies\n============================================\nPython 3.7+\nno external dependencies.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "tcolopy is a Python library to apply true color for terminal text.",
"version": "0.1.6",
"project_urls": {
"Changlog": "https://github.com/thombashi/tcolorpy/blob/master/CHANGELOG.md",
"Homepage": "https://github.com/thombashi/tcolorpy",
"Source": "https://github.com/thombashi/tcolorpy",
"Tracker": "https://github.com/thombashi/tcolorpy/issues"
},
"split_keywords": [
"ansi escape",
" terminal color",
" truecolor"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "9e0f3571e551b524b3d3ddfa7fd3ec8065941faf4ae1278efefcef976d93587c",
"md5": "4c2e10d1972b6debc3cb576557f868e6",
"sha256": "8c15cb3167f30b0a433d72297e9d68667c825bd9e2af41c8dd7dfbd3d7f7e207"
},
"downloads": -1,
"filename": "tcolorpy-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "4c2e10d1972b6debc3cb576557f868e6",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.7",
"size": 8111,
"upload_time": "2024-04-27T16:14:20",
"upload_time_iso_8601": "2024-04-27T16:14:20.685594Z",
"url": "https://files.pythonhosted.org/packages/9e/0f/3571e551b524b3d3ddfa7fd3ec8065941faf4ae1278efefcef976d93587c/tcolorpy-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "aff6b17885354c5addfb93c14f3ed7172c33494f989dd5f83c0340d2c8fa3b69",
"md5": "a4a8404d2b6ecfae4eeca8c71e4634c6",
"sha256": "8cea0bf5f8cf03f77528a9acfbf312df935573892ba5ea3b2516e61fa54de9a5"
},
"downloads": -1,
"filename": "tcolorpy-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "a4a8404d2b6ecfae4eeca8c71e4634c6",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.7",
"size": 298986,
"upload_time": "2024-04-27T16:14:22",
"upload_time_iso_8601": "2024-04-27T16:14:22.395487Z",
"url": "https://files.pythonhosted.org/packages/af/f6/b17885354c5addfb93c14f3ed7172c33494f989dd5f83c0340d2c8fa3b69/tcolorpy-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-04-27 16:14:22",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "thombashi",
"github_project": "tcolorpy",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "tcolorpy"
}