{ "info": { "author": "phil", "author_email": "philip.olson@pm.me", "bugtrack_url": null, "classifiers": [], "description": "## Simple Chalk\n\n*Note: This document is best viewed [on github](github.com/olsonpm/py_simple-chalk).\nPypi's headers are all caps which presents inaccurate information*\"\n\n\n\n\n**Table of Contents**\n\n- [Intro](#intro)\n - [What is it?](#what-is-it)\n - [Why create it?](#why-create-it)\n - [Why the subset of features?](#why-the-subset-of-features)\n- [Install](#install)\n- [Usage](#usage)\n- [Api](#api)\n - [`chalk` (string) => string](#chalk-string--string)\n - [`newChalk` () => Chalk](#newchalk---chalk)\n- [Test](#test)\n- [Features included from js version of Chalk](#features-included-from-js-version-of-chalk)\n- [Features omitted](#features-omitted)\n\n\n\n\n### Intro\n\n##### What is it?\n\nA terminal string styling library for python. It implements a subset of\nSindre Sorhus' [chalk](https://github.com/chalk/chalk) (which is for js).\n\ne.g. `chalk.green.bold(\"success\")` prints like you'd expect in the console.\n\n##### Why create it?\n\nI am familiar with and enjoy the syntax of [chalk](https://github.com/chalk/chalk).\nAnthonyalmarza's [chalk](https://github.com/anthonyalmarza/chalk)\ndeviates from that syntax and so I created my own.\n\nI'm also new to python so this was a good way to learn.\n\n\n##### Why the subset of features?\n\nI only use chalk for very simple purposes so I left out things like 256 colors.\n\n\n### Install\n\n```sh\n$ pip install simple_chalk\n```\n\n\n### Usage\n\n```python\nfrom simple_chalk import chalk, green\n\n# both of these are the same\nprint(chalk.green(\"success\"))\nprint(green(\"success\"))\n\n# chained\nprint(green.bold(\"success\"))\n\n# assign combinations\nsuccess = green.bold.underline\nprint(success(\"we did it!\"))\n\n# last color wins\nprint(green.red(\"this is red\"))\n\n# background and foreground colors are separate\nwhyNot = green.bgWhite.red.bgGray\nprint(whyNot(\"this is red text with a gray background\"))\n```\n\n\n### Api\n\n`simple_chalk` exports the following\n\n##### `chalk` (string) => string\n - A singleton that can be used instead of importing the colors and\n styles directly.\n - `chalk` and all exported colors/styles are chainable callables. When called,\n they take a single string argument and return a string wrapped in the\n appropriate ascii color codes.\n\n##### `newChalk` () => Chalk\n - You probably don't need this, but it creates a new chalk instance in case\n another library is misbehaving.\n\nThe following colors are exported\n\n- black \n- red \n- green \n- yellow \n- blue \n- magenta \n- cyan \n- white \n- blackBright (also 'gray' and 'grey')\n- redBright\n- greenBright\n- yellowBright\n- blueBright\n- magentaBright\n- cyanBright\n- whiteBright\n\nEach color also has a camel-cased `bg` equivalent. e.g. `bgBlack`\nand `bgYellowBright`\n\nFinally the following miscellaneous styles are exported\n\n- bold\n- dim\n- underline\n- hidden\n\n\n### Test\n\n```sh\nhub clone olsonpm/py_simple-chalk\ncd py_simple-chalk\npython runTests.py\n```\n\n\n### Features included from js version of Chalk\n\n- chainable api\n- same color names (with added aliases)\n\n\n### Features omitted\n\n\\*\\* Features marked with `*` are ones I'd pull in should someone create a PR.\n\n- 256 colors and TrueColor support\n- multiple arguments, and thus nested styles\n- \\*color support detection\n- \\*blue -> blueBright auto conversion on windows\n- \\*ability to disable\n- \\*modifiers other than the miscellaneous styles noted above.\n e.g. `reset`, `italic`, `inverse` etc.", "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/olsonpm/py_simple-chalk", "keywords": "", "license": "WTFNMFPL-1.0", "maintainer": "", "maintainer_email": "", "name": "simple-chalk", "package_url": "https://pypi.org/project/simple-chalk/", "platform": "", "project_url": "https://pypi.org/project/simple-chalk/", "project_urls": { "Homepage": "https://github.com/olsonpm/py_simple-chalk" }, "release_url": "https://pypi.org/project/simple-chalk/0.1.0/", "requires_dist": null, "requires_python": ">=3.6", "summary": "A terminal string styling library", "version": "0.1.0" }, "last_serial": 4524271, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "fb37dac10a85fa6be57f00b12ed72162", "sha256": "d80f55993dfa040c1b55d2fbfb925e4fbb5798c2934601aa448ef4a192d84196" }, "downloads": -1, "filename": "simple_chalk-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fb37dac10a85fa6be57f00b12ed72162", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13862, "upload_time": "2018-11-24T18:34:12", "url": "https://files.pythonhosted.org/packages/31/97/b8114a347aee340570eb92b1a1fe512a038766903af7aa4e28447dc25c80/simple_chalk-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "fb37dac10a85fa6be57f00b12ed72162", "sha256": "d80f55993dfa040c1b55d2fbfb925e4fbb5798c2934601aa448ef4a192d84196" }, "downloads": -1, "filename": "simple_chalk-0.1.0.tar.gz", "has_sig": false, "md5_digest": "fb37dac10a85fa6be57f00b12ed72162", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.6", "size": 13862, "upload_time": "2018-11-24T18:34:12", "url": "https://files.pythonhosted.org/packages/31/97/b8114a347aee340570eb92b1a1fe512a038766903af7aa4e28447dc25c80/simple_chalk-0.1.0.tar.gz" } ] }