Metadata-Version: 2.1
Name: ansiscape
Version: 1.0.0a1
Summary: Python package for interpreting ANSI escape codes
Home-page: https://github.com/cariad/ansiscape
Author: Cariad Eccleston
Author-email: cariad@cariad.io
License: MIT
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: License :: OSI Approved :: MIT License
Classifier: Natural Language :: English
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Topic :: Utilities
Classifier: Typing :: Typed
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE

# ansiscape

[![CircleCI](https://circleci.com/gh/cariad/ansiscape/tree/main.svg?style=shield)](https://circleci.com/gh/cariad/ansiscape/tree/main) [![codecov](https://codecov.io/gh/cariad/ansiscape/branch/main/graph/badge.svg?token=cn6UnSvD8u)](https://codecov.io/gh/cariad/ansiscape)

`ansiscape` is a Python package for interpreting and creating ANSI escape codes.

## Highlights

Create formatted text, with **support for nested colours** and **custom RGB**:

```python
from ansiscape import Sequence, green, foreground

text = Sequence(
    green("This is ", foreground((1.0, 0.5, 0.0, 1.0), "heavy"), ", Doc,"),
    " said Marty.",
)
print(text)
```

Convert a string with embedded escape codes into a list of strings and **explanatory dictionaries**:

```python
from ansiscape import Sequence

Sequence("Hello world, and \033[3myou\033[23m in particular!").resolved
```

```python
[
  "Hello world, and ",
  {"calligraphy": Calligraphy.ITALIC},
  "you",
  {"calligraphy": Calligraphy.NONE},
  " in particular!",
]
```

## Installation

`ansiscape` requires Python 3.8 or later.

```bash
pip install ansiscape
```

## Discovering terminal support

To see examples of the formatting supported by your terminal, run:

```bash
ansiscape
```

## The project

The source for `ansiscape` is available at [github.com/cariad/ansiscape](https://github.com/cariad/ansiscape) under the MIT licence.

And, **hello!** I'm [Cariad Eccleston](https://cariad.io) and I'm an independent/freelance software engineer. If my work has value to you, please consider [sponsoring](https://github.com/sponsors/cariad/).


