python-textile is a Python port of Textile, Dean Allen’s humane web text generator.
Install the ‘textile’ folder on your python path, or easy_install http://github.com/chrisdrackett/python-textile/tarball/master#egg=python-textile.
>>> import textile
>>> s = """
... _This_ is a *test.*
...
... * One
... * Two
... * Three
...
... Link to "Slashdot":http://slashdot.org/
... """
>>> html = textile.textile(s)
>>> print html
<em>This</em> is a <strong>test.</strong>
<ul>
<li>One</li>
<li>Two</li>
<li>Three</li>
</ul>
<p>Link to <a href="http://slashdot.org/">Slashdot</a>
</p>
>>>
You can add a base to link urls using the base_url option and a base to image URLs using the base_image_url option on either of the functions to generate textile.
>>> import textile
>>> s = """
... "README":README.textile
... """
>>> url = 'http://github.com/chrisdrackett/python-textile/tree/master/'
>>> html = textile.textile(s, base_url=url)
>>> print html
<p><a href="http://github.com/chrisdrackett/python-textile/tree/master/README.textile">README</a></p>