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
Release files for textile 4.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| textile-4.0.4.tar.gz | 57.3 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| textile-4.0.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 88.0 kB
Release files / textile-4.0.4.tar.gz
| Download URL | textile-4.0.4.tar.gz |
|---|---|
| Size | 57.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
89428d848712b041cf4e354c0a6332339810d519a5c3109cb42a0c594f882a0d
|
|
BLAKE2b-256 checksum How to use checksums |
97323126869580204c8b8fe019a5e43f70e4f36e90d0f530033be2746c2c7a1e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|
Release files / textile-4.0.4-py3-none-any.whl
| Download URL | textile-4.0.4-py3-none-any.whl |
|---|---|
| Size | 30.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a09e3696405b82c79e1323ce892c78975943f3ee681b0570dab7878407434da7
|
|
BLAKE2b-256 checksum How to use checksums |
c10a4c58eea9ef7ccb96e588fddcb9540c1657f944028f8901931003b498b1c5
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.4
|