Skip to content

A python library for playing with colourful string representations using ANSI.

License

Notifications You must be signed in to change notification settings

astromancer/motley

Repository files navigation

motley

Rocking terminal colours. Just like in the 80s. 🏳️‍🌈🤘🏽🎸

A python library for playing with colourful string representations using ANSI escape sequences.

Install

pip install https://github.com/astromancer/motley

Use

Colouring and Styling Text

Stylization via extended format directives

>>> motley.format('This text is {:|g}!'.format('green')
>>> motley.format('{:{:|g} {:|bB_}!<13}'.format('Hello', 'World')

Convenience functions

>>> motley.green_on_white(':)')

Test

The test suite contains further examples of how motley can be used. Testing is done with pytest:

pytest motley

Contribute

Contributions are welcome!

  1. Fork it!
  2. Create your feature branch
    git checkout -b feature/rad
  3. Commit your changes
    git commit -am 'Add some cool feature 😎'
  4. Push to the branch
    git push origin feature/rad
  5. Create a new Pull Request

Contact

License

About

A python library for playing with colourful string representations using ANSI.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages