Name | colorty JSON |
Version |
0.1.6
JSON |
| download |
home_page | https://github.com/dynstat/colorty |
Summary | A simple library for handling colored text in terminal environments. |
upload_time | 2024-09-15 06:31:57 |
maintainer | None |
docs_url | None |
author | Vivek |
requires_python | >=3.6 |
license | None |
keywords |
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Colorty
Colorty is a Python library for handling colored text in various terminal environments including Windows CMD, PowerShell, and Unix-like terminals on Ubuntu and macOS.
## Installation
Install Colorty using pip:
```bash
pip install colorty
```
## Usage
Basic example:
```python
from colorty import set_color, reset_color
set_color('RED') # Set text color to red using color name
print("This text is red")
set_color('31') # Set text color to red using ANSI code
print("This text is still red")
set_color('GREEN') # Set text color to green using color name
print("This text is green")
set_color(32) # Set text color to green using ANSI code
print("This text is still green")
reset_color() # Reset text color to default
print("This text is default color")
```
Using the `Clt` class:
```python
from colorty import Clt
# format partial string with color
print(f"This is {Clt.RED}partial red{Clt.RESET} and {Clt.BLUE}partial blue{Clt.RESET} text.")
```
## API Reference
- `set_color(color)`: Sets the terminal text color.
- `reset_color()`: Resets the terminal text color to default.
- `Clt`: Class with predefined ANSI color codes.
## License
This project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.
**Acknowledgments**: inspired from the Colorama library.
Raw data
{
"_id": null,
"home_page": "https://github.com/dynstat/colorty",
"name": "colorty",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.6",
"maintainer_email": null,
"keywords": null,
"author": "Vivek",
"author_email": "xsvk@gmx.com",
"download_url": "https://files.pythonhosted.org/packages/0f/a0/f4b9f10018745ade9c04e32d5ef4e0f7939c191da4a922fc6855a5ae2e18/colorty-0.1.6.tar.gz",
"platform": null,
"description": "# Colorty\r\n\r\nColorty is a Python library for handling colored text in various terminal environments including Windows CMD, PowerShell, and Unix-like terminals on Ubuntu and macOS.\r\n\r\n## Installation\r\n\r\nInstall Colorty using pip:\r\n\r\n\r\n\r\n```bash\r\npip install colorty\r\n```\r\n## Usage\r\n\r\nBasic example:\r\n\r\n```python\r\nfrom colorty import set_color, reset_color\r\nset_color('RED') # Set text color to red using color name\r\nprint(\"This text is red\")\r\nset_color('31') # Set text color to red using ANSI code\r\nprint(\"This text is still red\")\r\nset_color('GREEN') # Set text color to green using color name\r\nprint(\"This text is green\")\r\nset_color(32) # Set text color to green using ANSI code\r\nprint(\"This text is still green\")\r\nreset_color() # Reset text color to default\r\nprint(\"This text is default color\")\r\n```\r\n\r\nUsing the `Clt` class:\r\n\r\n```python\r\nfrom colorty import Clt\r\n\r\n# format partial string with color\r\nprint(f\"This is {Clt.RED}partial red{Clt.RESET} and {Clt.BLUE}partial blue{Clt.RESET} text.\")\r\n```\r\n\r\n## API Reference\r\n\r\n- `set_color(color)`: Sets the terminal text color.\r\n- `reset_color()`: Resets the terminal text color to default.\r\n- `Clt`: Class with predefined ANSI color codes.\r\n\r\n## License\r\n\r\nThis project is licensed under the MIT License. See the [LICENSE](LICENSE) file for details.\r\n\r\n\r\n**Acknowledgments**: inspired from the Colorama library. \r\n",
"bugtrack_url": null,
"license": null,
"summary": "A simple library for handling colored text in terminal environments.",
"version": "0.1.6",
"project_urls": {
"Homepage": "https://github.com/dynstat/colorty"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "2f6b263514f5794c2c02317771c98f215d3a912a662bf72bbb1f6d7e080038b1",
"md5": "02be493a8bfdb043cb1c2ea24f4766ef",
"sha256": "3ed83a5b3555e48d674c891edcf00a5a26739b1d982798d9d0c4480898354c93"
},
"downloads": -1,
"filename": "colorty-0.1.6-py3-none-any.whl",
"has_sig": false,
"md5_digest": "02be493a8bfdb043cb1c2ea24f4766ef",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.6",
"size": 6212,
"upload_time": "2024-09-15T06:31:56",
"upload_time_iso_8601": "2024-09-15T06:31:56.827004Z",
"url": "https://files.pythonhosted.org/packages/2f/6b/263514f5794c2c02317771c98f215d3a912a662bf72bbb1f6d7e080038b1/colorty-0.1.6-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0fa0f4b9f10018745ade9c04e32d5ef4e0f7939c191da4a922fc6855a5ae2e18",
"md5": "8bcd49a5ed82c4ac436ccd6d436d8753",
"sha256": "4aef3676ea8eb58a171f06b672f16364876187957bb0c52ba9c9bf647c9d7fdb"
},
"downloads": -1,
"filename": "colorty-0.1.6.tar.gz",
"has_sig": false,
"md5_digest": "8bcd49a5ed82c4ac436ccd6d436d8753",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.6",
"size": 4712,
"upload_time": "2024-09-15T06:31:57",
"upload_time_iso_8601": "2024-09-15T06:31:57.910853Z",
"url": "https://files.pythonhosted.org/packages/0f/a0/f4b9f10018745ade9c04e32d5ef4e0f7939c191da4a922fc6855a5ae2e18/colorty-0.1.6.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-09-15 06:31:57",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "dynstat",
"github_project": "colorty",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "colorty"
}