Install & Compatibility
Where this runs
tested against v4.3.0 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.172s · 32.5MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 3.1s · import 0.160s · 33MB
31MB installed
● package 31MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
wrap
✓ from jaraco.text import wrap
✗ import jaraco.text.wrap
Many core functions are directly importable from the top-level `jaraco.text` package, not nested modules.
join_lines
✓ from jaraco.text.join import join_lines
✗ from jaraco.text import join_lines
`join_lines` is part of the `join` submodule, which is itself a submodule of `jaraco.text`.
ellipsis_middle
✓ from jaraco.text.compress import ellipsis_middle
✗ from jaraco.text import ellipsis_middle
`ellipsis_middle` resides in the `compress` submodule.
This quickstart demonstrates three common utilities from jaraco.text: `wrap` for custom text wrapping, `join_lines` for combining lines while preserving indentation, and `ellipsis_middle` for shortening long strings by placing an ellipsis in the center.
from jaraco.text import wrap
from jaraco.text.join import join_lines
from jaraco.text.compress import ellipsis_middle
# Example 1: Custom text wrapping with indentation
long_text = "This is a very long paragraph that demonstrates the custom wrapping functionality provided by jaraco.text. It can handle various widths and indentation levels."
wrapped = wrap(long_text, width=40, indent=4)
print("--- Wrapped Text ---")
print(wrapped)
# Example 2: Joining lines, preserving relative indentation
lines_to_join = [
" First indented line",
" Second deeper line",
"Third top-level line"
]
joined = join_lines(lines_to_join)
print("\n--- Joined Lines ---")
print(joined)
# Example 3: Shorten string with ellipsis in the middle
very_long_string = "The quick brown fox jumps over the lazy dog and then takes a nap under the shade tree."
shortened = ellipsis_middle(very_long_string, max_len=30)
print("\n--- Ellipsis Middle ---")
print(shortened)
Errors
Common errors & fixes
FileNotFoundError: 'Lorem ipsum.txt' resource not found in 'jaraco.text'
This error typically occurs when using PyInstaller, which fails to correctly bundle the data files (like 'Lorem ipsum.txt') associated with the 'jaraco.text' library into the generated executable.
fixUpgrade PyInstaller to a version that includes the necessary hook for `jaraco.text` (e.g., PyInstaller 4.0 or newer), or ensure `pyinstaller-hooks-contrib` is installed and updated.
ImportError: cannot import name 'drop_comment' from 'jaraco.text'
This issue often stems from compatibility problems between certain versions of `setuptools` (which may vend a copy of `jaraco.text`) and the installed `jaraco.text` library, leading to `pkg_resources` attempting to import a function that has changed or been removed.
fixDowngrade `setuptools` to a compatible version (e.g., `setuptools==70.3.0` as a known workaround) or upgrade both `setuptools` and `jaraco.text` to versions where this incompatibility has been resolved.
ModuleNotFoundError: No module named 'jaraco.text'
This error means the Python interpreter cannot find the 'jaraco.text' package, either because it's not installed in the active environment, or there's a problem with package managers or bundlers like `py2app` or `setuptools` not correctly including it.
fixInstall the package using pip (`pip install jaraco.text`), ensure your virtual environment is activated, or verify that your application bundler (e.g., PyInstaller, py2app) is correctly configured to include 'jaraco.text'.
Upgrade
Version history
4.3.0latest on PyPI · released Jul 12, 2026
Audit
Dependencies
No dependency data recorded yet.