{"id":5518,"library":"textile","title":"Textile","description":"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.","status":"active","version":"4.0.3","language":"python","source_language":"en","source_url":"https://github.com/textile/python-textile.git","tags":["markup","text-to-html","textile","parser"],"install":[{"cmd":"pip install textile","lang":"bash","label":"Install stable version"},{"cmd":"pip install 'textile[imagesize]'","lang":"bash","label":"Install with optional image size dependency (Pillow)"}],"dependencies":[{"reason":"HTML sanitization","package":"nh3"},{"reason":"Advanced regular expression capabilities; can cause issues with PyPy.","package":"regex","optional":true},{"reason":"Required for image size checking. Installable via 'textile[imagesize]'.","package":"Pillow","optional":true}],"imports":[{"note":"The main module and the primary function share the same name.","symbol":"textile","correct":"import textile"}],"quickstart":{"code":"import textile\n\ntextile_input = \"\"\"\n_This_ is a *test.*\\n\n* One\n* Two\n* Three\n\nLink to \"Slashdot\":http://slashdot.org/\n\"\"\"\n\nhtml_output = textile.textile(textile_input)\nprint(html_output)","lang":"python","description":"Initialize the textile parser and convert a sample Textile string to HTML."},"warnings":[{"fix":"Upgrade to Python 3.8+ or pin to `textile<4.0.0` for older Python versions.","message":"Python 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.","severity":"breaking","affected_versions":"<4.0.0"},{"fix":"Review HTML output if your application relies on specific sanitization rules. Adjust inputs or sanitize pre/post-processing if necessary.","message":"The underlying HTML sanitization library was switched from `html5lib` to `nh3`. This might subtly change sanitization behavior for some inputs.","severity":"breaking","affected_versions":"4.0.3 and later"},{"fix":"In PyPy environments, run `pip uninstall regex` if `textile` functionality is affected.","message":"The `regex` package, an optional dependency, can cause compatibility problems when running `textile` in PyPy environments. If you encounter issues, uninstall `regex`.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"search_vec":"'2024':37 '4.0.3':33 'activ':29 'allen':9 'allow':15 'compat':44 'convers':16 'current':27 'dean':8 'develop':30 'format':20 'generat':14 'html':23,52 'human':11 'improv':47 'introduc':46 'librari':25 'maintain':43 'markup':48 'parser':54 'period':40 'port':6 'python':5 'receiv':39 'releas':34 'septemb':36 'text':13,21,50 'text-to-html':49 'textil':1,2,19,53 'textile-format':18 'updat':41 'version':32 'web':12","created_at":"2026-04-14T01:37:17.905564+00:00","updated_at":"2026-04-16T22:52:41.999668+00:00","problems":[{"fix":"pip install textile","cause":"The `textile` package has not been installed in the current Python environment or the installation failed.","error":"ModuleNotFoundError: No module named 'textile'"},{"fix":"pip install textile","cause":"The package name used in the `pip install` command is incorrect; the correct package name is `textile`, not `python-textile`.","error":"ERROR: Could not find a version that satisfies the requirement python-textile"},{"fix":"from textile import textile\nhtml_output = textile('h1. Hello World!')","cause":"The primary conversion function is directly named `textile` within the `textile` package, not `convert` or a method of an instantiated object.","error":"AttributeError: module 'textile' has no attribute 'convert'"},{"fix":"from textile import textile\nhtml_output = textile('h1. Hello World!')","cause":"The `textile` function expects the Textile-formatted string as its first argument and is being called without any arguments.","error":"TypeError: textile() takes 1 positional argument but 0 were given"},{"fix":"from textile import textile\nhtml_output = textile('h1. Hello World!') # Ensure input is a string or bytes","cause":"The `textile` function was called with `None` as input, but it expects a string or bytes-like object containing the Textile markup.","error":"TypeError: expected string or bytes-like object, got NoneType"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"4.0.4","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/textile/python-textile","docs":null,"changelog":null,"pypi":"https://pypi.org/project/textile/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}