Package: clint
Clintis a module filled with a set of awesome tools for developing
commandline applications.CommandLineINterfaceTools
.Clint is awesome. Crazy awesome. It supports colors, but detects if the session is a TTY, so doesn’t render the colors if you’re piping stuff around. Automagically.Awesome nest-able indentation context manager. Example: (with indent(4):puts('indentedtext')). It supports custom email-style quotes. Of course, it supports color too, if and when needed.It has an awesome Column printer with optional auto-expanding columns. It detects how wide your current console is and adjusts accordingly. It wraps your words properly to fit the column size. With or without colors mixed in. All with a single function call.The world’s easiest to use implicit argument system w/ chaining methods for filtering. Seriously.Run the various executables inexamplesto get a good feel for what Clint offers.You’ll never want to not use it.Current Features:Little Documentation (bear with me for now)CLI Colors and IndentsExtremely Simple + Powerful Column PrinterIterator-based Progress BarImplicit Argument HandlingSimple Support for Incoming Unix PipesApplication Directory managementFuture Features:Documentation!Simple choice systemAre you sure? [Yn]Suggestions welcome.ExampleI want to indent my console text.>>> from clint.textui import puts, indent

>>> puts('not indented text')
>>> with indent(4):
>>>     puts('indented text')
not indented text
    indented textI want to quote my console text (like email).>>> puts('not indented text')
>>> with indent(4, quote=' >'):
>>>     puts('quoted text')
>>>     puts('pretty cool, eh?')

not indented text
 >  quoted text
 >  pretty cool, eh?I want to color my console text.>>> from clint.textui import colored, puts

>>> puts(colored.red('red text'))
red text

# It's red in Windows, OSX, and Linux alike.I want to get data piped to stdin.>>> clint.piped_in()

# if no data was piped in, piped_in returns NoneI want to get the first commandline argument passed in.>>> from clint import arguments
>>> args = arguments.Args()
>>> args.get(0)

# if no argument was passed, get returns NoneI want to store a configuration file.>>> from clint import resources

>>> resources.init('Company', 'AppName')
>>> resources.user.write('config.ini', file_contents)

# OSX: '/Users/appuser/Library/Application Support/AppName/config.ini'
# Windows: 'C:\\Users\\appuser\\AppData\\Local\\Company\\AppName\\config.ini'
# Linux: '/home/appuser/.config/appname/config.ini'I want to force color output even if stdout is not a TTY:$ export CLINT_FORCE_COLOR=1I want to ask for input.>>> from clint.textui import prompt, validators
>>> path = prompt.query('Installation Path', default='/usr/local/bin/', validators=[validators.PathValidator()])InstallationTo install clint, simply:$ pip install clintOr, if you absolutely must:$ easy_install clintBut, you really shouldn’t do that.License:ISC License.Copyright (c) 2011, Kenneth Reitz <me@kennethreitz.com>

Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.ContributeIf you’d like to contribute, simply forkthe repository, commit your changes
to themasterbranch (or branch off of it), and send a pull request. Make
sure you add yourself toAUTHORS.RoadmapUnittestsSphinx DocumentationHistory0.5.1Fix line width calculation in max_width when using coloured text (thanks to @wkentaro)0.5.0Added option prompt0.4.1Fix bug in logic that decides whether progress bars should be hidden or not0.4.0clint.textui.prompt now has a query function with validators! (thanks to @aeby) - seeexamples/prompt.pyClint docs are now included in sdist (thanks to @alunduil)Misc. bug fixes0.3.7Clint now obeys the CLINT_FORCE_COLOR environmental variable0.3.6Fixed faulty PyPI deployment0.3.5progress.bar is now a context manager - doesn’t require an iterable anymore (thanks to @jric)Bug fixes0.3.4Fixed Python 3 basestring deprecationFixed examples0.3.3Fixed Python 3 build issuesFixed README and HISTORY being installed to /usrSupport added for bold text0.3.2Unknown0.3.1Unknown0.3.0Python 3 support!0.2.4New eng moduleWin32 Bugfix0.2.3Only init colors if they are used (iPython compatability)New progress moduleVarious bugfixes0.2.2Auto Color DisablingProgress Namespace ChangeNew Progress Barstextui.puts newline fix0.2.1 (2011-03-24)Python 2.5 SupportList of available colors0.2.0 (2011-03-23)Column Printing!!!(Auto/Manual) Disabling of ColorsSmarter Colorsmax_width, min_widthStrip cli colorsbug fixes0.1.2 (2011-03-21)Bugfixes0.1.1 (2011-03-20)BugfixesIndent Newline Injectionresources: flags, not_flags, files, not_filesLots of Examples0.1.0 (2011-03-20)Initial Release!