{"id":21082179,"url":"https://github.com/olsonpm/py_simple-chalk","last_synced_at":"2025-10-17T17:07:09.189Z","repository":{"id":57467312,"uuid":"158963375","full_name":"olsonpm/py_simple-chalk","owner":"olsonpm","description":null,"archived":false,"fork":false,"pushed_at":"2018-11-24T18:33:36.000Z","size":15,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-05-07T21:02:24.223Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/olsonpm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-24T18:33:25.000Z","updated_at":"2024-04-08T21:45:57.000Z","dependencies_parsed_at":"2022-09-10T02:01:52.062Z","dependency_job_id":null,"html_url":"https://github.com/olsonpm/py_simple-chalk","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpy_simple-chalk","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpy_simple-chalk/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpy_simple-chalk/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/olsonpm%2Fpy_simple-chalk/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/olsonpm","download_url":"https://codeload.github.com/olsonpm/py_simple-chalk/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254504809,"owners_count":22082091,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-19T20:13:04.281Z","updated_at":"2025-10-17T17:07:04.170Z","avatar_url":"https://github.com/olsonpm.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Simple Chalk\n\n\u003c!-- pypiwarn --\u003e\n\n\u003c!-- START doctoc generated TOC please keep comment here to allow auto update --\u003e\n\u003c!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE --\u003e\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) =\u003e string](#chalk-string--string)\n   - [`newChalk` () =\u003e 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\u003c!-- END doctoc generated TOC please keep comment here to allow auto update --\u003e\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) =\u003e 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` () =\u003e 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 -\u003e 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.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsonpm%2Fpy_simple-chalk","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Folsonpm%2Fpy_simple-chalk","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Folsonpm%2Fpy_simple-chalk/lists"}