Name | thehelp JSON |
Version |
0.0.0
JSON |
| download |
home_page | |
Summary | Helpers for use with the rich package. |
upload_time | 2024-02-13 23:34:15 |
maintainer | |
docs_url | None |
author | |
requires_python | <3.12,>=3.10 |
license | |
keywords |
rich
shortcuts
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# thehelp
Helpers for use with the [rich package](https://pypi.org/project/rich/).
Type less when applying multiple colors to f-strings,
access all color names with your IDE's autocomplete,
and easily apply color gradients to text.
## Installation
Install with:
<pre>
pip install thehelp
</pre>
## Usage
The `Tag` class is essentially a wrapper to shorten using `rich` tags.
When a `Tag` is casted to a string it is formatted with surrounding square brackets
and the `o` or `off` properties can be accessed to return the matching closing tag.
<pre>
from thehelp import Tag
p = Tag("pale_turquoise4")
c = Tag("cornflower_blue")
s = f"{p}This{p.o} {c}is{c.o} {p}a{p.o} {c}string"
</pre>
is equivalent to
<pre>
s = "[pale_turquoise4]This[/pale_turquoise4] [cornflower_blue]is[/cornflower_blue] [pale_turquoise4]a[/pale_turquoise4] [cornflower_blue]string"
</pre>
---
The `ColorMap` class contains two `Tag` properties for each
[named color](https://rich.readthedocs.io/en/latest/appendix/colors.html)
(except shades of grey, those only have a full name property):
one that's the full name of the color and one that's an abbreviated name, for convenience.
This is useful for seeing color options using autocomplete:
![](imgs/autocomplete.png)
The class also supports iterating over the tags as well as selecting random colors:
![](imgs/iteration.png)
---
The `Gradient` class can be used to easily apply a color sweep across text:
![](imgs/gradient.png)
Raw data
{
"_id": null,
"home_page": "",
"name": "thehelp",
"maintainer": "",
"docs_url": null,
"requires_python": "<3.12,>=3.10",
"maintainer_email": "",
"keywords": "rich,shortcuts",
"author": "",
"author_email": "Matt Manes <mattmanes@pm.me>",
"download_url": "https://files.pythonhosted.org/packages/0c/bc/f8eb7fd8d993f7c65b28b23c69dd5d76c0fbe43babdaa03f233cea72d48a/thehelp-0.0.0.tar.gz",
"platform": null,
"description": "# thehelp\n\nHelpers for use with the [rich package](https://pypi.org/project/rich/). \n\nType less when applying multiple colors to f-strings,\naccess all color names with your IDE's autocomplete,\nand easily apply color gradients to text.\n\n## Installation\n\nInstall with:\n\n<pre>\npip install thehelp\n</pre>\n\n\n\n## Usage\n\nThe `Tag` class is essentially a wrapper to shorten using `rich` tags. \nWhen a `Tag` is casted to a string it is formatted with surrounding square brackets \nand the `o` or `off` properties can be accessed to return the matching closing tag. \n\n<pre>\nfrom thehelp import Tag\np = Tag(\"pale_turquoise4\")\nc = Tag(\"cornflower_blue\")\ns = f\"{p}This{p.o} {c}is{c.o} {p}a{p.o} {c}string\"\n</pre>\n\nis equivalent to\n\n<pre>\ns = \"[pale_turquoise4]This[/pale_turquoise4] [cornflower_blue]is[/cornflower_blue] [pale_turquoise4]a[/pale_turquoise4] [cornflower_blue]string\"\n</pre>\n\n---\nThe `ColorMap` class contains two `Tag` properties for each \n[named color](https://rich.readthedocs.io/en/latest/appendix/colors.html) \n(except shades of grey, those only have a full name property):\none that's the full name of the color and one that's an abbreviated name, for convenience. \n\nThis is useful for seeing color options using autocomplete:\n![](imgs/autocomplete.png)\n\nThe class also supports iterating over the tags as well as selecting random colors:\n![](imgs/iteration.png)\n\n---\nThe `Gradient` class can be used to easily apply a color sweep across text:\n![](imgs/gradient.png)",
"bugtrack_url": null,
"license": "",
"summary": "Helpers for use with the rich package.",
"version": "0.0.0",
"project_urls": {
"Documentation": "https://github.com/matt-manes/thehelp/tree/main/docs",
"Homepage": "https://github.com/matt-manes/thehelp",
"Source code": "https://github.com/matt-manes/thehelp/tree/main/src/thehelp"
},
"split_keywords": [
"rich",
"shortcuts"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "b3032d8125934dae3ce1a04982aba93459070bcca6eb68064c1f739aa1157241",
"md5": "5149129450844cc4080aafbabdb66480",
"sha256": "16a0410f5ba5910a7aa2a92495f27f7e82718bdb4dda9ac025a6323d9563838b"
},
"downloads": -1,
"filename": "thehelp-0.0.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "5149129450844cc4080aafbabdb66480",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.12,>=3.10",
"size": 9584,
"upload_time": "2024-02-13T23:34:13",
"upload_time_iso_8601": "2024-02-13T23:34:13.594251Z",
"url": "https://files.pythonhosted.org/packages/b3/03/2d8125934dae3ce1a04982aba93459070bcca6eb68064c1f739aa1157241/thehelp-0.0.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0cbcf8eb7fd8d993f7c65b28b23c69dd5d76c0fbe43babdaa03f233cea72d48a",
"md5": "dd163495997e3681fe666c98ca166f43",
"sha256": "61e9449e4bfb05a8a8e9ba8097a8030bd3a549feb2212a4242ec8b81e9f68941"
},
"downloads": -1,
"filename": "thehelp-0.0.0.tar.gz",
"has_sig": false,
"md5_digest": "dd163495997e3681fe666c98ca166f43",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.12,>=3.10",
"size": 456178,
"upload_time": "2024-02-13T23:34:15",
"upload_time_iso_8601": "2024-02-13T23:34:15.892799Z",
"url": "https://files.pythonhosted.org/packages/0c/bc/f8eb7fd8d993f7c65b28b23c69dd5d76c0fbe43babdaa03f233cea72d48a/thehelp-0.0.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-02-13 23:34:15",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "matt-manes",
"github_project": "thehelp",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "thehelp"
}