{ "info": { "author": "Altertech", "author_email": "div@altertech.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries", "Topic :: Terminals", "Topic :: Text Processing" ], "description": "# modern ANSII Color formatting for output in terminal\n\n## What is neotermcolor\n\nneotermcolor library is a fork of old good\n[termcolor](https://pypi.org/project/termcolor/), which is widely used. I like\nit very much, but unfortunately last release was long time ago.\n\nEverything is fully backward compatible with original termcolor:\n\n```python\nimport sys\nfrom neotermcolor import colored, cprint\n\ntext = colored('Hello, World!', 'red', attrs=['reverse', 'blink'])\nprint(text)\ncprint('Hello, World!', 'green', 'on_red')\n\nprint_red_on_cyan = lambda x: cprint(x, 'red', 'on_cyan')\nprint_red_on_cyan('Hello, World!')\nprint_red_on_cyan('Hello, Universe!')\n\nfor i in range(10):\n cprint(i, 'magenta', end=' ')\n\ncprint(\"Attention!\", 'red', attrs=['bold'], file=sys.stderr)\n```\n\n## Installation\n\n```shell\n pip3 install neotermcolor\n```\n\n## New features\n\n### It works in Windows terminal\n\nYep, right out-of-the-box (tested on Windows 10)\n\n### It is readline-safe\n\nWhen you mix ANSI color codes with readline input, it may cause a problem.\nneotermcolor has a workaround:\n\n* new param for **cprint** and **colored**: *readline_safe=True*\n* you may also turn on readline-safe colorizing by default, setting\n\n```python\n import neotermcolor\n\n neotermcolor.readline_always_safe = True\n```\n\n### It has 256-color palette\n\nIf color code is specified as an integer (0..255), ANSI 256-color palette is\nused. You may specify color codes both for foreground and background and mix\nthem with other attributes:\n\n```python\n from neotermcolor import cprint\n\n cprint('Underline light-green (119) on grey (237)', 119, 237, ['underline'])\n```\n\n### It is TTY-aware\n\nneotermcolor will not colorize text if process stdout or stderr is not a TTY.\n\nThis feature is on by default, but you may turn it off:\n\n```python\n import neotermcolor\n\n neotermcolor.tty_aware = False\n```\n\n### It has palette overriding\n\nYou may define own color names or override existing ones: e.g. you may use\nstandard palette for 16-color terminals, but override it when your program\ndetect terminal with 256-color support or when it's forced by user:\n\n```python\n import neotermcolor\n\n neotermcolor.set_color('red', 197)\n neotermcolor.cprint('Red color is now purple', 'red')\n```\n\n### It has styles\n\nStyles are alternative to classical defining a \"style\" for certain type of\nmessages with *functools.partial* or *lambda*. A style may contain color,\non_color and attributes:\n\n```python\n import neotermcolor\n\n neotermcolor.set_style('error', color='red', attrs='bold')\n neotermcolor.cprint('ERROR MESSAGE', style='error')\n # or\n neotermcolor.cprint('ERROR MESSAGE 2', '@error')\n```\n\nNote: if you specify both style and e.g. attrs, the style attrs will be\noverriden.\n\n### Single attribute can now be specified as a string\n\n```python\n # as list or tuple\n cprint('test', attrs=['bold'])\n # as a string\n cprint('test', attrs='bold')\n```\n\n### How to use it instead of old termcolor in the existing projects\n\n```python\n import neotermcolor as termcolor\n```\n\nI'll do my best to keep it backward compatible with original termcolor.\n\nEnjoy!", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/alttch/neotermcolor", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "neotermcolor", "package_url": "https://pypi.org/project/neotermcolor/", "platform": "", "project_url": "https://pypi.org/project/neotermcolor/", "project_urls": { "Homepage": "https://github.com/alttch/neotermcolor" }, "release_url": "https://pypi.org/project/neotermcolor/2.0.7/", "requires_dist": null, "requires_python": "", "summary": "Fork of termcolor library", "version": "2.0.7" }, "last_serial": 5936407, "releases": { "2.0.0": [ { "comment_text": "", "digests": { "md5": "8151af63a8b7d3317029428f860ad70b", "sha256": "b1147b5ad5ca4a822a1d174771c3a5433080208814393fb6c188a0005f49bf5c" }, "downloads": -1, "filename": "neotermcolor-2.0.0.tar.gz", "has_sig": false, "md5_digest": "8151af63a8b7d3317029428f860ad70b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4373, "upload_time": "2019-09-20T00:32:01", "url": "https://files.pythonhosted.org/packages/24/24/3588c145b74f86d72afd93e35e852103bb3590badc61cb8db215018b5df1/neotermcolor-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "31f92fa28c25233af06d6d08d4708d61", "sha256": "d783d68575fb245c41884c31f455902b8914fbc2c8526e01e498c42d1758f8cc" }, "downloads": -1, "filename": "neotermcolor-2.0.1.tar.gz", "has_sig": false, "md5_digest": "31f92fa28c25233af06d6d08d4708d61", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4392, "upload_time": "2019-09-20T01:01:29", "url": "https://files.pythonhosted.org/packages/3f/1d/4268d9b529bad0b69dad4bb6f48141ba9317dffdba63d24fc04b58a58bfa/neotermcolor-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "053b162e30f72fb67514de257238b368", "sha256": "e1ac0e231e38938be299313ea10ddedb4dc91e342c8207198b0109340e963210" }, "downloads": -1, "filename": "neotermcolor-2.0.2.tar.gz", "has_sig": false, "md5_digest": "053b162e30f72fb67514de257238b368", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4395, "upload_time": "2019-09-20T01:27:24", "url": "https://files.pythonhosted.org/packages/31/98/bfc404b1725fc42855c4af0f5ffa2c28a24350146ec4aa9797a5e7e28d05/neotermcolor-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "a48f1030f849bdb3bf16e492b94e895b", "sha256": "6acbebfcf025d2dffe6da1ce0e5517157509c5b403dd2ce066b33110a0462024" }, "downloads": -1, "filename": "neotermcolor-2.0.3.tar.gz", "has_sig": false, "md5_digest": "a48f1030f849bdb3bf16e492b94e895b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4423, "upload_time": "2019-09-20T02:34:44", "url": "https://files.pythonhosted.org/packages/bc/e8/890cff5b5ca3efca876f560b3cea6d193d49b57a1847e3f9c30d167acb13/neotermcolor-2.0.3.tar.gz" } ], "2.0.4": [ { "comment_text": "", "digests": { "md5": "21a63ce3819bdf1edf871da9c38d7a67", "sha256": "181e4836c87cfa51b96a5c44fe73482f251a8b63bd087c34aa359db0c542b62d" }, "downloads": -1, "filename": "neotermcolor-2.0.4.tar.gz", "has_sig": false, "md5_digest": "21a63ce3819bdf1edf871da9c38d7a67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4884, "upload_time": "2019-09-20T11:19:45", "url": "https://files.pythonhosted.org/packages/1e/91/fb0b0920517c0f76b780efe1c945acfac3bfb1e599bd0cb6bb58685c7605/neotermcolor-2.0.4.tar.gz" } ], "2.0.5": [ { "comment_text": "", "digests": { "md5": "793568c1f62eadacc9871e47e59df8c6", "sha256": "4c07103a675b6208f52570c4f2eb02d89c443146d78bc9f4f5ed4948cd568747" }, "downloads": -1, "filename": "neotermcolor-2.0.5.tar.gz", "has_sig": false, "md5_digest": "793568c1f62eadacc9871e47e59df8c6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5061, "upload_time": "2019-09-20T11:25:55", "url": "https://files.pythonhosted.org/packages/85/74/2225d8bb885d8811e1f19cbe83a35542d74ecaf174c87c065bf77f373e55/neotermcolor-2.0.5.tar.gz" } ], "2.0.7": [ { "comment_text": "", "digests": { "md5": "03fcc308fcdc7321a250693edeba1790", "sha256": "45181c368ef432cc0b13c2fc46376bd27c7dd279af7d998501cc88b045e2d047" }, "downloads": -1, "filename": "neotermcolor-2.0.7.tar.gz", "has_sig": false, "md5_digest": "03fcc308fcdc7321a250693edeba1790", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5081, "upload_time": "2019-10-07T00:26:17", "url": "https://files.pythonhosted.org/packages/ea/bc/126c6e8291861073d0757091ca2c6da066cb9fe9c11b8d278f83b759c248/neotermcolor-2.0.7.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "03fcc308fcdc7321a250693edeba1790", "sha256": "45181c368ef432cc0b13c2fc46376bd27c7dd279af7d998501cc88b045e2d047" }, "downloads": -1, "filename": "neotermcolor-2.0.7.tar.gz", "has_sig": false, "md5_digest": "03fcc308fcdc7321a250693edeba1790", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5081, "upload_time": "2019-10-07T00:26:17", "url": "https://files.pythonhosted.org/packages/ea/bc/126c6e8291861073d0757091ca2c6da066cb9fe9c11b8d278f83b759c248/neotermcolor-2.0.7.tar.gz" } ] }