{"id":19665227,"url":"https://github.com/alttch/neotermcolor","last_synced_at":"2025-08-23T20:11:19.151Z","repository":{"id":57445483,"uuid":"209670299","full_name":"alttch/neotermcolor","owner":"alttch","description":"modern ANSII Color formatting for output in terminal","archived":false,"fork":false,"pushed_at":"2021-02-23T13:46:43.000Z","size":18,"stargazers_count":9,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-28T21:27:24.136Z","etag":null,"topics":["colorful","colorization","linux","termcolor","terminal","text-color","windows"],"latest_commit_sha":null,"homepage":null,"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/alttch.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-09-20T00:15:15.000Z","updated_at":"2024-01-06T01:50:51.000Z","dependencies_parsed_at":"2022-09-26T17:30:53.335Z","dependency_job_id":null,"html_url":"https://github.com/alttch/neotermcolor","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/alttch/neotermcolor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alttch%2Fneotermcolor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alttch%2Fneotermcolor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alttch%2Fneotermcolor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alttch%2Fneotermcolor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alttch","download_url":"https://codeload.github.com/alttch/neotermcolor/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alttch%2Fneotermcolor/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271767962,"owners_count":24817591,"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","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["colorful","colorization","linux","termcolor","terminal","text-color","windows"],"created_at":"2024-11-11T16:21:40.732Z","updated_at":"2025-08-23T20:11:19.104Z","avatar_url":"https://github.com/alttch.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 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!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falttch%2Fneotermcolor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falttch%2Fneotermcolor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falttch%2Fneotermcolor/lists"}