sapphirus


Namesapphirus JSON
Version 0.0.1 PyPI version JSON
download
home_pagehttps://github.com/ekinpy/sapphirus
SummaryTransform your terminal into a canvas of colors with Sapphirus.
upload_time2023-11-19 16:08:11
maintainer
docs_urlNone
authorEkin Aksu
requires_python
licenseMIT License
keywords terminal style color coloring cli colors
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Logo](https://raw.githubusercontent.com/ekinpy/sapphirus/main/sapphirus.png)

Transform your terminal into a canvas of colors with **Sapphirus**.

`sapphirus` module takes its name from the Latin word _sapphirus_, which means sapphire in English.

## Installing

```sh
pip install sapphirus
```

to test:

```sh
python -m sapphirus
```

## Styled Output

```python
class Text(
    *text: str,
    fg: Any | None (optional),
    bg: Any | None (optional),
    style: Any | None (optional)
)
```

Creating customized outputs according to your preferences is just that simple:

```python
import sapphirus
print(sapphirus.Text("Hello World!", fg="blue", bg="white", style="bold").stylize())
```

You can also use it like this:

```python
import sapphirus
print(sapphirus.Text("Hello", "World!", fg="blue", bg="white", style="bold").stylize())
```

### RGB

```python
(method) def rgb(
    r: int,
    g: int,
    b: int
) -> int
```

Example:

```python
import sapphirus
print(sapphirus.Text("Hello, World!", fg=Text.rgb(0,0,255), bg=Text.rgb(255,255,255), style="bold").stylize())
```

## Typewrite Effect
```python
(function) def typewrite(
    *text: str,
    duration: int | float
) -> None
```

Example:

```python
import sapphirus
sapphirus.typewrite("Hello World!")
```

You can also use it like this:

```python
import sapphirus
sapphirus.typewrite("Hello", "World!")
```

## Styles

| Name | Number |
|-------|---------|
| normal/n | 0 |
| bold/b | 1 |
| italic/i | 3 |
| underlined/u | 4 |
| reversed/r | 7 |
| hidden/h | 8 |
| strike/s | 9 |

## Colors

| Name | Number |
|-------|---------|
| black | 0 |
| red | 1 |
| green | 2 |
| yellow | 3 |
| blue | 4 |
| magenta | 5 |
| cyan | 6 |
| white | 7 |
| brightblack | 8 |
| brightred | 9 |
| brightgreen | 10 |
| brightyellow | 11 |
| brightblue | 12 |
| brightmagenta | 13 |
| brightcyan | 14 |
| brightwhite | 15 |
| grey0 | 16 |
| gray0 | 16 |
| navyblue | 17 |
| darkblue | 18 |
| blue3 | 20 |
| blue1 | 21 |
| darkgreen | 22 |
| deepskyblue4 | 25 |
| dodgerblue3 | 26 |
| dodgerblue2 | 27 |
| green4 | 28 |
| springgreen4 | 29 |
| turquoise4 | 30 |
| deepskyblue3 | 32 |
| dodgerblue1 | 33 |
| green3 | 40 |
| springgreen3 | 41 |
| darkcyan | 36 |
| lightseagreen | 37 |
| deepskyblue2 | 38 |
| deepskyblue1 | 39 |
| springgreen2 | 47 |
| cyan3 | 43 |
| darkturquoise | 44 |
| turquoise2 | 45 |
| green1 | 46 |
| springgreen1 | 48 |
| mediumspringgreen | 49 |
| cyan2 | 50 |
| cyan1 | 51 |
| darkred | 88 |
| deeppink4 | 125 |
| purple4 | 55 |
| purple3 | 56 |
| blueviolet | 57 |
| orange4 | 94 |
| grey37 | 59 |
| gray37 | 59 |
| mediumpurple4 | 60 |
| slateblue3 | 62 |
| royalblue1 | 63 |
| chartreuse4 | 64 |
| darkseagreen4 | 71 |
| paleturquoise4 | 66 |
| steelblue | 67 |
| steelblue3 | 68 |
| cornflowerblue | 69 |
| chartreuse3 | 76 |
| cadetblue | 73 |
| skyblue3 | 74 |
| steelblue1 | 81 |
| palegreen3 | 114 |
| seagreen3 | 78 |
| aquamarine3 | 79 |
| mediumturquoise | 80 |
| chartreuse2 | 112 |
| seagreen2 | 83 |
| seagreen1 | 85 |
| aquamarine1 | 122 |
| darkslategray2 | 87 |
| darkmagenta | 91 |
| darkviolet | 128 |
| purple | 129 |
| lightpink4 | 95 |
| plum4 | 96 |
| mediumpurple3 | 98 |
| slateblue1 | 99 |
| yellow4 | 106 |
| wheat4 | 101 |
| grey53 | 102 |
| gray53 | 102 |
| lightslategrey | 103 |
| lightslategray | 103 |
| mediumpurple | 104 |
| lightslateblue | 105 |
| darkolivegreen3 | 149 |
| darkseagreen | 108 |
| lightskyblue3 | 110 |
| skyblue2 | 111 |
| darkseagreen3 | 150 |
| darkslategray3 | 116 |
| skyblue1 | 117 |
| chartreuse1 | 118 |
| lightgreen | 120 |
| palegreen1 | 156 |
| darkslategray1 | 123 |
| red3 | 160 |
| mediumvioletred | 126 |
| magenta3 | 164 |
| darkorange3 | 166 |
| indianred | 167 |
| hotpink3 | 168 |
| mediumorchid3 | 133 |
| mediumorchid | 134 |
| mediumpurple2 | 140 |
| darkgoldenrod | 136 |
| lightsalmon3 | 173 |
| rosybrown | 138 |
| grey63 | 139 |
| gray63 | 139 |
| mediumpurple1 | 141 |
| gold3 | 178 |
| darkkhaki | 143 |
| navajowhite3 | 144 |
| grey69 | 145 |
| gray69 | 145 |
| lightsteelblue3 | 146 |
| lightsteelblue | 147 |
| yellow3 | 184 |
| darkseagreen2 | 157 |
| lightcyan3 | 152 |
| lightskyblue1 | 153 |
| greenyellow | 154 |
| darkolivegreen2 | 155 |
| darkseagreen1 | 193 |
| paleturquoise1 | 159 |
| deeppink3 | 162 |
| magenta2 | 200 |
| hotpink2 | 169 |
| orchid | 170 |
| mediumorchid1 | 207 |
| orange3 | 172 |
| lightpink3 | 174 |
| pink3 | 175 |
| plum3 | 176 |
| violet | 177 |
| lightgoldenrod3 | 179 |
| tan | 180 |
| mistyrose3 | 181 |
| thistle3 | 182 |
| plum2 | 183 |
| khaki3 | 185 |
| lightgoldenrod2 | 222 |
| lightyellow3 | 187 |
| grey84 | 188 |
| gray84 | 188 |
| lightsteelblue1 | 189 |
| yellow2 | 190 |
| darkolivegreen1 | 192 |
| honeydew2 | 194 |
| lightcyan1 | 195 |
| red1 | 196 |
| deeppink2 | 197 |
| deeppink1 | 199 |
| magenta1 | 201 |
| orangered1 | 202 |
| indianred1 | 204 |
| hotpink | 206 |
| darkorange | 208 |
| salmon1 | 209 |
| lightcoral | 210 |
| palevioletred1 | 211 |
| orchid2 | 212 |
| orchid1 | 213 |
| orange1 | 214 |
| sandybrown | 215 |
| lightsalmon1 | 216 |
| lightpink1 | 217 |
| pink1 | 218 |
| plum1 | 219 |
| gold1 | 220 |
| navajowhite1 | 223 |
| mistyrose1 | 224 |
| thistle1 | 225 |
| yellow1 | 226 |
| lightgoldenrod1 | 227 |
| khaki1 | 228 |
| wheat1 | 229 |
| cornsilk1 | 230 |
| grey100 | 231 |
| gray100 | 231 |
| grey3 | 232 |
| gray3 | 232 |
| grey7 | 233 |
| gray7 | 233 |
| grey11 | 234 |
| gray11 | 234 |
| grey15 | 235 |
| gray15 | 235 |
| grey19 | 236 |
| gray19 | 236 |
| grey23 | 237 |
| gray23 | 237 |
| grey27 | 238 |
| gray27 | 238 |
| grey30 | 239 |
| gray30 | 239 |
| grey35 | 240 |
| gray35 | 240 |
| grey39 | 241 |
| gray39 | 241 |
| grey42 | 242 |
| gray42 | 242 |
| grey46 | 243 |
| gray46 | 243 |
| grey50 | 244 |
| gray50 | 244 |
| grey54 | 245 |
| gray54 | 245 |
| grey58 | 246 |
| gray58 | 246 |
| grey62 | 247 |
| gray62 | 247 |
| grey66 | 248 |
| gray66 | 248 |
| grey70 | 249 |
| gray70 | 249 |
| grey74 | 250 |
| gray74 | 250 |
| grey78 | 251 |
| gray78 | 251 |
| grey82 | 252 |
| gray82 | 252 |
| grey85 | 253 |
| gray85 | 253 |
| grey89 | 254 |
| gray89 | 254 |
| grey93 | 255 |
| gray93 | 255 |

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/ekinpy/sapphirus",
    "name": "sapphirus",
    "maintainer": "",
    "docs_url": null,
    "requires_python": "",
    "maintainer_email": "",
    "keywords": "terminal,style,color,coloring,cli,colors",
    "author": "Ekin Aksu",
    "author_email": "",
    "download_url": "https://files.pythonhosted.org/packages/20/78/a14341c06b5f36cbf761a3ce5ee30ca0022dd41bb45699110026e9f4ba63/sapphirus-0.0.1.tar.gz",
    "platform": null,
    "description": "![Logo](https://raw.githubusercontent.com/ekinpy/sapphirus/main/sapphirus.png)\r\n\r\nTransform your terminal into a canvas of colors with **Sapphirus**.\r\n\r\n`sapphirus` module takes its name from the Latin word _sapphirus_, which means sapphire in English.\r\n\r\n## Installing\r\n\r\n```sh\r\npip install sapphirus\r\n```\r\n\r\nto test:\r\n\r\n```sh\r\npython -m sapphirus\r\n```\r\n\r\n## Styled Output\r\n\r\n```python\r\nclass Text(\r\n    *text: str,\r\n    fg: Any | None (optional),\r\n    bg: Any | None (optional),\r\n    style: Any | None (optional)\r\n)\r\n```\r\n\r\nCreating customized outputs according to your preferences is just that simple:\r\n\r\n```python\r\nimport sapphirus\r\nprint(sapphirus.Text(\"Hello World!\", fg=\"blue\", bg=\"white\", style=\"bold\").stylize())\r\n```\r\n\r\nYou can also use it like this:\r\n\r\n```python\r\nimport sapphirus\r\nprint(sapphirus.Text(\"Hello\", \"World!\", fg=\"blue\", bg=\"white\", style=\"bold\").stylize())\r\n```\r\n\r\n### RGB\r\n\r\n```python\r\n(method) def rgb(\r\n    r: int,\r\n    g: int,\r\n    b: int\r\n) -> int\r\n```\r\n\r\nExample:\r\n\r\n```python\r\nimport sapphirus\r\nprint(sapphirus.Text(\"Hello, World!\", fg=Text.rgb(0,0,255), bg=Text.rgb(255,255,255), style=\"bold\").stylize())\r\n```\r\n\r\n## Typewrite Effect\r\n```python\r\n(function) def typewrite(\r\n    *text: str,\r\n    duration: int | float\r\n) -> None\r\n```\r\n\r\nExample:\r\n\r\n```python\r\nimport sapphirus\r\nsapphirus.typewrite(\"Hello World!\")\r\n```\r\n\r\nYou can also use it like this:\r\n\r\n```python\r\nimport sapphirus\r\nsapphirus.typewrite(\"Hello\", \"World!\")\r\n```\r\n\r\n## Styles\r\n\r\n| Name | Number |\r\n|-------|---------|\r\n| normal/n | 0 |\r\n| bold/b | 1 |\r\n| italic/i | 3 |\r\n| underlined/u | 4 |\r\n| reversed/r | 7 |\r\n| hidden/h | 8 |\r\n| strike/s | 9 |\r\n\r\n## Colors\r\n\r\n| Name | Number |\r\n|-------|---------|\r\n| black | 0 |\r\n| red | 1 |\r\n| green | 2 |\r\n| yellow | 3 |\r\n| blue | 4 |\r\n| magenta | 5 |\r\n| cyan | 6 |\r\n| white | 7 |\r\n| brightblack | 8 |\r\n| brightred | 9 |\r\n| brightgreen | 10 |\r\n| brightyellow | 11 |\r\n| brightblue | 12 |\r\n| brightmagenta | 13 |\r\n| brightcyan | 14 |\r\n| brightwhite | 15 |\r\n| grey0 | 16 |\r\n| gray0 | 16 |\r\n| navyblue | 17 |\r\n| darkblue | 18 |\r\n| blue3 | 20 |\r\n| blue1 | 21 |\r\n| darkgreen | 22 |\r\n| deepskyblue4 | 25 |\r\n| dodgerblue3 | 26 |\r\n| dodgerblue2 | 27 |\r\n| green4 | 28 |\r\n| springgreen4 | 29 |\r\n| turquoise4 | 30 |\r\n| deepskyblue3 | 32 |\r\n| dodgerblue1 | 33 |\r\n| green3 | 40 |\r\n| springgreen3 | 41 |\r\n| darkcyan | 36 |\r\n| lightseagreen | 37 |\r\n| deepskyblue2 | 38 |\r\n| deepskyblue1 | 39 |\r\n| springgreen2 | 47 |\r\n| cyan3 | 43 |\r\n| darkturquoise | 44 |\r\n| turquoise2 | 45 |\r\n| green1 | 46 |\r\n| springgreen1 | 48 |\r\n| mediumspringgreen | 49 |\r\n| cyan2 | 50 |\r\n| cyan1 | 51 |\r\n| darkred | 88 |\r\n| deeppink4 | 125 |\r\n| purple4 | 55 |\r\n| purple3 | 56 |\r\n| blueviolet | 57 |\r\n| orange4 | 94 |\r\n| grey37 | 59 |\r\n| gray37 | 59 |\r\n| mediumpurple4 | 60 |\r\n| slateblue3 | 62 |\r\n| royalblue1 | 63 |\r\n| chartreuse4 | 64 |\r\n| darkseagreen4 | 71 |\r\n| paleturquoise4 | 66 |\r\n| steelblue | 67 |\r\n| steelblue3 | 68 |\r\n| cornflowerblue | 69 |\r\n| chartreuse3 | 76 |\r\n| cadetblue | 73 |\r\n| skyblue3 | 74 |\r\n| steelblue1 | 81 |\r\n| palegreen3 | 114 |\r\n| seagreen3 | 78 |\r\n| aquamarine3 | 79 |\r\n| mediumturquoise | 80 |\r\n| chartreuse2 | 112 |\r\n| seagreen2 | 83 |\r\n| seagreen1 | 85 |\r\n| aquamarine1 | 122 |\r\n| darkslategray2 | 87 |\r\n| darkmagenta | 91 |\r\n| darkviolet | 128 |\r\n| purple | 129 |\r\n| lightpink4 | 95 |\r\n| plum4 | 96 |\r\n| mediumpurple3 | 98 |\r\n| slateblue1 | 99 |\r\n| yellow4 | 106 |\r\n| wheat4 | 101 |\r\n| grey53 | 102 |\r\n| gray53 | 102 |\r\n| lightslategrey | 103 |\r\n| lightslategray | 103 |\r\n| mediumpurple | 104 |\r\n| lightslateblue | 105 |\r\n| darkolivegreen3 | 149 |\r\n| darkseagreen | 108 |\r\n| lightskyblue3 | 110 |\r\n| skyblue2 | 111 |\r\n| darkseagreen3 | 150 |\r\n| darkslategray3 | 116 |\r\n| skyblue1 | 117 |\r\n| chartreuse1 | 118 |\r\n| lightgreen | 120 |\r\n| palegreen1 | 156 |\r\n| darkslategray1 | 123 |\r\n| red3 | 160 |\r\n| mediumvioletred | 126 |\r\n| magenta3 | 164 |\r\n| darkorange3 | 166 |\r\n| indianred | 167 |\r\n| hotpink3 | 168 |\r\n| mediumorchid3 | 133 |\r\n| mediumorchid | 134 |\r\n| mediumpurple2 | 140 |\r\n| darkgoldenrod | 136 |\r\n| lightsalmon3 | 173 |\r\n| rosybrown | 138 |\r\n| grey63 | 139 |\r\n| gray63 | 139 |\r\n| mediumpurple1 | 141 |\r\n| gold3 | 178 |\r\n| darkkhaki | 143 |\r\n| navajowhite3 | 144 |\r\n| grey69 | 145 |\r\n| gray69 | 145 |\r\n| lightsteelblue3 | 146 |\r\n| lightsteelblue | 147 |\r\n| yellow3 | 184 |\r\n| darkseagreen2 | 157 |\r\n| lightcyan3 | 152 |\r\n| lightskyblue1 | 153 |\r\n| greenyellow | 154 |\r\n| darkolivegreen2 | 155 |\r\n| darkseagreen1 | 193 |\r\n| paleturquoise1 | 159 |\r\n| deeppink3 | 162 |\r\n| magenta2 | 200 |\r\n| hotpink2 | 169 |\r\n| orchid | 170 |\r\n| mediumorchid1 | 207 |\r\n| orange3 | 172 |\r\n| lightpink3 | 174 |\r\n| pink3 | 175 |\r\n| plum3 | 176 |\r\n| violet | 177 |\r\n| lightgoldenrod3 | 179 |\r\n| tan | 180 |\r\n| mistyrose3 | 181 |\r\n| thistle3 | 182 |\r\n| plum2 | 183 |\r\n| khaki3 | 185 |\r\n| lightgoldenrod2 | 222 |\r\n| lightyellow3 | 187 |\r\n| grey84 | 188 |\r\n| gray84 | 188 |\r\n| lightsteelblue1 | 189 |\r\n| yellow2 | 190 |\r\n| darkolivegreen1 | 192 |\r\n| honeydew2 | 194 |\r\n| lightcyan1 | 195 |\r\n| red1 | 196 |\r\n| deeppink2 | 197 |\r\n| deeppink1 | 199 |\r\n| magenta1 | 201 |\r\n| orangered1 | 202 |\r\n| indianred1 | 204 |\r\n| hotpink | 206 |\r\n| darkorange | 208 |\r\n| salmon1 | 209 |\r\n| lightcoral | 210 |\r\n| palevioletred1 | 211 |\r\n| orchid2 | 212 |\r\n| orchid1 | 213 |\r\n| orange1 | 214 |\r\n| sandybrown | 215 |\r\n| lightsalmon1 | 216 |\r\n| lightpink1 | 217 |\r\n| pink1 | 218 |\r\n| plum1 | 219 |\r\n| gold1 | 220 |\r\n| navajowhite1 | 223 |\r\n| mistyrose1 | 224 |\r\n| thistle1 | 225 |\r\n| yellow1 | 226 |\r\n| lightgoldenrod1 | 227 |\r\n| khaki1 | 228 |\r\n| wheat1 | 229 |\r\n| cornsilk1 | 230 |\r\n| grey100 | 231 |\r\n| gray100 | 231 |\r\n| grey3 | 232 |\r\n| gray3 | 232 |\r\n| grey7 | 233 |\r\n| gray7 | 233 |\r\n| grey11 | 234 |\r\n| gray11 | 234 |\r\n| grey15 | 235 |\r\n| gray15 | 235 |\r\n| grey19 | 236 |\r\n| gray19 | 236 |\r\n| grey23 | 237 |\r\n| gray23 | 237 |\r\n| grey27 | 238 |\r\n| gray27 | 238 |\r\n| grey30 | 239 |\r\n| gray30 | 239 |\r\n| grey35 | 240 |\r\n| gray35 | 240 |\r\n| grey39 | 241 |\r\n| gray39 | 241 |\r\n| grey42 | 242 |\r\n| gray42 | 242 |\r\n| grey46 | 243 |\r\n| gray46 | 243 |\r\n| grey50 | 244 |\r\n| gray50 | 244 |\r\n| grey54 | 245 |\r\n| gray54 | 245 |\r\n| grey58 | 246 |\r\n| gray58 | 246 |\r\n| grey62 | 247 |\r\n| gray62 | 247 |\r\n| grey66 | 248 |\r\n| gray66 | 248 |\r\n| grey70 | 249 |\r\n| gray70 | 249 |\r\n| grey74 | 250 |\r\n| gray74 | 250 |\r\n| grey78 | 251 |\r\n| gray78 | 251 |\r\n| grey82 | 252 |\r\n| gray82 | 252 |\r\n| grey85 | 253 |\r\n| gray85 | 253 |\r\n| grey89 | 254 |\r\n| gray89 | 254 |\r\n| grey93 | 255 |\r\n| gray93 | 255 |\r\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Transform your terminal into a canvas of colors with Sapphirus.",
    "version": "0.0.1",
    "project_urls": {
        "Homepage": "https://github.com/ekinpy/sapphirus"
    },
    "split_keywords": [
        "terminal",
        "style",
        "color",
        "coloring",
        "cli",
        "colors"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "2078a14341c06b5f36cbf761a3ce5ee30ca0022dd41bb45699110026e9f4ba63",
                "md5": "1d49c84719e2b77bc75d286ba3009ca9",
                "sha256": "d43dcd1f580954f7ae42cecc3def9839528e66b3417d276608e831e06d39dcf7"
            },
            "downloads": -1,
            "filename": "sapphirus-0.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1d49c84719e2b77bc75d286ba3009ca9",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 6177,
            "upload_time": "2023-11-19T16:08:11",
            "upload_time_iso_8601": "2023-11-19T16:08:11.720453Z",
            "url": "https://files.pythonhosted.org/packages/20/78/a14341c06b5f36cbf761a3ce5ee30ca0022dd41bb45699110026e9f4ba63/sapphirus-0.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-11-19 16:08:11",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "ekinpy",
    "github_project": "sapphirus",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "sapphirus"
}
        
Elapsed time: 0.14388s