termcolor

ANSI color formatting for output in terminal

https://github.com/termcolor/termcolor

Science Score: 26.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (11.7%) to scientific vocabulary

Keywords

ansi cli color colour hacktoberfest python termcolor terminal

Keywords from Contributors

docs sphinx documentation-tool requests quantum-circuit restructuredtext cookies forhumans humans python-requests
Last synced: 6 months ago · JSON representation

Repository

ANSI color formatting for output in terminal

Basic Info
Statistics
  • Stars: 289
  • Watchers: 4
  • Forks: 34
  • Open Issues: 5
  • Releases: 18
Topics
ansi cli color colour hacktoberfest python termcolor terminal
Created over 5 years ago · Last pushed 6 months ago
Metadata Files
Readme Changelog Funding License Security

README.md

termcolor

PyPI version Supported Python versions PyPI downloads GitHub Actions status Codecov Licence Code style: Black Tidelift

Installation

From PyPI

bash python3 -m pip install --upgrade termcolor

From source

bash git clone https://github.com/termcolor/termcolor cd termcolor python3 -m pip install .

Demo

To see demo output, run:

bash python3 -m termcolor

Example

```python import sys

from termcolor import colored, cprint

text = colored("Hello, World!", "red", attrs=["reverse", "blink"]) print(text) cprint("Hello, World!", "green", "on_red")

printredoncyan = lambda x: cprint(x, "red", "oncyan") printredoncyan("Hello, World!") printredoncyan("Hello, Universe!")

for i in range(10): cprint(i, "magenta", end=" ")

cprint("Attention!", "red", attrs=["bold"], file=sys.stderr)

You can also specify 0-255 RGB ints via a tuple

cprint("Both foreground and background can use tuples", (100, 150, 250), (50, 60, 70)) ```

Text properties

| Text colors | Text highlights | Attributes | | --------------- | ------------------ | ----------- | | black | on_black | bold | | red | on_red | dark | | green | on_green | underline | | yellow | on_yellow | blink | | blue | on_blue | reverse | | magenta | on_magenta | concealed | | cyan | on_cyan | strike | | white | on_white | | | light_grey | on_light_grey | | | dark_grey | on_dark_grey | | | light_red | on_light_red | | | light_green | on_light_green | | | light_yellow | on_light_yellow | | | light_blue | on_light_blue | | | light_magenta | on_light_magenta | | | light_cyan | on_light_cyan | |

You can also use any arbitrary RGB color specified as a tuple of 0-255 integers, for example, (100, 150, 250).

Terminal properties

| Terminal | bold | dark | underline | blink | reverse | concealed | | ------------ | ------- | ---- | --------- | ---------- | ------- | --------- | | xterm | yes | no | yes | bold | yes | yes | | linux | yes | yes | bold | yes | yes | no | | rxvt | yes | no | yes | bold/black | yes | no | | dtterm | yes | yes | yes | reverse | yes | yes | | teraterm | reverse | no | yes | rev/red | yes | no | | aixterm | normal | no | yes | no | yes | yes | | PuTTY | color | no | yes | no | yes | no | | Windows | no | no | no | no | yes | no | | Cygwin SSH | yes | no | color | color | color | yes | | Mac Terminal | yes | no | yes | yes | yes | yes |

Overrides

Terminal colour detection can be disabled or enabled in several ways.

In order of precedence:

  1. Calling colored or cprint with a truthy no_color disables colour.
  2. Calling colored or cprint with a truthy force_color forces colour.
  3. Setting the ANSI_COLORS_DISABLED environment variable to any non-empty value disables colour.
  4. Setting the NO_COLOR environment variable to any non-empty value disables colour.
  5. Setting the FORCE_COLOR environment variable to any non-empty value forces colour.
  6. Setting the TERM environment variable to dumb, or using such a dumb terminal, disables colour.
  7. Finally, termcolor will attempt to detect whether the terminal supports colour.

Owner

  • Name: termcolor
  • Login: termcolor
  • Kind: organization

GitHub Events

Total
  • Create event: 6
  • Release event: 3
  • Issues event: 12
  • Watch event: 63
  • Delete event: 4
  • Issue comment event: 41
  • Push event: 23
  • Pull request review comment event: 8
  • Pull request review event: 7
  • Pull request event: 45
  • Fork event: 7
Last Year
  • Create event: 6
  • Release event: 3
  • Issues event: 12
  • Watch event: 63
  • Delete event: 4
  • Issue comment event: 41
  • Push event: 23
  • Pull request review comment event: 8
  • Pull request review event: 7
  • Pull request event: 45
  • Fork event: 7

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 148
  • Total Committers: 12
  • Avg Commits per committer: 12.333
  • Development Distribution Score (DDS): 0.345
Past Year
  • Commits: 40
  • Committers: 5
  • Avg Commits per committer: 8.0
  • Development Distribution Score (DDS): 0.475
