Skip to content
This repository has been archived by the owner on Apr 24, 2018. It is now read-only.

Command-Line utilities for Click (extracted from Clint).

Notifications You must be signed in to change notification settings

not-kennethreitz/click-tools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

click-tools

A collection of utilities (extracted from clint), for use with Click.

Examples

Printing various colors:

import click
from click_tools import crayons

click.echo(
    '{red}{blue}{gren}'.format(
        red=crayon.red('red'),
        blue=crayon.blue('blue')
        green=crayon.green('green')
    )
)

Identation:

from click_tools import puts, indent

puts('this is an example of text that is not indented')
with indent(4):
    puts('This is indented text.')

Columns:

>>> from click_tools import cols

>>> a = (
        'a very long string that requires text-wrapping in order to be '
        'printed correctly.'
    )
>>> b = 'this is other text\nothertext\nothertext'

>>> click.echo(columns((a, 20), (b, 20), (b, None)))
a very long string   this is other text   this is other text
that requires        othertext            othertext
text-wrapping in     othertext            othertext
order to be printed
correctly.

About

Command-Line utilities for Click (extracted from Clint).

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages