{"id":20414449,"url":"https://github.com/alexstratou/raia","last_synced_at":"2026-02-05T07:32:29.031Z","repository":{"id":253616047,"uuid":"844037120","full_name":"AlexStratou/raia","owner":"AlexStratou","description":"Simplistic python package to print colored/styled text and emojis with a user friendly API.","archived":false,"fork":false,"pushed_at":"2025-01-16T10:21:46.000Z","size":69,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-12T16:58:45.847Z","etag":null,"topics":["ansii","ansii-escape-code","bold","bold-text","color","colored-terminal","colored-text","emoji","emojis","formatted-text","italic-text","package","python","python3","rgb","rgb-color","styled-text","underline"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AlexStratou.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-08-18T07:20:25.000Z","updated_at":"2025-01-16T10:19:53.000Z","dependencies_parsed_at":"2024-11-15T12:16:45.137Z","dependency_job_id":null,"html_url":"https://github.com/AlexStratou/raia","commit_stats":null,"previous_names":["alexstratou/raia"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/AlexStratou/raia","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStratou%2Fraia","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStratou%2Fraia/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStratou%2Fraia/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStratou%2Fraia/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AlexStratou","download_url":"https://codeload.github.com/AlexStratou/raia/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AlexStratou%2Fraia/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29115548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-05T05:31:32.482Z","status":"ssl_error","status_checked_at":"2026-02-05T05:31:29.075Z","response_time":65,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ansii","ansii-escape-code","bold","bold-text","color","colored-terminal","colored-text","emoji","emojis","formatted-text","italic-text","package","python","python3","rgb","rgb-color","styled-text","underline"],"created_at":"2024-11-15T06:10:03.706Z","updated_at":"2026-02-05T07:32:29.015Z","avatar_url":"https://github.com/AlexStratou.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![License: MIT](https://img.shields.io/badge/License-MIT-green.svg)](LICENSE)\n[![PyPi](https://img.shields.io/pypi/v/raia.svg)](https://pypi.org/project/raia/)\n![versions](https://img.shields.io/pypi/pyversions/raia.svg)\n[![Downloads](https://static.pepy.tech/badge/raia)](https://pepy.tech/project/raia)\n\n![Raia](https://github.com/user-attachments/assets/1a81b43e-d0d6-4b6a-851e-f7ab405d14e4)\n\nSimplistic python package to print colored/styled text and emojis with a user friendly API.\n\n## 1. Introduction\nRaia is a simplistic python package that intends to provide a user friendly API for printing formatted text on the terminal. To do so, raia uses ANSI RGB codes (as many similar packages do). Truecolor ANSI support of the running terminal is assumed.\n\n## 2. Installation\nUsing pip,\n\n```bash\npip install raia\n```\n\n## 3. Usage\n\n### 3.1 Text formatting\n\nRaia formats text through Formatter objects. All Formatter objects have two ways to format text:\n1. Used as a callable, i.e.\n   ```python\n    initialization = 'some initialization'\n    form = raia.Formatter(initialization)\n    formatted_str = form(\"raia package\")\n    print(formatted_str)\n    ```\n2. Using the fprint method that uses the builtin print with the chosen formatting, i.e.\n   ```python\n   initialization = 'some initialization'\n   form = raia.Formatter(initialization)\n   form.fprint(\"raia package\")\n   ```\nBoth of these have the same output (printed \"raia package\" with the formatting specified in the initialization string).\n\nThe Formatter object is initialized by a string  of the ANSI escape code for the chosen formating, e.g. for printing red text we would initialize with:\n```python\nRed = raia.Formatter(\"\\x1b[38;2;255;0;0m\")\n```\nTo bereft the user of having anything to do with such codes, raia provides the Style, Color, FullStyle subclasses of the Formatter class. With them, the user just has to specify the necessary information (e.g. for Color the amounts of RGB, see example below).\n```python\ncustomBlue = raia.Color(50,150,250)\ncustomBlue.fprint('Some blue text')\n```\nOutput:\n\n![image](https://github.com/user-attachments/assets/a2c53fb7-6848-422d-a437-786e1d058388)\n\nTo use a color as background, one must specify it in the initialization of the Color object as,\n\n```python\ncustomBlueBG = raia.Color(50,150,250, as_background=True)\ncustomBlueBG.fprint('Some text in blue background')\n```\n\nOutput:\n\n![image](https://github.com/user-attachments/assets/50b1c895-54b8-4681-a9a1-c4684edae958)\n\n\n\nFor commonly used colors and styles, some Color and Style objects are pre-initialized and can be used out of the box.\nFor example,\n\n```python\nprint(raia.Red('This is red.'), raia.Underline('This is undeline.'))\n```\nis equivalent to,\n```python\nRed = raia.Color(255,0,0) # or  = raia.Color('Red')\nUnderline = raia.Style('underline')\nprint(Red('This is red.'), Underline('This is undeline.'))\n```\nwith output:\n\n![image](https://github.com/user-attachments/assets/868e3806-2843-46a4-8136-fb5b151debba)\n\nA full list of these default color/style keys can be found in \n```python\nraia.defaults.keys() # default colors\nraia.styles.keys()\n```\n\n___\n\n### 3.2 Emojis\n\nThe emoji functionality, is implemented through Emoji objets. For example,\n```python\nHeart = raia.Emoji('\u003c3')\nCookie = raia.Emoji('cookie')\nprint('I ' + Heart + ' ' + Cookie + '!')\n```\nOutput:\n\nI ❤  🍪!\n\nA full list of currently supported emojis can be found in\n```python\nraia.emojis.keys()\n```\n\nFor more concreate usage examples check the example.py script.\n\n## 4. example.py\nBelow, you can see the code and output of the script example.py. \n```python\nimport raia\n\n# Info\nprint(\"Package name: \"+raia.__name__)\nprint(\"Version: \" + raia.__version__)\n\n# Default colors\nprint(raia.Red(\"Default 'Red' as foreground.\"))\nprint(raia.Blue_bg(\"Default 'Blue' as background.\"))\n\n# Custom color\nmyColor = raia.Color(0, 150, 150)\nprint(myColor(\"Custom foreground color.\"))\n\n# Custom background\nmyBackground = raia.Color(255, 0, 150, as_background=True)\nmyBackground.fprint('This is a custom background color.')\n\n# Default style\nprint(raia.Strikethrough('This is a default style.'))\n\n# Custom style\nmyStyle = raia.Style('underline', 'italic', 'bold')\nmyStyle.fprint('This is a custom style.')\n\n# Custom Full-Style\nmyFullStyle = raia.FullStyle(foreground=raia.Violet, background=(\n    0, 80, 180),                           style=myStyle)\nmyFullStyle.fprint('This is a custom fully styled text.')\n\n# Default keys\nprint(raia.Green('Default color keys: \\n'), [*raia.defaults])\nprint(raia.Brown_bg('Available styles keys:\\n'), [*raia.styles])\n\n# Some text with emojis\nHeart = raia.Emoji('\u003c3')\nprint('This prints a heart emoji: ' + Heart)\n\nSmiley = raia.Emoji(':)')\npointRight = raia.Emoji('backhand_index_pointing_right')\nprint(pointRight + \"Emojis and \" +\n      myFullStyle('Formatter objects') + ' can work together' + Smiley)\n\n\nprint(raia.Lime('Full list of emojis:'))\nfor emj_key in raia.emojis:\n    tmpEmoji = raia.Emoji(emj_key)\n    print(tmpEmoji, end='')\n```\nOutput:\n\n![image](https://github.com/user-attachments/assets/267ae979-0e96-4709-96d9-972502a04d1d)\n\n\n\n\n**Important Note**: Not all styles work on all consoles.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstratou%2Fraia","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falexstratou%2Fraia","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falexstratou%2Fraia/lists"}