Skip to main content

Textile processing for python.

Project description

python-textile

python-textile

python-textile is a Python port of Textile, Dean Allen’s humane web text generator.

Installation

pip install textile

Dependencies:

  • nh3
  • regex (The regex package causes problems with PyPy, and is not installed as a dependency in such environments. If you are upgrading a textile install on PyPy which had regex previously included, you may need to uninstall it.)

Optional dependencies include:

  • PIL/Pillow (for checking image sizes). If needed, install via pip install 'textile[imagesize]'

Usage

import textile
>>> s = """
... _This_ is a *test.*
...
... * One
... * Two
... * Three
...
... Link to "Slashdot":http://slashdot.org/
... """
>>> html = textile.textile(s)
>>> print html
<p><em>This</em> is a <strong>test.</strong></p>

<ul>
	<li>One</li>
	<li>Two</li>
	<li>Three</li>
</ul>

<p>Link to <a href="http://slashdot.org/">Slashdot</a></p>
>>>

Notes:

  • Active development supports Python 3.8 or later.

Running Tests

To run the test suite, use pytest. `pytest-cov` is required as well.

When textile is installed locally:

pytest

When textile is not installed locally:

PYTHONPATH=. pytest

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

textile-4.0.4.tar.gz (57.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

textile-4.0.4-py3-none-any.whl (30.7 kB view details)

Uploaded Python 3

File details

Details for the file textile-4.0.4.tar.gz.

File metadata

  • Download URL: textile-4.0.4.tar.gz
  • Upload date:
  • Size: 57.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for textile-4.0.4.tar.gz
Algorithm Hash digest
SHA256 89428d848712b041cf4e354c0a6332339810d519a5c3109cb42a0c594f882a0d
MD5 bfd9d7f5d107c6187181e6e152f28052
BLAKE2b-256 97323126869580204c8b8fe019a5e43f70e4f36e90d0f530033be2746c2c7a1e

See more details on using hashes here.

File details

Details for the file textile-4.0.4-py3-none-any.whl.

File metadata

  • Download URL: textile-4.0.4-py3-none-any.whl
  • Upload date:
  • Size: 30.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.4

File hashes

Hashes for textile-4.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 a09e3696405b82c79e1323ce892c78975943f3ee681b0570dab7878407434da7
MD5 8fc300d99853d15921fa27e82d56092e
BLAKE2b-256 c10a4c58eea9ef7ccb96e588fddcb9540c1657f944028f8901931003b498b1c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page