Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Swag up your shell output with escape code magic!

Project Description

Color your shell output with escape code magic.

Demo

Installation

pip install swag

Usage

usage: swag [-h] {print,install} ...

positional arguments:
  {print,install}  [command] help
    install        install the colors to the folder of choice
    print          prints the text with the specified color and type to the
                   console

optional arguments:
  -h, --help       show this help message and exit

Raw Usage

Use from code

from swag import colors
print colors.COLORS["red"], "This will be red"
# Or use the swagprinter helpers:

from swag import swagprinter
from swag.swagprinter import INTENSE

swagprinter.print_green("Blah", INTENSE) # Prints an intense green

# Prints an intense green, to the end of the output:
swagprinter.print_green("Blah", INTENSE, true)

Installation to a folder

From the commandline do

swag install -d <path/to/folder> # default is ~/.colors

This will install all the escape codes to the ~/.colors or folder.

Now you can use the colors directly from the console via:

echo $(cat ~/.colors/blue) This will be blue

Release History

Release History

This version
History Node

1.5.1

History Node

1.5.0

History Node

1.4.1

History Node

1.4.0

History Node

1.3.0

History Node

1.2.1

History Node

1.2.0

History Node

1.1.0

History Node

1.0.0

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
swag-1.5.1.tar.gz (17.6 kB) Copy SHA256 Checksum SHA256 Source Sep 18, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting