Textile processing for python.
Project description
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file textile-4.0.3.tar.gz.
File metadata
- Download URL: textile-4.0.3.tar.gz
- Upload date:
- Size: 56.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f2b0fa67769051a406020d2fa4d247d16967080aae407139f888c196eb23de6b
|
|
| MD5 |
f82c4d64a1d49b010045bb9df0f95c58
|
|
| BLAKE2b-256 |
d5014effe1154982f860121e2a1fa3898b2d51c91aa7674f48027ef2d9e8f390
|
File details
Details for the file textile-4.0.3-py3-none-any.whl.
File metadata
- Download URL: textile-4.0.3-py3-none-any.whl
- Upload date:
- Size: 30.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
523fe64cd4d45ea0f7a2f9353d854663b6a932dbcb022f2e976daee921b43e2e
|
|
| MD5 |
ed5983f3dacdc0b0059e32989510a138
|
|
| BLAKE2b-256 |
0ee99cfe163feb2892b2b79dcb5c0a62673418f4a9c4775c015ac33db09748a0
|