{ "info": { "author": "@Robpol86", "author_email": "robpol86@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Environment :: MacOS X", "Environment :: Win32 (MS Windows)", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: POSIX", "Operating System :: POSIX :: Linux", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries", "Topic :: Terminals", "Topic :: Text Processing :: Markup" ], "description": "==========\ncolorclass\n==========\n\nYet another ANSI color text library for Python. Provides \"auto colors\" for dark/light terminals. Works on Linux, OS X,\nand Windows. For Windows support you just need to call ``Windows.enable()`` in your application.\n\nOn Linux/OS X ``autocolors`` are toggled by calling ``set_light_background()`` and ``set_dark_background()``. On Windows\nthis can be done automatically if you call ``Windows.enable(auto_colors=True)``. Even though the latest Windows 10 does\nsupport ANSI color codes natively, you still need to run Windows.enable() to take advantage of automatically detecting\nthe console's background color.\n\nIn Python2.x this library subclasses ``unicode``, while on Python3.x it subclasses ``str``.\n\n* Python 2.6, 2.7, PyPy, PyPy3, 3.3, 3.4, and 3.5 supported on Linux and OS X.\n* Python 2.6, 2.7, 3.3, 3.4, and 3.5 supported on Windows (both 32 and 64 bit versions of Python).\n\n.. image:: https://img.shields.io/appveyor/ci/Robpol86/colorclass/master.svg?style=flat-square&label=AppVeyor%20CI\n :target: https://ci.appveyor.com/project/Robpol86/colorclass\n :alt: Build Status Windows\n\n.. image:: https://img.shields.io/travis/Robpol86/colorclass/master.svg?style=flat-square&label=Travis%20CI\n :target: https://travis-ci.org/Robpol86/colorclass\n :alt: Build Status\n\n.. image:: https://img.shields.io/coveralls/Robpol86/colorclass/master.svg?style=flat-square&label=Coveralls\n :target: https://coveralls.io/github/Robpol86/colorclass\n :alt: Coverage Status\n\n.. image:: https://img.shields.io/pypi/v/colorclass.svg?style=flat-square&label=Latest\n :target: https://pypi.python.org/pypi/colorclass\n :alt: Latest Version\n\n.. image:: https://img.shields.io/pypi/dm/colorclass.svg?style=flat-square&label=PyPI%20Downloads\n :target: https://pypi.python.org/pypi/colorclass\n :alt: Downloads\n\nQuickstart\n==========\n\nInstall:\n\n.. code:: bash\n\n pip install colorclass\n\nPiped Command Line\n==================\n\nIt is possible to pipe curly-bracket tagged (or regular ANSI coded) text to Python in the command line to produce color\ntext. Some examples:\n\n.. code:: bash\n\n echo \"{red}Red{/red}\" |python -m colorclass # Red colored text.\n echo -e \"\\033[31mRed\\033[0m\" | COLOR_DISABLE=true python -m colorclass # Strip colors\n echo -e \"\\033[31mRed\\033[0m\" | COLOR_ENABLE=true python -m colorclass &> file.txt # Force colors.\n\nExport these environment variables as \"true\" to enable/disable some features:\n\n=============== ============================================\nEnv Variable Description\n=============== ============================================\nCOLOR_ENABLE Force colors even when piping to a file.\nCOLOR_DISABLE Strip all colors from incoming text.\nCOLOR_LIGHT Use light colored text for dark backgrounds.\nCOLOR_DARK Use dark colored text for light backgrounds.\n=============== ============================================\n\nExample Implementation\n======================\n\n.. image:: https://github.com/Robpol86/colorclass/raw/master/example.png?raw=true\n :alt: Example Script Screenshot\n\n.. image:: https://github.com/Robpol86/colorclass/raw/master/example_windows.png?raw=true\n :alt: Example Windows Screenshot\n\nSource code for the example code is: `example.py `_\n\nUsage\n=====\n\nDifferent colors are chosen using curly-bracket tags, such as ``{red}{/red}``. For a list of available colors, call\n``colorclass.list_tags()``.\n\nThe available \"auto colors\" tags are:\n\n* autoblack\n* autored\n* autogreen\n* autoyellow\n* autoblue\n* automagenta\n* autocyan\n* autowhite\n* autobgblack\n* autobgred\n* autobggreen\n* autobgyellow\n* autobgblue\n* autobgmagenta\n* autobgcyan\n* autobgwhite\n\nMethods of Class instances try to return sane data, such as:\n\n.. code:: python\n\n from colorclass import Color\n color_string = Color('{red}Test{/red}')\n\n color_string\n u'\\x1b[31mTest\\x1b[39m'\n\n len(color_string)\n 4\n\n color_string.istitle()\n True\n\nThere are also a couple of helper attributes for all Color instances:\n\n.. code:: python\n\n color_string.value_colors\n '\\x1b[31mTest\\x1b[39m'\n\n color_string.value_no_colors\n 'Test'\n\nChangelog\n=========\n\nThis project adheres to `Semantic Versioning `_.\n\n2.2.0 - 2016-05-14\n------------------\n\nAdded\n * ``disable_if_no_tty()`` function to conditionally disable colors when STDERR and STDOUT are not streams.\n\nChanged\n * Colors enabled by default always, like it was before v2.0.0.\n\n2.1.1 - 2016-05-10\n------------------\n\nFixed\n * Printing box drawing characters on Windows from Python 2.6.\n\n2.1.0 - 2016-05-07\n------------------\n\nAdded\n * ``keep_tags`` boolean keyword argument to Color(). Prevents colorclass from parsing curly brackets.\n * Automatically skip replacing stderr/stdout streams on latest Windows 10 versions with native ANSI color support.\n\nChanged\n * Refactored most of windows.py.\n * Background color determined from either stderr or stdout, instead of just one stream (e.g. piping stderr to file).\n\nFixed\n * https://github.com/Robpol86/colorclass/issues/16\n * https://github.com/Robpol86/colorclass/issues/18\n\n2.0.0 - 2016-04-10\n------------------\n\nAdded\n * Python 3.5 support.\n * ``enable_all_colors()``, ``is_enabled()``, and ``is_light()`` toggle functions.\n * Library can be used as a script (e.g. ``echo \"{red}Red{/red}\" |python -m colorclass``).\n * Ability to add/multiply Color instances just like str.\n * Ability to iterate a Color instance and have each character keep its color codes.\n\nChanged\n * Converted library from Python module to a package.\n * ``set_light_background()`` and ``set_dark_background()`` no longer enable colors. Use ``enable_all_colors()``.\n * Colors are disabled by default when STDERR and STDOUT are not streams (piped to files/null). Similar to ``grep``.\n * Reduce size of ANSI escape sequences by removing codes that have no effect. e.g. ``\\033[31;35m`` to ``\\033[35m``.\n * Color methods that return strings now return Color instances instead of str instances.\n\nFixed\n * https://github.com/Robpol86/colorclass/issues/15\n * https://github.com/Robpol86/colorclass/issues/17\n\n1.2.0 - 2015-03-19\n------------------\n\nAdded\n * Convenience single-color methods by `Marc Abramowitz `_.\n\n1.1.2 - 2015-01-07\n------------------\n\nFixed\n * Maintaining ``Color`` type through ``.encode()`` and ``.decode()`` chains.\n\n1.1.1 - 2014-11-03\n------------------\n\nFixed\n * Python 2.7 64-bit original colors bug on Windows.\n * resetting colors when ``reset_atexit`` is True.\n * Improved sorting of ``list_tags()``.\n\n1.1.0 - 2014-11-01\n------------------\n\nAdded\n * Native Windows support and automatic background colors.\n\n1.0.2 - 2014-10-20\n------------------\n\nAdded\n * Ability to disable/strip out all colors.\n\n1.0.1 - 2014-09-11\n------------------\n\nFixed\n * ``splitlines()`` method.\n\n1.0.0 - 2014-09-01\n------------------\n\n* Initial release.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/Robpol86/colorclass", "keywords": "Shell Bash ANSI ASCII terminal console colors automatic", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "colorclass", "package_url": "https://pypi.org/project/colorclass/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/colorclass/", "project_urls": { "Homepage": "https://github.com/Robpol86/colorclass" }, "release_url": "https://pypi.org/project/colorclass/2.2.0/", "requires_dist": null, "requires_python": "", "summary": "Colorful worry-free console applications for Linux, Mac OS X, and Windows.", "version": "2.2.0" }, "last_serial": 2116128, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "a875ea50176a7a120132199d0bed33e7", "sha256": "d2ad6a947ceb48aba25a43bff3d2baf8c08a822474aa4d12fb54a49557bfb689" }, "downloads": -1, "filename": "colorclass-1.0.0.tar.gz", "has_sig": false, "md5_digest": "a875ea50176a7a120132199d0bed33e7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6072, "upload_time": "2014-09-01T22:35:40", "url": "https://files.pythonhosted.org/packages/25/01/f28cdbfa3447a042d3426d0a547813c26a2079dac1ab9dbf5d6383f14683/colorclass-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "23445df818711fbc07ea6ac54061151c", "sha256": "397f59ae3ecaa978f4b23b59aea78d71032758ed6c229e177ba58fd23ca6f147" }, "downloads": -1, "filename": "colorclass-1.0.1.tar.gz", "has_sig": false, "md5_digest": "23445df818711fbc07ea6ac54061151c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6253, "upload_time": "2014-09-11T20:12:28", "url": "https://files.pythonhosted.org/packages/a3/9b/63567084dbfb29dd007f2cf415bd5db655b90b2d04956133a09cff242165/colorclass-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "96b23cacba2d7828f922f2ad6cf46ed2", "sha256": "b50bfb904789b5fc6bef04820d46fb39eb0943de5d439fb75e4020eb7b99021e" }, "downloads": -1, "filename": "colorclass-1.0.2.tar.gz", "has_sig": false, "md5_digest": "96b23cacba2d7828f922f2ad6cf46ed2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6376, "upload_time": "2014-10-21T03:25:24", "url": "https://files.pythonhosted.org/packages/ca/9e/a562e93447c28bc6841fbb7906f2e6f8bf4fda229eeaac5cf6a0383dcbf7/colorclass-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "d96f73d4989bf09328f429c9e949f881", "sha256": "6837c7923ebf8ef25ee216d7557943ff2d7e0085e6ae2e55f936c6da6b06ea3a" }, "downloads": -1, "filename": "colorclass-1.1.0.tar.gz", "has_sig": false, "md5_digest": "d96f73d4989bf09328f429c9e949f881", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11309, "upload_time": "2014-11-02T01:18:23", "url": "https://files.pythonhosted.org/packages/30/b5/77a9ea43725e3ce53c5d3f91a81f965ee70b5909d86c49fa4c64d322645a/colorclass-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "aad4b44de429461f5739a615b8bcda7c", "sha256": "42e7fd65251cf9875b0189b889d6420a567e6a33ea80157f81f6094c2d2d85cc" }, "downloads": -1, "filename": "colorclass-1.1.1.tar.gz", "has_sig": false, "md5_digest": "aad4b44de429461f5739a615b8bcda7c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12639, "upload_time": "2014-11-04T04:33:27", "url": "https://files.pythonhosted.org/packages/9c/b9/33b2691396cffe7029e2513d8ce0aa4b750f446520431b506b722d7726ab/colorclass-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "d045675bd178c8e6fd3dcd0b992bdac4", "sha256": "00e0ee013674487f7eefcfe0aebbcde93781240e3d9f31e74ce78660dfb93e13" }, "downloads": -1, "filename": "colorclass-1.1.2.tar.gz", "has_sig": false, "md5_digest": "d045675bd178c8e6fd3dcd0b992bdac4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13079, "upload_time": "2015-01-08T04:10:25", "url": "https://files.pythonhosted.org/packages/67/fe/88fbc158f44a36e59f6590ccdb420c01fe2ee0a6dd5017648d5570aac6ac/colorclass-1.1.2.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "190754d4698f97c3a90c518410e359f0", "sha256": "2fb10c87aa2a242d8a8467136d68a3e266a5b7b545bc88bd1585e663c87ef584" }, "downloads": -1, "filename": "colorclass-1.2.0.tar.gz", "has_sig": false, "md5_digest": "190754d4698f97c3a90c518410e359f0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13332, "upload_time": "2015-03-20T06:24:50", "url": "https://files.pythonhosted.org/packages/26/37/88a4855ee9c1334592c503f161317c845c7961fa67a648f60037c00200b6/colorclass-1.2.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "87773d950bfc5a83cf51a3b66ac7c29e", "sha256": "9997db1dc84a4d8e03223ac9db1f52c5f349890e2cdbc9ad4f9bf9280c428b71" }, "downloads": -1, "filename": "colorclass-2.0.0.tar.gz", "has_sig": false, "md5_digest": "87773d950bfc5a83cf51a3b66ac7c29e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16128, "upload_time": "2016-04-10T22:14:48", "url": "https://files.pythonhosted.org/packages/4e/c5/dc6d0d0adc33cef70068cf8a7b3b24744cf3576a3e0e3d91a0548d16226f/colorclass-2.0.0.tar.gz" } ], "2.1.0": [ { "comment_text": "", "digests": { "md5": "176fc86b97478b1ef56122565c178224", "sha256": "a4a56006e98e25183d32781cd3e64b49b4813f6d59677df364c8ae680c7ab1cf" }, "downloads": -1, "filename": "colorclass-2.1.0.tar.gz", "has_sig": false, "md5_digest": "176fc86b97478b1ef56122565c178224", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16859, "upload_time": "2016-05-08T02:46:20", "url": "https://files.pythonhosted.org/packages/7a/e3/232229220db4436670f6496f62bf72db8886320391767daa7a7c5ec89059/colorclass-2.1.0.tar.gz" } ], "2.1.1": [ { "comment_text": "", "digests": { "md5": "2cda3cfd38230ebba3ce331cf8d71ee3", "sha256": "ac65283485645cc4c137eef37d5d46453925d965ff937a26343a36746925cc7e" }, "downloads": -1, "filename": "colorclass-2.1.1.tar.gz", "has_sig": false, "md5_digest": "2cda3cfd38230ebba3ce331cf8d71ee3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16837, "upload_time": "2016-05-12T03:21:04", "url": "https://files.pythonhosted.org/packages/b9/62/7c0ca545c593dd92ebbf89b20e69256639f0492a92cbc568223b2586a1a5/colorclass-2.1.1.tar.gz" } ], "2.2.0": [ { "comment_text": "", "digests": { "md5": "060139e93e31faafeb5d4bdfd6ea0bb8", "sha256": "b05c2a348dfc1aff2d502527d78a5b7b7e2f85da94a96c5081210d8e9ee8e18b" }, "downloads": -1, "filename": "colorclass-2.2.0.tar.gz", "has_sig": false, "md5_digest": "060139e93e31faafeb5d4bdfd6ea0bb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17037, "upload_time": "2016-05-15T02:23:22", "url": "https://files.pythonhosted.org/packages/37/ea/ae8dbb956939d4392e6a7fdef87fda273854da1128edae016c4104240be8/colorclass-2.2.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "060139e93e31faafeb5d4bdfd6ea0bb8", "sha256": "b05c2a348dfc1aff2d502527d78a5b7b7e2f85da94a96c5081210d8e9ee8e18b" }, "downloads": -1, "filename": "colorclass-2.2.0.tar.gz", "has_sig": false, "md5_digest": "060139e93e31faafeb5d4bdfd6ea0bb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17037, "upload_time": "2016-05-15T02:23:22", "url": "https://files.pythonhosted.org/packages/37/ea/ae8dbb956939d4392e6a7fdef87fda273854da1128edae016c4104240be8/colorclass-2.2.0.tar.gz" } ] }