Stransi

Latest version: v0.3.0

Safety actively analyzes 682229 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

0.3.0

This is a **feature release** that avoids some exceptions when escapes are incomplete (e.g., `\033[38m`, etc.).

Update it with pip:

console
$ pip install -U stransi


What's Changed

* Yield unsupported tokens if the input is incomplete (dcc403220697d473217a106feb8e41ccd3b20cd0)
* Avoid raising `StopIteration` in generator (e646107e5263a6005983494f87dc021ecbdc17e4)
* Require ochre ^0.4.0 (f6a6f33b9113e66687ad707eb65b7337daae12b2, 9bcd4441560d3a882083f80a24fe215cf7f67984)
* Bump pytest to 6.2.5 by dependabot in https://github.com/getcuia/stransi/pull/19
* Bump hypothesis to 6.31.6 by dependabot in https://github.com/getcuia/stransi/pull/24
* Bump mypy to 0.920 by dependabot in https://github.com/getcuia/stransi/pull/25

0.1.0

This is the first release of stransi 🎉, a lightweight parser library for ANSI escape code sequences written in Python.

stransi implements a string-like type (`Ansi`) that is aware of its own ANSI escape sequences, and can be used to parse most of the common escape sequences used in terminal output manipulation.

Notable features

- Parse either
- raw escapes (e.g., `Escape('\x1b[31m')`), or
- meaningful instructions (e.g., `SetColor(role=<ColorRole.FOREGROUND: 30>, color=Ansi256(1))`)
- Wide range of [recognized ANSI Sequences](https://github.com/getcuia/stransi/blob/main/FEATURES.md#recognized-ansi-sequences)
- Strong focus on coloring and styling
- Well tested
- Only one dependency: [ochre](https://github.com/getcuia/ochre)
- Python 3.8+

Links

Releases

Has known vulnerabilities

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.