Top Committers
Name Email Commits
Hugo van Kemenade h****k 97
pre-commit-ci[bot] 6****] 17
renovate[bot] 2****] 9
Mike Fiedler m****n@g****m 7
seomac i****s@h****m 6
Xiaoli Chan 2****7@q****m 4
Jon Dufresne j****e@g****m 3
Tim Metzler 3****l 1
Marcin Serwin m****0@p****m 1
Felix Yan f****s@a****g 1
Christian c****r@g****m 1
Arseniy Potapov a****v@g****m 1
Committer Domains (Top 20 + Academic)

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 28
  • Total pull requests: 124
  • Average time to close issues: 5 months
  • Average time to close pull requests: 10 days
  • Total issue authors: 26
  • Total pull request authors: 16
  • Average comments per issue: 2.96
  • Average comments per pull request: 1.38
  • Merged pull requests: 103
  • Bot issues: 1
  • Bot pull requests: 33
Past Year
  • Issues: 7
  • Pull requests: 56
  • Average time to close issues: 11 days
  • Average time to close pull requests: 4 days
  • Issue authors: 7
  • Pull request authors: 7
  • Average comments per issue: 0.86
  • Average comments per pull request: 1.34
  • Merged pull requests: 46
  • Bot issues: 0
  • Bot pull requests: 9
Top Authors
Issue Authors
  • hugovk (3)
  • mtelka (1)
  • Ax1rc (1)
  • sinux-l5d (1)
  • FoxKeys (1)
  • bulletmark (1)
  • renovate[bot] (1)
  • alx-xlx (1)
  • charpercyr (1)
  • tdprime (1)
  • lucalista (1)
  • avdstaaij (1)
  • bwoodsend (1)
  • mcrutch (1)
  • webknjaz (1)
Pull Request Authors
  • hugovk (58)
  • renovate[bot] (18)
  • pre-commit-ci[bot] (15)
  • miketheman (12)
  • Josecolin99 (5)
  • MilesWK (2)
  • telectr (2)
  • BobTheBuidler (2)
  • icyveins7 (2)
  • jdufresne (2)
  • CozyDoomer (1)
  • felixonmars (1)
  • tmetzl (1)
  • canTuncPekkan (1)
  • marcin-serwin (1)
Top Labels
Issue Labels
enhancement (2) bug (2) documentation (1) release (1) testing (1)
Pull Request Labels
changelog: skip (54) dependencies (21) changelog: Added (18) changelog: Changed (18) enhancement (6) changelog: Fixed (5) changelog: Removed (5) bug (3) testing (3) documentation (3) release (2) hacktoberfest-accepted (1) changelog: Deprecated (1) docs (1)

Packages

  • Total packages: 4
  • Total downloads:
    • homebrew 35 last-month
    • pypi 63,406,427 last-month
  • Total docker downloads: 1,633,881,886
  • Total dependent packages: 1,466
    (may contain duplicates)
  • Total dependent repositories: 59,506
    (may contain duplicates)
  • Total versions: 25
  • Total maintainers: 1
pypi.org: termcolor

ANSI color formatting for output in terminal

  • Versions: 18
  • Dependent Packages: 1,395
  • Dependent Repositories: 58,682
  • Downloads: 63,406,427 Last month
  • Docker Downloads: 1,633,881,886
Rankings
Dependent packages count: 0.0%
Dependent repos count: 0.0%
Downloads: 0.0%
Docker downloads count: 0.1%
Average: 2.9%
Stargazers count: 7.2%
Forks count: 10.0%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: termcolor
  • Versions: 3
  • Dependent Packages: 64
  • Dependent Repositories: 412
Rankings
Dependent packages count: 1.2%
Dependent repos count: 1.4%
Average: 21.4%
Stargazers count: 40.4%
Forks count: 42.7%
Last synced: 6 months ago
anaconda.org: termcolor

ANSI color formatting for output in terminal.

  • Versions: 2
  • Dependent Packages: 7
  • Dependent Repositories: 412
Rankings
Dependent packages count: 5.9%
Dependent repos count: 8.4%
Average: 28.3%
Stargazers count: 47.9%
Forks count: 51.0%
Last synced: 6 months ago
formulae.brew.sh: python-termcolor

ANSI color formatting for output in terminal

  • Versions: 2
  • Dependent Packages: 0
  • Dependent Repositories: 0
  • Downloads: 35 Last month
Rankings
Dependent packages count: 19.4%
Forks count: 33.3%
Stargazers count: 34.5%
Average: 43.3%
Dependent repos count: 57.5%
Downloads: 71.6%
Last synced: 6 months ago

Dependencies

.github/workflows/deploy.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pypa/gh-action-pypi-publish release/v1 composite
.github/workflows/labels.yml actions
  • actions/checkout v3 composite
  • micnncim/action-label-syncer v1 composite
.github/workflows/lint.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • pre-commit/action v3.0.0 composite
.github/workflows/release-drafter.yml actions
  • release-drafter/release-drafter v5 composite
.github/workflows/require-pr-label.yml actions
  • mheap/github-action-required-labels v3 composite
.github/workflows/test.yml actions
  • actions/checkout v3 composite
  • actions/setup-python v4 composite
  • codecov/codecov-action v3 composite
pyproject.toml pypi