Metadata-Version: 2.4
Name: ascii-matrixbox
Version: 0.1.0
Summary: Tiny cmatrix-like ASCII rain window for your terminal. Runs in the background; use it as a decorator or context manager.
Author: ProjectFS
License-Expression: MIT
Project-URL: Homepage, https://pypi.org/project/ascii-matrixbox/
Keywords: cmatrix,matrix,ascii,terminal,console,animation,decorator
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Terminals
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# matrixbox

A tiny `cmatrix`-style "digital rain" in a small square ASCII window in the
corner of your terminal. It runs in a background thread, so your program keeps
working (and printing) independently. Blue by default.

```
pip install ascii-matrixbox
```

## Usage

```python
import matrixbox, time

# as a decorator: the window lives while the function runs
@matrixbox.matrix
def work():
    for i in range(20):
        print("working", i)
        time.sleep(0.3)

# with parameters
@matrixbox.matrix(size=8, color="cyan", corner="top-left")
def other(): ...

# as a context manager
with matrixbox.MatrixBox(size=8):
    time.sleep(5)

# manual control
matrixbox.start()
...
matrixbox.stop()
```

Works with regular functions, `async def` functions and generators.

| option    | default       | meaning                                              |
|-----------|---------------|------------------------------------------------------|
| `size`    | `10`          | window height in rows (width is `2*size`)            |
| `color`   | `"blue"`      | `blue`, `green`, `red`, `cyan`                       |
| `fps`     | `15`          | frames per second                                    |
| `corner`  | `"top-right"` | `top-right` or `top-left`                            |
| `reserve` | `True`        | keep space under the window so `print()` can't overwrite it |

If the output is not a terminal (pipe, file), nothing is drawn.
Needs a terminal with ANSI support (any modern Linux/macOS terminal, Windows Terminal).

Demo: `python -m matrixbox --color blue --size 10` (or just `matrixbox`).

## По-русски

Маленький «матричный дождь» в квадратном ASCII-окошке в углу консоли.
Работает в фоне, не мешает вашей программе. Используйте как декоратор
`@matrixbox.matrix`, контекстный менеджер `with matrixbox.MatrixBox():`
или вручную через `matrixbox.start()` / `matrixbox.stop()`.
