{"id":22097819,"url":"https://github.com/4thel00z/swag","last_synced_at":"2025-07-24T22:33:12.448Z","repository":{"id":57439011,"uuid":"82394910","full_name":"4thel00z/swag","owner":"4thel00z","description":"Color your shell output with escape code magic.","archived":false,"fork":false,"pushed_at":"2024-09-22T10:37:32.000Z","size":97,"stargazers_count":7,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-17T18:04:45.868Z","etag":null,"topics":["echo","print","python","shell","theming"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/4thel00z.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-02-18T15:12:20.000Z","updated_at":"2024-09-22T10:37:35.000Z","dependencies_parsed_at":"2022-09-19T14:10:38.201Z","dependency_job_id":null,"html_url":"https://github.com/4thel00z/swag","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/4thel00z/swag","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4thel00z%2Fswag","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4thel00z%2Fswag/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4thel00z%2Fswag/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4thel00z%2Fswag/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/4thel00z","download_url":"https://codeload.github.com/4thel00z/swag/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/4thel00z%2Fswag/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266111439,"owners_count":23877980,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["echo","print","python","shell","theming"],"created_at":"2024-12-01T04:16:52.579Z","updated_at":"2025-07-24T22:33:12.090Z","avatar_url":"https://github.com/4thel00z.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Swag\n\nColor your shell output with escape code magic.\n\n[![Demo](https://asciinema.org/a/fciEE57CeLkKBQl5uoU51rgPR.svg)](https://asciinema.org/a/fciEE57CeLkKBQl5uoU51rgPR)\n\n## Installation\n\n`pip install swag`\n\n## Usage\n\n```\nUsage: swag [OPTIONS] COMMAND [ARGS]...\n\nOptions:\n  --install-completion [bash|zsh|fish|powershell|pwsh]\n                                  Install completion for the specified shell.\n  --show-completion [bash|zsh|fish|powershell|pwsh]\n                                  Show completion for the specified shell, to\n                                  copy it or customize the installation.\n\n  --help                          Show this message and exit.\n\nCommands:\n  install\n  list\n  print\n```\n\n## CLI Usage\n\n### Print to the cli\n\nYou can print colored from the shell as follows:\n\n```shell\nswag print --color yellow --modifier intense_bold \"This text will be intense_bold and yellow :-)\"\n```\n\nThe possible modifiers are:\n\n* underline\n* background\n* bold\n* intense\n* intense_bold\n* intense_background\n\n### Installation to a folder\n\nFrom the commandline do:\n\n```shell\nswag install --dest \u003cpath/to/folder\u003e # default is ~/.colors\n```\n\nThis will install all the escape codes to the ~/.colors or \u003cpath/to/folder\u003e folder.\n\nNow you can use the colors directly from the console via:\n\n`echo $(cat ~/.colors/blue) This will be blue`\n\n### List all colors\n\nPrints a list of colors (color coded).\n\n```shell\nswag list\n```\n\n## Use from code\n\n### Print to the console\n\n```python\nfrom swag import red, green, reset, INTENSE\n\nred(\"This will be red\")\ngreen(\"Blah\", modifier=INTENSE)  # Prints an intense green\n# Prints an intense green, to the end of the output, means if you use print after it will be green too:\ngreen(\"This is green until the end\", modifier=INTENSE, continuous=True)\nprint(\"This will still be green\")\nreset()  # From now on the default cli color will be used\n```\n\n### Use the colors in a string\n\n```python\nfrom swag import colors\nprint(f\"{colors.red}This will be red{colors.reset}\")\n```\n\n## License\n\nThis project is licensed under the GPL-3 license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4thel00z%2Fswag","html_url":"https://awesome.ecosyste.ms/projects/github.com%2F4thel00z%2Fswag","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2F4thel00z%2Fswag/lists"}