Registry / serialization / textile

textile

JSON →
library4.0.4pypypi✓ verified 23d ago

Textile is a Python port of Dean Allen's humane web text generator, allowing conversion of Textile-formatted text into HTML. The library is currently in active development, with version 4.0.3 released in September 2024, and receives periodic updates to maintain compatibility and introduce improvements.

pip install textile
INSTALL
IMPORT
SIG · TEXTILE
T
textile
serializationpythonv4.0.4
Install
2.7s avg
Import
211ms
Disk
42MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.0.4 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.216s · 43.2MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 2.7s · import 0.205s · 44MB
42MB installed
● package 42MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

textile
import textile
The main module and the primary function share the same name.

Initialize the textile parser and convert a sample Textile string to HTML.

import textile textile_input = """ _This_ is a *test.*\n * One * Two * Three Link to "Slashdot":http://slashdot.org/ """ html_output = textile.textile(textile_input) print(html_output)
Debug
Known issues
breakingPython 2.x and older Python 3.x versions (3.2, 3.3, 3.4) are no longer supported. Users on these environments should use Textile Version 3.0.
fix
Upgrade to Python 3.8+ or pin to `textile<4.0.0` for older Python versions.
affects: <4.0.0
breakingThe underlying HTML sanitization library was switched from `html5lib` to `nh3`. This might subtly change sanitization behavior for some inputs.
fix
Review HTML output if your application relies on specific sanitization rules. Adjust inputs or sanitize pre/post-processing if necessary.
affects: 4.0.3 and later
gotchaThe `regex` package, an optional dependency, can cause compatibility problems when running `textile` in PyPy environments. If you encounter issues, uninstall `regex`.
fix
In PyPy environments, run `pip uninstall regex` if `textile` functionality is affected.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'textile'
The `textile` package has not been installed in the current Python environment or the installation failed.
fix
pip install textile
ERROR: Could not find a version that satisfies the requirement python-textile
The package name used in the `pip install` command is incorrect; the correct package name is `textile`, not `python-textile`.
fix
pip install textile
AttributeError: module 'textile' has no attribute 'convert'
The primary conversion function is directly named `textile` within the `textile` package, not `convert` or a method of an instantiated object.
fix
from textile import textile
html_output = textile('h1. Hello World!')
TypeError: textile() takes 1 positional argument but 0 were given
The `textile` function expects the Textile-formatted string as its first argument and is being called without any arguments.
fix
from textile import textile
html_output = textile('h1. Hello World!')
TypeError: expected string or bytes-like object, got NoneType
The `textile` function was called with `None` as input, but it expects a string or bytes-like object containing the Textile markup.
fix
from textile import textile
html_output = textile('h1. Hello World!') # Ensure input is a string or bytes
Upgrade
Version history
4.0.4latest on PyPI · released May 10, 2026
Audit
Dependencies
nh3requiredHTML sanitization
regexoptionalAdvanced regular expression capabilities; can cause issues with PyPy.
PillowoptionalRequired for image size checking. Installable via 'textile[imagesize]'.
Agent activity
16 hits · last 30 days
node
12
OpenAI (training)
1
Resources
textile — pip install textile · libregistry