Skip to main content

Ecstasy

https://travis-ci.org/goldsborough/ecstasy.svg?branch=master https://img.shields.io/github/license/mashape/apistatus.svg https://badge.fury.io/py/ecstasy.svg https://coveralls.io/repos/goldsborough/ecstasy/badge.svg?branch=master&service=github https://landscape.io/github/goldsborough/ecstasy/master/landscape.svg?style=flat https://codeclimate.com/github/goldsborough/ecstasy/badges/gpa.svg http://img.shields.io/gratipay/goldsborough.svg

Ecstasy is here to make your command-line tool beautiful and fancy.

Your command-line tool’s output without ecstasy:

https://raw.githubusercontent.com/goldsborough/ecstasy/master/docs/img/without.png

Your command-line tool’s output with (on?) ecstasy:

https://raw.githubusercontent.com/goldsborough/ecstasy/master/docs/img/with.gif

Usage

To use ecstasy, you mark up a standard Python string using ecstasy’s special syntax, chose some sassy styling and formatting flags, pass them on to the package-level beautify() method and, in return, get your beautified string, ready to kick ass when printed to your command-line:

import ecstasy

# <...> is a normal phrase, its style is determined by its position
# <(x)...> is a phrase with an argument, its style is the one at index 'x'
# <<...> <...>> is a phrase with nested phrases, their styles cascade
text = "<Cats> are <(0)just> <<small>, furry <elephants>>!"

# Beautify text by specifying styles via flag combinations
text = ecstasy.beautify(text,
                        ecstasy.Style.Blink   | ecstasy.Color.Red,
                        ecstasy.Style.Bold    | ecstasy.Fill.Blue,
                        ecstasy.Color.Magenta | ecstasy.Style.Underline,
                        small=ecstasy.Style.Invert | ecstasy.Color.White)

# Keyword arguments (small=...) cause all phrases matching the string of
# the key to have the style specified by the keyword argument's value.

print(text)

Running this in a script from a command-line outputs:

https://raw.githubusercontent.com/goldsborough/ecstasy/master/docs/img/usage.gif

Installation

Now that you’re convinced, you can install ecstasy with pip:

$ pip install ecstasy

… and get crackin’.

Documentation

Full documentation and usage descriptions specifying all possible options and possibilities of how you can beautify your strings with ecstasy can be found here.

Compatibility

Python Versions

Built with Python 3.4 and Python 2.7. Additionally successfully backported to and tested with Python 2.6, 3.2 and also 3.3. See what Travis has to say about it.

Terminal Support

Works out of the box with your Mac’s terminal. For more information, please enjoy this table:

Terminal

Bold

Dim

Underlined

Blink

Invert

Hidden

Color

aTerm

✓

X

✓

X

✓

X

✓

Eterm

(1)

X

✓

X

✓

X

✓

GNOME

✓

✓

✓

X

✓

✓

✓

Guake

✓

✓

✓

X

✓

✓

✓

Konsole

✓

X

✓

✓

✓

X

✓

Nautilus

✓

✓

✓

X

✓

✓

✓

rxvt

✓

X

✓

(2)

✓

X

✓

Terminator

✓

✓

✓

X

✓

✓

✓

Tilda

✓

X

✓

X

✓

X

✓

XFCE4

✓

✓

✓

X

✓

✓

✓

XTerm

✓

X

✓

✓

✓

✓

✓

xvt

✓

X

✓

X

✓

X

X

Linux TTY

✓

X

X

X

✓

X

✓

VTE

✓

✓

✓

X

✓

✓

✓

(1) Lighter colors instead of bold.

(2) Lighter colors instead of blink.

License

Ecstasy is released under the MIT license.

Authors

Peter Goldsborough & cat :heart:

Join the chat at https://gitter.im/goldsborough/ecstasy

Metadata

Release files for ecstasy 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ecstasy 0.1.3
File Size Uploaded Provenance Actions
ecstasy-0.1.3.tar.gz 15.4 kB Without provenance Details for ecstasy-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ecstasy 0.1.3
File Interpreter ABI Platform Actions
ecstasy-0.1.3-py2.py3-none-any.whl Python 3, Python 2 none any Details for ecstasy-0.1.3-py2.py3-none-any.whl

Total release size: 34.5 kB

Release files / ecstasy-0.1.3.tar.gz

Download URL ecstasy-0.1.3.tar.gz
Size 15.4 kB
Tags Source
SHA-256 checksum
How to use checksums
3c535dc6a2b3500114a4e6f44f8e33f0c7e1296444f080ed1c26c4a8dc16bd06
BLAKE2b-256 checksum
How to use checksums
b473467c727fd071c85e77052ab3d964afab4fa28b0dd86eb162affe299f8c89
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ecstasy-0.1.3-py2.py3-none-any.whl

Download URL ecstasy-0.1.3-py2.py3-none-any.whl
Size 19.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
216dda6e5bd33fd6dc3962f6e60894010300ad19764f59f0036bace044115b31
BLAKE2b-256 checksum
How to use checksums
28babc2a56f1322218489d18d5d0e1c1d91cdfaf65ca60e31cfe10b83d5d845b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ecstasy 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.3 This release

2 release files No provenance

0.1.2

0.1.1

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page