{ "info": { "author": "Eric Rinish", "author_email": "erinish@users.noreply.github.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "\n# Stain \n\nStain helps you color your terminal output without having to worry about formatting classes,\nreplacement print functions, or using anything more than familiar string manipulations. \n\n## Getting Started\n\nUsing the basics of stain is fast and easy. \n\nStain provides a context manager that handles pre and post-printing of formatting\ncharacters. \n\nEx:\n```PYTHON\nfrom stain import Stain\n\nstain = Stain()\n\nwith stain.red(): # the context manager __enter__ prints \\033[31m\n print(\"This line is red.\")\n print(\"So is this one.\")\n# the context manager __exit__ prints \\033[0m\n\nprint(\"But this one is not.\")\n```\n\nFor more complex coloring, stain also provides formatting constants.\n\n```PYTHON\nfrom stain import Stain\n\nstain = Stain()\n\nprint(\"Hello \" + stain.BLACK + \" darkness \" + stain.RESET + \"my old friend.\")\n```\n\n\nBoth forms of stain can take stacked attributes in any order:\n\n```PYTHON\nstain.BLACK_ON_RED\n```\nor\n```PYTHON\nwith stain.bold_green():\n```\nor even\n```PYTHON\nstain.BOLD_RED_ON_BLACK_UNDERLINE\n```\n\n### Terminal Detection\nStain is TTY-aware, meaning it will not print coloring characters when your output\nhas been redirected to files, pagers, etc. \n\n\n### Supported Formatting\n\nStain supports 16-Color ANSI foreground and background colors, and the common formatters.\n\nWhether or not a given terminal supports them is another matter. \n\nCOLORS:\n* Black\n* Red\n* Green\n* Yellow\n* Blue\n* Magenta\n* Cyan\n* Light gray\n* Dark gray\n* Light red\n* Light green\n* Light yellow\n* Light magenta\n* Light cyan\n* White\n\nFORMATS:\n* Bold\n* Reset Bold\n* Dim\n* Reset Dim\n* Underline\n* Reset Underline\n* Blink\n* Reset Blink\n* Reverse\n* Reset Reverse\n* Hidden\n* Reset Hidden\n* Reset All\n\n#### Caveat Regarding Background Coloring\n\nBy default, background coloring is disabled in the context manager form of stain.\nThis is due to how background color determination works when scrolling a terminal.\n\nWhen printing a newline at the bottom of the screen such that everything needs to shift\nupward, the background color will bleed onto the next line. The context manager cannot\nprint the reset before print statements in the block print their newlines, so ugly background\ncolor bleeding will occur. \n\nThis is also true of the Reverse formatter.\n\nTo enable background colors with the context manager, do the following:\n```PYTHON\nfrom stain import Stain\n\nstain = Stain(unsafe=True)\n\nwith stain.black_on_light_gray():\n print(\"This will have a background color\" + stain.RESET)\n```\n\nYou will need to hand-reset at the end of each line to prevent scrolling background bleed.\n\n\n### Prerequisites\n\n None\n\n### Installing\n\npip install stain\n\n## Running the tests\n\nmake tests\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details\n\n\n", "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/erinish/stain", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "stain", "package_url": "https://pypi.org/project/stain/", "platform": "", "project_url": "https://pypi.org/project/stain/", "project_urls": { "Homepage": "https://github.com/erinish/stain" }, "release_url": "https://pypi.org/project/stain/0.1/", "requires_dist": null, "requires_python": ">=3.4.0", "summary": "Taking care of the dirty parts of terminal colors.", "version": "0.1" }, "last_serial": 4132620, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "2cd65fb99578fe29b00b34ce473817f5", "sha256": "e5ae59b3d74a45558ed5450f58978bd20ae87920856471cf60a84b0c86e5053b" }, "downloads": -1, "filename": "stain-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2cd65fb99578fe29b00b34ce473817f5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.0", "size": 4543, "upload_time": "2018-08-03T14:26:13", "url": "https://files.pythonhosted.org/packages/e0/2a/547962859426ad4e615eb9ab9f07cb077a6d593e877c22a12f640bcfda31/stain-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95f8d679c95be2a5654315649d362ea6", "sha256": "1e4b293d8051580d85a7e5ffb1978e3f9eb40e7a170657faa6804a04877f10f1" }, "downloads": -1, "filename": "stain-0.1.tar.gz", "has_sig": false, "md5_digest": "95f8d679c95be2a5654315649d362ea6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.0", "size": 4777, "upload_time": "2018-08-03T14:26:14", "url": "https://files.pythonhosted.org/packages/cc/fa/5d7e143a6d2948cb01a806c27c32cdf56c952cccb418eeaefba8579bc815/stain-0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "2cd65fb99578fe29b00b34ce473817f5", "sha256": "e5ae59b3d74a45558ed5450f58978bd20ae87920856471cf60a84b0c86e5053b" }, "downloads": -1, "filename": "stain-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "2cd65fb99578fe29b00b34ce473817f5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.4.0", "size": 4543, "upload_time": "2018-08-03T14:26:13", "url": "https://files.pythonhosted.org/packages/e0/2a/547962859426ad4e615eb9ab9f07cb077a6d593e877c22a12f640bcfda31/stain-0.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "95f8d679c95be2a5654315649d362ea6", "sha256": "1e4b293d8051580d85a7e5ffb1978e3f9eb40e7a170657faa6804a04877f10f1" }, "downloads": -1, "filename": "stain-0.1.tar.gz", "has_sig": false, "md5_digest": "95f8d679c95be2a5654315649d362ea6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4.0", "size": 4777, "upload_time": "2018-08-03T14:26:14", "url": "https://files.pythonhosted.org/packages/cc/fa/5d7e143a6d2948cb01a806c27c32cdf56c952cccb418eeaefba8579bc815/stain-0.1.tar.gz" } ] }