Skip to main content
travisci PyPI Package latest release Supported versions Supported implementations Wheel packaging support Test line coverage

ansiwrap wraps text, like the standard textwrap module. But it also correctly wraps text that contains ANSI control sequences that colorize or style text.

Where textwrap is fooled by the raw string length of those control codes, ansiwrap is not; it understands that however much those codes affect color and display style, but have no logical length.

The API mirrors the wrap and fill functions of textwrap.

It also exports several other functions:

  • ansilen (giving the effective length of a string, ignoring ANSI control codes)

  • ansi_terminate_lines (propogates control codes though a list of strings/lines and terminates each line.)

  • strip_color (removes ANSI control codes from a string)

See also the enclosed demo.py.

https://content.screencast.com/users/jonathaneunice/folders/Jing/media/8db64be2-01cc-4da4-b46a-789c53c63b44/00000569.png

Metadata

Release files for ansiwrap 0.7.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ansiwrap 0.7.0
File Size Uploaded Provenance Actions
ansiwrap-0.7.0.zip 30.0 kB Without provenance Details for ansiwrap-0.7.0.zip

Built distribution (wheel)

Table of built distributions (wheels) for ansiwrap 0.7.0
File Interpreter ABI Platform Actions
ansiwrap-0.7.0-py2.py3-none-any.whl Python 2, Python 3 none any Details for ansiwrap-0.7.0-py2.py3-none-any.whl

Total release size: 44.8 kB

Release files / ansiwrap-0.7.0.zip

Download URL ansiwrap-0.7.0.zip
Size 30.0 kB
Tags Source
SHA-256 checksum
How to use checksums
5b9be06032cae697cb5215ba34f4b0ed4b8621fb44614858d7939bb853394c21
BLAKE2b-256 checksum
How to use checksums
a11db372bc35b1950c7d862753b6ad62f4f2f1ddf71a8f1502989821ba0ac72a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / ansiwrap-0.7.0-py2.py3-none-any.whl

Download URL ansiwrap-0.7.0-py2.py3-none-any.whl
Size 14.7 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
8b463f1349c5bfa2d3b7b8b2ced3e2e24eaab52059cb6379863a0da12de83c18
BLAKE2b-256 checksum
How to use checksums
9486a2fa884b00b8d2596528ad97ca96dfe922af3165988479c00cb2973b560c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for ansiwrap 0.7.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page