style


Namestyle JSON
Version 1.1.6 PyPI version JSON
download
home_pagehttps://github.com/lmittmann/style
Summary🌈 Terminal string styling
upload_time2019-03-08 14:52:36
maintainer
docs_urlNone
authorlmittmann
requires_python
licenseMIT
keywords style color ansi terminal styling chalk
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI
coveralls test coverage No coveralls.
            style
=====

|Build Status| |PyPI version|

**style** is a simple terminal string styling package. Its API is a port of the popular
`chalk <https://github.com/chalk/chalk>`__ package for javascript.


Install
-------

::

    $ pip install style


Usage
-----

.. code:: py

    import style

    print(style.red('Hello', style.bold('world') + '!'))


API
---

style.\ ``style*[.style](*objects, sep=' ')``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Chain `styles <#styles>`__ and call the last one as a method with an argument. Order doesn't matter, and later styles
take precedence in case of a conflict, e.g. ``style.red.yellow.green`` is equivalent to ``style.green``. Styles can
be nested.

Multiple arguments will be separated by ``sep``, a space by default.

style.\ ``enabled``
~~~~~~~~~~~~~~~~~~~

Color support is automatically detected, but can also be changed manually.

- set ``style.enabled`` to ``True`` or ``False``
- use the command line parameter ``--color`` or ``--no-color``


Styles
------

+---------------------+-------------------------------------+-------------------------------------------+
| Modifiers           | Colors                              | Background colors                         |
+=====================+===============+=====================+==================+========================+
| - ``bold``          | - ``black``   | - ``light_black``   | - ``on_black``   | - ``on_light_black``   |
| - ``dim``           | - ``red``     | - ``light_red``     | - ``on_red``     | - ``on_light_red``     |
| - ``italic``        | - ``green``   | - ``light_green``   | - ``on_green``   | - ``on_light_green``   |
| - ``underline``     | - ``yellow``  | - ``light_yellow``  | - ``on_yellow``  | - ``on_light_yellow``  |
| - ``inverse``       | - ``blue``    | - ``light_blue``    | - ``on_blue``    | - ``on_light_blue``    |
| - ``hidden``        | - ``magenta`` | - ``light_magenta`` | - ``on_magenta`` | - ``on_light_magenta`` |
| - ``strikethrough`` | - ``cyan``    | - ``light_cyan``    | - ``on_cyan``    | - ``on_light_cyan``    |
|                     | - ``white``   | - ``light_white``   | - ``on_white``   | - ``on_light_white``   |
+---------------------+---------------+---------------------+------------------+------------------------+


.. |Build Status| image:: https://travis-ci.com/lmittmann/style.svg?branch=master
    :target: https://travis-ci.com/lmittmann/style
