{"id":15009782,"url":"https://github.com/termcolor/termcolor","last_synced_at":"2025-05-14T06:13:29.953Z","repository":{"id":41048774,"uuid":"293341161","full_name":"termcolor/termcolor","owner":"termcolor","description":"ANSI color formatting for output in terminal","archived":false,"fork":false,"pushed_at":"2025-04-10T07:23:11.000Z","size":183,"stargazers_count":253,"open_issues_count":3,"forks_count":30,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-04-10T08:29:30.653Z","etag":null,"topics":["ansi","cli","color","colour","hacktoberfest","python","termcolor","terminal"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/termcolor/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/termcolor.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":null,"funding":".github/FUNDING.yml","license":"COPYING.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":".github/SECURITY.md","support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"hugovk","tidelift":"pypi/termcolor"}},"created_at":"2020-09-06T18:46:10.000Z","updated_at":"2025-04-10T07:23:15.000Z","dependencies_parsed_at":"2024-05-01T01:28:04.244Z","dependency_job_id":"20a6a047-a0f7-4118-860b-e75e7c79b4f4","html_url":"https://github.com/termcolor/termcolor","commit_stats":{"total_commits":111,"total_committers":11,"mean_commits":"10.090909090909092","dds":"0.28828828828828834","last_synced_commit":"2654f7f2ae120aa2be69414d161867ec6ebf6f0a"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termcolor%2Ftermcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termcolor%2Ftermcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termcolor%2Ftermcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/termcolor%2Ftermcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/termcolor","download_url":"https://codeload.github.com/termcolor/termcolor/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248188147,"owners_count":21061986,"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":["ansi","cli","color","colour","hacktoberfest","python","termcolor","terminal"],"created_at":"2024-09-24T19:28:32.472Z","updated_at":"2025-04-11T03:28:23.560Z","avatar_url":"https://github.com/termcolor.png","language":"Python","funding_links":["https://github.com/sponsors/hugovk","https://tidelift.com/funding/github/pypi/termcolor","https://tidelift.com/badges/package/pypi/termcolor","https://tidelift.com/subscription/pkg/pypi-termcolor?utm_source=pypi-termcolor\u0026utm_medium=referral\u0026utm_campaign=readme"],"categories":["Python 🐍"],"sub_categories":[],"readme":"# termcolor\n\n[![PyPI version](https://img.shields.io/pypi/v/termcolor.svg?logo=pypi\u0026logoColor=FFE873)](https://pypi.org/project/termcolor)\n[![Supported Python versions](https://img.shields.io/pypi/pyversions/termcolor.svg?logo=python\u0026logoColor=FFE873)](https://pypi.org/project/termcolor)\n[![PyPI downloads](https://img.shields.io/pypi/dm/termcolor.svg)](https://pypistats.org/packages/termcolor)\n[![GitHub Actions status](https://github.com/termcolor/termcolor/workflows/Test/badge.svg)](https://github.com/termcolor/termcolor/actions)\n[![Codecov](https://codecov.io/gh/termcolor/termcolor/branch/main/graph/badge.svg)](https://codecov.io/gh/termcolor/termcolor)\n[![Licence](https://img.shields.io/github/license/termcolor/termcolor.svg)](COPYING.txt)\n[![Code style: Black](https://img.shields.io/badge/code%20style-Black-000000.svg)](https://github.com/psf/black)\n[![Tidelift](https://tidelift.com/badges/package/pypi/termcolor)](https://tidelift.com/subscription/pkg/pypi-termcolor?utm_source=pypi-termcolor\u0026utm_medium=referral\u0026utm_campaign=readme)\n\n## Installation\n\n### From PyPI\n\n```bash\npython3 -m pip install --upgrade termcolor\n```\n\n### From source\n\n```bash\ngit clone https://github.com/termcolor/termcolor\ncd termcolor\npython3 -m pip install .\n```\n\n### Demo\n\nTo see demo output, run:\n\n```bash\npython3 -m termcolor\n```\n\n## Example\n\n```python\nimport sys\n\nfrom termcolor 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# You can also specify 0-255 RGB ints via a tuple\ncprint(\"Both foreground and background can use tuples\", (100, 150, 250), (50, 60, 70))\n```\n\n## Text properties\n\n| Text colors     | Text highlights    | Attributes  |\n| --------------- | ------------------ | ----------- |\n| `black`         | `on_black`         | `bold`      |\n| `red`           | `on_red`           | `dark`      |\n| `green`         | `on_green`         | `underline` |\n| `yellow`        | `on_yellow`        | `blink`     |\n| `blue`          | `on_blue`          | `reverse`   |\n| `magenta`       | `on_magenta`       | `concealed` |\n| `cyan`          | `on_cyan`          | `strike`    |\n| `white`         | `on_white`         |             |\n| `light_grey`    | `on_light_grey`    |             |\n| `dark_grey`     | `on_dark_grey`     |             |\n| `light_red`     | `on_light_red`     |             |\n| `light_green`   | `on_light_green`   |             |\n| `light_yellow`  | `on_light_yellow`  |             |\n| `light_blue`    | `on_light_blue`    |             |\n| `light_magenta` | `on_light_magenta` |             |\n| `light_cyan`    | `on_light_cyan`    |             |\n\nYou can also use any arbitrary RGB color specified as a tuple of 0-255 integers, for\nexample, `(100, 150, 250)`.\n\n## Terminal properties\n\n| Terminal     | bold    | dark | underline | blink      | reverse | concealed |\n| ------------ | ------- | ---- | --------- | ---------- | ------- | --------- |\n| xterm        | yes     | no   | yes       | bold       | yes     | yes       |\n| linux        | yes     | yes  | bold      | yes        | yes     | no        |\n| rxvt         | yes     | no   | yes       | bold/black | yes     | no        |\n| dtterm       | yes     | yes  | yes       | reverse    | yes     | yes       |\n| teraterm     | reverse | no   | yes       | rev/red    | yes     | no        |\n| aixterm      | normal  | no   | yes       | no         | yes     | yes       |\n| PuTTY        | color   | no   | yes       | no         | yes     | no        |\n| Windows      | no      | no   | no        | no         | yes     | no        |\n| Cygwin SSH   | yes     | no   | color     | color      | color   | yes       |\n| Mac Terminal | yes     | no   | yes       | yes        | yes     | yes       |\n\n## Overrides\n\nTerminal colour detection can be disabled or enabled in several ways.\n\nIn order of precedence:\n\n1. Calling `colored` or `cprint` with a truthy `no_color` disables colour.\n2. Calling `colored` or `cprint` with a truthy `force_color` forces colour.\n3. Setting the `ANSI_COLORS_DISABLED` environment variable to any non-empty value\n   disables colour.\n4. Setting the [`NO_COLOR`](https://no-color.org/) environment variable to any non-empty\n   value disables colour.\n5. Setting the [`FORCE_COLOR`](https://force-color.org/) environment variable to any\n   non-empty value forces colour.\n6. Setting the `TERM` environment variable to `dumb`, or using such a\n   [dumb terminal](https://en.wikipedia.org/wiki/Computer_terminal#Character-oriented_terminal),\n   disables colour.\n7. Finally, termcolor will attempt to detect whether the terminal supports colour.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftermcolor%2Ftermcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftermcolor%2Ftermcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftermcolor%2Ftermcolor/lists"}