<?xml version="1.0"?>
<?xml-stylesheet type='text/xsl' href='interface.xsl'?>
<interface xmlns="http://zero-install.sourceforge.net/2004/injector/interface" uri="http://gfxmonk.net/dist/0install/python-termstyle.xml">
	<name>termstyle</name>
	<summary>console colouring for python</summary>
	<homepage>http://github.com/gfxmonk/termstyle</homepage>
	<description>
=========
termstyle
=========

termstyle is a simple python library for adding coloured output to
terminal (console) programs.  The definitions come from ECMA-048_, the
"Control Functions for Coded Character Sets" standard.

Installation:
-------------

I thoroughly recommend using the zero-install feed (see the project homepage) to manage your dependencies if at all possible. zero-install_ provides a much better system than pip or easy_install, and works with absolutely any language and allows decentralised package management that requires no special privileges to install.

Example Usage:
--------------
::

	from termstyle import *
	print "%s:%s" % (red('Hey'), green('how are you?'))
	print blue('How ', bold('you'), ' doin?')

or, you can use a colour just as a string::

	print "%sBlue!%s" % (blue, reset)

Styles:
-------
::

	reset or default (no colour / style)

colour::

	black
	red
	green
	yellow
	blue
	magenta
	cyan
	white

background colour::

	bg_black
	bg_red
	bg_green
	bg_yellow
	bg_blue
	bg_magenta
	bg_cyan
	bg_white
	bg_default

In terminals supporting transparency ``bg_default`` is often used to set
the background to transparent [#]_.

weight::

	bold
	inverted

style::

	italic
	underscore

Controls:
---------
::

	auto() - sets colouring on only if sys.stdout is a terminal
	disabe() - disable colours
	enable() - enable colours

.. [#] Supporting terminals include rxvt-unicode_, and Eterm_.

.. _ECMA-048: http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf
.. _rxvt-unicode: http://software.schmorp.de/
.. _Eterm: http://www.eterm.org/
.. _zero-install: http://0install.net/

	</description>
	<pypi-extra xmlns="http://gfxmonk.net/dist/0install"><![CDATA[
	classifiers=[
		"License :: OSI Approved :: BSD License",
		"Programming Language :: Python",
		"Programming Language :: Python :: 3",
		"Intended Audience :: Developers",
		"Topic :: Software Development :: Libraries :: Python Modules",
	],
	keywords='output colour console ansi',
	license='BSD',
		]]></pypi-extra>
	<rich-description xmlns="http://gfxmonk.net/dist/0install">
		<div xmlns="http://www.w3.org/1999/xhtml">
			<h1 id="termstyle">termstyle</h1>
			<p>termstyle is a simple python library for adding coloured output to terminal (console) programs. The definitions come from <a href="http://www.ecma-international.org/publications/files/ECMA-ST/Ecma-048.pdf">ECMA-048</a>, the "Control Functions for Coded Character Sets" standard.</p>
			<h2 id="installation">Installation:</h2>
			<p>I thoroughly recommend using the zero-install feed (see the project homepage) to manage your dependencies if at all possible. <a href="http://0install.net/">zero-install</a> provides a much better system than pip or easy_install, and works with absolutely any language and allows decentralised package management that requires no special privileges to install.</p>
			<h2 id="example-usage">Example Usage:</h2>
			<pre><code>from termstyle import *
print "%s:%s" % (red('Hey'), green('how are you?'))
print blue('How ', bold('you'), ' doin?')
</code></pre>
			<p>or, you can use a colour just as a string:</p>
			<pre><code>print "%sBlue!%s" % (blue, reset)
</code></pre>
			<h2 id="styles">Styles:</h2>
			<pre><code>reset or default (no colour / style)
</code></pre>
			<p>colour:</p>
			<pre><code>black
red
green
yellow
blue
magenta
cyan
white
</code></pre>
			<p>background colour:</p>
			<pre><code>bg_black
bg_red
bg_green
bg_yellow
bg_blue
bg_magenta
bg_cyan
bg_white
bg_default
</code></pre>
			<p>In terminals supporting transparency <code>bg_default</code> is often used to set the background to transparent [#]_.</p>
			<p>weight:</p>
			<pre><code>bold
inverted
</code></pre>
			<p>style:</p>
			<pre><code>italic
underscore
</code></pre>
			<h2 id="controls">Controls:</h2>
			<pre><code>auto() - sets colouring on only if sys.stdout is a terminal
disabe() - disable colours
enable() - enable colours
</code></pre>
		</div>
	</rich-description>
	<group>
		<environment insert="" mode="prepend" name="PYTHONPATH"/>
		<implementation id="sha1new=1f5b66dcd48fa38740aa98bb2796f0adb7eeab04" released="2010-07-18" version="0.1.5">
			<manifest-digest sha256="9b0ff9b07c1d424484b5aa20fc2db7827a372d84515e8caf46b005f54a034e07"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.2.tgz" size="3114"/>
		</implementation>
		<implementation id="sha1new=9f728d8ba0eb5379c907b85a9662c54935f1e0ca" released="2010-11-05" version="0.1.6">
			<manifest-digest sha256="a7283c6fe262bc88ed270a91304da243c474d32353c2c9d6c6f4003bacfce27c"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.6.tgz" size="3607"/>
		</implementation>
		<implementation id="sha1new=93d781ad4b723d154462f990254f78d3bab7456e" released="2011-01-29" version="0.1.7">
			<manifest-digest sha256="31488cd005a3f9182e6738068a5e9ddfd6d28db370d8b0a0b16d5bbc53048665"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.7.tgz" size="4265"/>
		</implementation>
		<implementation id="sha1new=ada58698e40a6f11b40dbebaa11f70061b47172d" released="2011-03-15" version="0.1.8">
			<manifest-digest sha256="cbcee0509b194eec74a5fe923999b505293c5d0a20b3d79203fa6f47a942b24e"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.8.tgz" size="4312"/>
		</implementation>
		<implementation id="sha1new=e718d149b78028f3ac39ee4de42e0b7644ad48fb" released="2011-03-16" version="0.1.9">
			<manifest-digest sha256="ee3dc9b097ac0b7682fab8753a5dab45f0a9c189544c13a369ada8b9e1f4fde8"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.9.tgz" size="2901"/>
		</implementation>
		<implementation id="sha1new=0c4adef2eccc7ddcb48264c4bc2d84fcfa1072a4" released="2011-04-30" version="0.1.10">
			<manifest-digest sha256="df3b9e11077995f515239eb8382acdfa1741c35e867916917cf70ce53e49bd59"/>
			<archive href="http://gfxmonk.net/dist/0install/python-termstyle/python-termstyle-0.1.10.tgz" size="2903"/>
		</implementation>
	</group>
</interface>