.. |PyPI version| image:: https://img.shields.io/pypi/v/style.svg
    :target: https://pypi.org/project/style



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/lmittmann/style",
    "name": "style",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "style,color,ansi,terminal styling,chalk",
    "author": "lmittmann",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/c0/37/6e922b8b02286383d01ca8535bf615adc7ba32120f06e8c4e48f149b6b2a/style-1.1.6.tar.gz",
    "platform": "",
    "description": "style\n=====\n\n|Build Status| |PyPI version|\n\n**style** is a simple terminal string styling package. Its API is a port of the popular\n`chalk <https://github.com/chalk/chalk>`__ package for javascript.\n\n\nInstall\n-------\n\n::\n\n    $ pip install style\n\n\nUsage\n-----\n\n.. code:: py\n\n    import style\n\n    print(style.red('Hello', style.bold('world') + '!'))\n\n\nAPI\n---\n\nstyle.\\ ``style*[.style](*objects, sep=' ')``\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nChain `styles <#styles>`__ and call the last one as a method with an argument. Order doesn't matter, and later styles\ntake precedence in case of a conflict, e.g. ``style.red.yellow.green`` is equivalent to ``style.green``. Styles can\nbe nested.\n\nMultiple arguments will be separated by ``sep``, a space by default.\n\nstyle.\\ ``enabled``\n~~~~~~~~~~~~~~~~~~~\n\nColor support is automatically detected, but can also be changed manually.\n\n- set ``style.enabled`` to ``True`` or ``False``\n- use the command line parameter ``--color`` or ``--no-color``\n\n\nStyles\n------\n\n+---------------------+-------------------------------------+-------------------------------------------+\n| Modifiers           | Colors                              | Background colors                         |\n+=====================+===============+=====================+==================+========================+\n| - ``bold``          | - ``black``   | - ``light_black``   | - ``on_black``   | - ``on_light_black``   |\n| - ``dim``           | - ``red``     | - ``light_red``     | - ``on_red``     | - ``on_light_red``     |\n| - ``italic``        | - ``green``   | - ``light_green``   | - ``on_green``   | - ``on_light_green``   |\n| - ``underline``     | - ``yellow``  | - ``light_yellow``  | - ``on_yellow``  | - ``on_light_yellow``  |\n| - ``inverse``       | - ``blue``    | - ``light_blue``    | - ``on_blue``    | - ``on_light_blue``    |\n| - ``hidden``        | - ``magenta`` | - ``light_magenta`` | - ``on_magenta`` | - ``on_light_magenta`` |\n| - ``strikethrough`` | - ``cyan``    | - ``light_cyan``    | - ``on_cyan``    | - ``on_light_cyan``    |\n|                     | - ``white``   | - ``light_white``   | - ``on_white``   | - ``on_light_white``   |\n+---------------------+---------------+---------------------+------------------+------------------------+\n\n\n.. |Build Status| image:: https://travis-ci.com/lmittmann/style.svg?branch=master\n    :target: https://travis-ci.com/lmittmann/style\n.. |PyPI version| image:: https://img.shields.io/pypi/v/style.svg\n    :target: https://pypi.org/project/style\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "\ud83c\udf08 Terminal string styling",
    "version": "1.1.6",
    "split_keywords": [
        "style",
        "color",
        "ansi",
        "terminal styling",
        "chalk"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "md5": "986dcb5f1e8f1a7032a2de8f49ee4379",
                "sha256": "48deb552717e4a38e607e5c667b89f07f4eca5bce94dbaabb66707bf395a2eb6"
            },
            "downloads": -1,
            "filename": "style-1.1.6-py2.py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "986dcb5f1e8f1a7032a2de8f49ee4379",
            "packagetype": "bdist_wheel",
            "python_version": "py2.py3",
            "requires_python": null,
            "size": 5180,
            "upload_time": "2019-03-08T14:52:35",
            "upload_time_iso_8601": "2019-03-08T14:52:35.873580Z",
            "url": "https://files.pythonhosted.org/packages/20/06/ba0ecadb5d0d7b25505dc650c5c454c5448165b01e04ac4f207816623b8c/style-1.1.6-py2.py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "md5": "9f60530598a417850445ffbad7e5006a",
                "sha256": "d0ad01f3688b83e7fcbb305123df26f7018adf41babe2c12e4b9a68d4e598eb5"
            },
            "downloads": -1,
            "filename": "style-1.1.6.tar.gz",
            "has_sig": false,
            "md5_digest": "9f60530598a417850445ffbad7e5006a",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 3557,
            "upload_time": "2019-03-08T14:52:36",
            "upload_time_iso_8601": "2019-03-08T14:52:36.999210Z",
            "url": "https://files.pythonhosted.org/packages/c0/37/6e922b8b02286383d01ca8535bf615adc7ba32120f06e8c4e48f149b6b2a/style-1.1.6.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2019-03-08 14:52:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "github_user": "lmittmann",
    "github_project": "style",
    "travis_ci": true,
    "coveralls": false,
    "github_actions": false,
    "lcname": "style"
}
        
Elapsed time: 0.15486s