--- id: textwrap3 version: "0.9.2" license: Python Software Foundation License license_treatment: permissive maintenance: abandoned --- # textwrap3 — textwrap from Python 3.6 backport (plus a few tweaks) License: permissive · Maintenance: abandoned · Downloads: 1.3M/mo ## What it is and what it does textwrap3 is a backport of Python 3.6's textwrap module designed to run on older Python versions, from 2.6 forward. It exposes newer APIs like shorten() and the max_lines parameter to codebases stuck on Python 2 or early Python 3 releases. The module is a near-direct copy of the standard library implementation, with one notable tweak: it treats Unicode em-dashes (U+2014) the same as ASCII em-dashes (--) when wrapping text, and it applies the re.UNICODE flag so that accented and non-ASCII characters are recognized as legitimate word characters. Because the package is a compatibility shim for end-of-life Python versions, it is only relevant if you maintain legacy code that cannot upgrade to modern Python. The package itself is abandoned—no releases since January 2019—and the Python versions it targets are no longer supported by the Python community. Use it for: - Wrap and fill text in Python 2.7 codebases using the same API as Python 3.6's textwrap. - Handle Unicode text with accented characters and em-dashes correctly across Python 2 and early Python 3. - Use the shorten() function in projects locked to Python 2.6–3.5 where the standard library lacks it. - Maintain consistent text-wrapping behavior across a codebase that must support both Python 2 and Python 3. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Backports Python 3.6's textwrap module to earlier Python versions, making APIs like shorten() and max_lines available across Python 2.6 and 3.x with improved Unicode handling. No. The package is abandoned (last release January 2019) and targets Python versions (2.6–3.7) that are end-of-life and no longer receive security updates. Modern Python projects should use the standard library textwrap directly. Only consider this if you are maintaining legacy code on unsupported Python versions and cannot upgrade—in that case, the low install friction and permissive license make it technically viable, but the lack of maintenance is a significant risk. ## Install pip install textwrap3 uv add textwrap3 poetry add textwrap3 ## Installing textwrap3 Before you install: Low install friction with no runtime dependencies. However, the package is abandoned—last commit was 2019-01-23 and no releases in 2760 days. It targets Python versions (2.6, 2.7, 3.3–3.7) that are now end-of-life, making it unsuitable for modern projects. License in practice: Licensed under the Python Software Foundation License (permissive), which poses no restrictions on use or redistribution in most contexts. Quickstart: pip install textwrap3 from textwrap3 import wrap text = 'long text here...' print(wrap(text, 40)) Verify before relying: - Whether textwrap3's Unicode and em-dash handling differs meaningfully from modern Python's textwrap in current use. - Whether any of the target Python versions (2.6–3.7) remain in active use in the reader's environment. ## Package facts - License: Python Software Foundation License (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 1.3M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags text wrapping python 2, textwrap backport, unicode text wrapping, python 2.7 text formatting, wrap text across versions, em-dash text handling, legacy-python, backport [View on SkillFed](https://skillfed.io/packages/textwrap3) · [View on PyPI](https://pypi.org/project/textwrap3/)