{"id":22509193,"url":"https://github.com/adrg/splash-py","last_synced_at":"2026-04-13T23:32:13.089Z","repository":{"id":22762835,"uuid":"26108546","full_name":"adrg/splash-py","owner":"adrg","description":"Add a splash of color to your CLI apps","archived":false,"fork":false,"pushed_at":"2014-11-03T08:49:23.000Z","size":128,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-28T00:24:03.466Z","etag":null,"topics":["colors","python","shell","splash","terminal"],"latest_commit_sha":null,"homepage":null,"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/adrg.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}},"created_at":"2014-11-03T07:42:07.000Z","updated_at":"2019-02-09T14:08:09.000Z","dependencies_parsed_at":"2022-08-21T12:30:20.903Z","dependency_job_id":null,"html_url":"https://github.com/adrg/splash-py","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/adrg/splash-py","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsplash-py","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsplash-py/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsplash-py/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsplash-py/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/adrg","download_url":"https://codeload.github.com/adrg/splash-py/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/adrg%2Fsplash-py/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31775758,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-13T20:17:16.280Z","status":"ssl_error","status_checked_at":"2026-04-13T20:17:08.216Z","response_time":93,"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":["colors","python","shell","splash","terminal"],"created_at":"2024-12-07T01:28:04.153Z","updated_at":"2026-04-13T23:32:13.070Z","avatar_url":"https://github.com/adrg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![logo](https://raw.githubusercontent.com/adrg/adrg.github.io/master/assets/projects/splash-py/logo.png)\n======\n[![License: MIT](http://img.shields.io/badge/license-MIT-red.svg?style=flat-square)](http://opensource.org/licenses/MIT)\n\nSplash is a small Python 3 package which gives you the ability to style\nterminal output.  It provides a set of types and functions to allow coloring\nand styling of output text. It can be useful in CLI applications or logging\nlibraries.\n\nThe core of the package is the **Property** class. A property represents either\na color (foreground or background) or a text attribute (bold, underline, etc.).\nThe package also defines the **Style** class which is just a collection of\nproperties. Styles provide the ability to store a group of properties and\nreuse them when needed. From a coding standpoint, there is no difference\nbetween using a property and a style.\n\nThis package is a port of the [Splash](https://github.com/adrg/splash)\nlibrary, originally written for the Go language.\n\n## Installation\n```sh\ngit clone https://github.com/adrg/splash-py.git\n\n# With distutils\ncd splash-py\npython3 setup.py install\n\n# With pip3\npip3 install splash-py\n```\n\n## Usage\n\n#### Properties\n```python\n#!/usr/bin/env python3\nimport splash\n\nreset = splash.reset\n\n# Using text attributes\nprint(splash.bold, 'To boldly go ', reset, sep='', end='')\nprint(splash.underline, 'where no man ', reset, ' ', sep='')\nprint(splash.reverse, 'has gone before\\n', reset, sep='')\n\n# Using foreground and background colors\nprint(splash.red, 'Roses are red', reset, sep='')\nprint(splash.bg_green, \"Here's something new:\", reset, sep='')\nprint(splash.magenta, 'Violets are violet', reset, sep='')\nprint(splash.bg_blue, 'Not freaking blue!\\n', reset, sep='')\n\n# Combining colors with text attributes\nprint(splash.bold, splash.green, 'Hint: lamp', reset, sep='')\nprint(splash.red, splash.bg_blue, 'Hint: famous plumbler\\n', reset, sep='')\n\n# Using formatting\nprint(splash.bg_yellow.format('Yellow there!'))\nprint('{0}The Wicked Witch of The West{1}'.format(splash.green, reset))\nprint(splash.bold.format('{0}{1}', splash.blue, \"Don't feel blue!\"))\n```\nOutput:\n![properties output](https://raw.githubusercontent.com/adrg/adrg.github.io/master/assets/projects/splash-py/properties.png)\n\n#### Styles\n```python\n#!/usr/bin/env python3\nimport splash\n\n# Using styles\ninfo = splash.Style(splash.green, splash.bold)\nwarning = splash.Style(splash.yellow)\nerr = splash.Style(splash.red, splash.bold)\ncritical = splash.Style(splash.bold, splash.yellow, splash.bg_red)\n\nprint(info, \"INFO: I'm so informative\", splash.reset, sep='')\nprint(warning, 'WARNING: You should not ignore me', splash.reset, sep='')\nprint(err.format(\"ERROR: You can't say I didn't warn you\"))\nprint(critical.format('{0} {1}\\n', 'CRITICAL:', 'This should be good'))\n\n# Parsing styles\n# Format: foreground:background+attributes\nattr = splash.Style.parse('+b')\nprint(attr.format('Bold'))\n\nattrs = splash.Style.parse('+bu')\nprint(attrs.format('Bold, underline'))\n\nfg = splash.Style.parse('yellow')\nprint(fg.format('Yellow foreground'))\n\nbg = splash.Style.parse(':red')\nprint(bg.format('Red background'))\n\nfgAttr = splash.Style.parse('green+b')\nprint(fgAttr.format('Green foreground, bold'))\n\nbgAttr = splash.Style.parse(':magenta+u')\nprint(bgAttr.format('Magenta background, underline'))\n\nfgBg = splash.Style.parse('cyan:red')\nprint(fgBg.format('Cyan foreground, red background'))\n\nfgBgAttr = splash.Style.parse('yellow:blue+b')\nprint(fgBgAttr.format('Yellow foreground, blue background, bold'))\n\nfgBgAttrs = splash.Style.parse('red:green+br')\nprint(fgBgAttrs.format('Red foreground, green background, bold, reverse'))\n```\nOutput:\n![styles output](https://raw.githubusercontent.com/adrg/adrg.github.io/master/assets/projects/splash-py/styles.png)\n\n## Property reference\n![property reference](https://raw.githubusercontent.com/adrg/adrg.github.io/master/assets/projects/splash-py/colors.png)\n\n**Foreground colors**\n```\nblack red green yellow blue magenta cyan white\n```\n\n**Background colors**\n```\nbg_black bg_red bg_green bg_yellow bg_blue bg_magenta bg_cyan bg_white\n```\n\n**Text attributes**\n```\nreset bold dim italic underline blink fast_blink reverse hidden crossed_out\n```\n\n * Note: unfortunately not all text attributes are supported in all terminals.\n\n## Style parsing reference\n\n**Format**\n```\nforeground:background+attributes\n```\n\n**Colors**\n```\nblack red green yellow blue magenta cyan white\n```\n\n**Text attributes**\n```\nb     - bold\nd     - dim\ni     - italic\nu     - underline\nB     - blink\nf     - fast_blink\nr     - reverse\nh     - hidden\nc     - crossed_out\nreset - reset\n```\n\n## References\nFor more information see the [ANSI escape sequences](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors)\nand [Terminal colors and formatting](http://misc.flogisoft.com/bash/tip_colors_and_formatting)\n\n## License\nCopyright (c) 2014 Adrian-George Bostan.\n\nThis project is licensed under the [MIT license](http://opensource.org/licenses/MIT). See LICENSE for more details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrg%2Fsplash-py","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fadrg%2Fsplash-py","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fadrg%2Fsplash-py/lists"}