supports-color


Namesupports-color JSON
Version 0.2.0 PyPI version JSON
download
home_pagehttps://github.com/shawwn/supports-color-python
SummaryDetect whether a terminal supports color
upload_time2024-08-28 18:40:43
maintainerNone
docs_urlNone
authorShawn Presser
requires_python<4.0,>=3.6
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # supports-color

> Detect whether a terminal supports color

A port of the Node.js package [`supports-color`](https://github.com/chalk/supports-color) to Python.

## Install

```
python3 -m pip install -U supports-color
```

## Usage

```py
from supports_color import supportsColor

if supportsColor.stdout:
    print('Terminal stdout supports color');

if supportsColor.stdout.has256:
    print('Terminal stdout supports 256 colors');

if supportsColor.stderr.has16m:
    print('Terminal stderr supports 16 million colors (truecolor)');
```

## API

See [chalk/supports-color API docs](https://github.com/chalk/supports-color#api).

## License

MIT

## Contact

A library by [Shawn Presser](https://www.shawwn.com). If you found it useful, please consider [joining my patreon](https://www.patreon.com/shawwn)!

My Twitter DMs are always open; you should [send me one](https://twitter.com/theshawwn)! It's the best way to reach me, and I'm always happy to hear from you.

- Twitter: [@theshawwn](https://twitter.com/theshawwn)
- Patreon: [https://www.patreon.com/shawwn](https://www.patreon.com/shawwn)
- HN: [sillysaurusx](https://news.ycombinator.com/threads?id=sillysaurusx)
- Website: [shawwn.com](https://www.shawwn.com)


            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/shawwn/supports-color-python",
    "name": "supports-color",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.6",
    "maintainer_email": null,
    "keywords": null,
    "author": "Shawn Presser",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/74/f8/b4cae888902982943738420cc0594f30a4a5926bf4a7ededa2ad8679645b/supports-color-0.2.0.tar.gz",
    "platform": null,
    "description": "# supports-color\n\n> Detect whether a terminal supports color\n\nA port of the Node.js package [`supports-color`](https://github.com/chalk/supports-color) to Python.\n\n## Install\n\n```\npython3 -m pip install -U supports-color\n```\n\n## Usage\n\n```py\nfrom supports_color import supportsColor\n\nif supportsColor.stdout:\n    print('Terminal stdout supports color');\n\nif supportsColor.stdout.has256:\n    print('Terminal stdout supports 256 colors');\n\nif supportsColor.stderr.has16m:\n    print('Terminal stderr supports 16 million colors (truecolor)');\n```\n\n## API\n\nSee [chalk/supports-color API docs](https://github.com/chalk/supports-color#api).\n\n## License\n\nMIT\n\n## Contact\n\nA library by [Shawn Presser](https://www.shawwn.com). If you found it useful, please consider [joining my patreon](https://www.patreon.com/shawwn)!\n\nMy Twitter DMs are always open; you should [send me one](https://twitter.com/theshawwn)! It's the best way to reach me, and I'm always happy to hear from you.\n\n- Twitter: [@theshawwn](https://twitter.com/theshawwn)\n- Patreon: [https://www.patreon.com/shawwn](https://www.patreon.com/shawwn)\n- HN: [sillysaurusx](https://news.ycombinator.com/threads?id=sillysaurusx)\n- Website: [shawwn.com](https://www.shawwn.com)\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Detect whether a terminal supports color",
    "version": "0.2.0",
    "project_urls": {
        "Homepage": "https://github.com/shawwn/supports-color-python"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "74f8b4cae888902982943738420cc0594f30a4a5926bf4a7ededa2ad8679645b",
                "md5": "5dd1af9ddd8bb512dadf149b10002d0f",
                "sha256": "209d3e5c7f267b9b7c2dfbae9e2c546ea386b43f1855ccc96639e2769d042d14"
            },
            "downloads": -1,
            "filename": "supports-color-0.2.0.tar.gz",
            "has_sig": false,
            "md5_digest": "5dd1af9ddd8bb512dadf149b10002d0f",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.6",
            "size": 4157,
            "upload_time": "2024-08-28T18:40:43",
            "upload_time_iso_8601": "2024-08-28T18:40:43.989338Z",
            "url": "https://files.pythonhosted.org/packages/74/f8/b4cae888902982943738420cc0594f30a4a5926bf4a7ededa2ad8679645b/supports-color-0.2.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-28 18:40:43",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "shawwn",
    "github_project": "supports-color-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "supports-color"
}
        
Elapsed time: 0.54249s