Metadata-Version: 2.4
Name: systext
Version: 1.7.2
Summary: Small, dependency-light presentation toolkit for text
Author-email: rihomies <rihomies@gmail.com>
Maintainer-email: rihomies <rihomies@gmail.com>
License: MIT
Keywords: security,cli,terminal,console,banner,hexdump,table
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Security
Classifier: Topic :: Terminals
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: tesec
Dynamic: license-file

`systext` gives you banners, colored console output, tables, hexdumps, spinners,
progress bars, timing helpers, hashing, entropy, random tokens, IP parsing and secret masking.

## Installation

```bash
pip install systext
```

Requires Python 3.9 or newer

## Quick example

```python
from systext import banner, info, success, hexdump, sha256, entropy

banner("SEC", subtitle="Security PoC")

data = b"Hello World!"
info(f"SHA256: {sha256(data)}")
info(f"Entropy: {entropy(data):.3f} bits/byte")

hexdump(data)
success("Done")
```

## Features

- **Banners**: six built-in styles (`big`, `hacker`, `cyber`, `terminal`, `matrix`, `box`), selectable by number or name, optional color and subtitle, no font dependency
- **Console output**: `info`, `success`, `warning`, `error`, `debug` with `[*]` / `[+]` / `[!]` / `[-]` / `[DEBUG]` markers; diagnostics go to stderr
- **Colors**: small ANSI system with automatic tty detection, `NO_COLOR` / `FORCE_COLOR` support, graceful degradation
- **Tables**: automatic column widths, alignment, empty tables, ANSI-safe cell padding
- **Hexdumps**: classic `xxd`-style output with configurable width, offset, and byte limit
- **Spinners & progress bars**: lightweight context managers, standard library only
- **Timing**: `timer` context manager and `measure` decorator
- **Interactive input**: `prompt`, `confirm`, `select` with defaults, validation, and clean Ctrl+C behavior
- **Some built in**: `sha256`, `entropy`, `random_hex`, `is_ipv4`, `mask_secret`, and 20 more features
## Banner

Six built-in styles, selectable by number or name (default is `1` / `big`):

| # | Name       | Look                                        |
|---|------------|---------------------------------------------|
| 1 | `big`      | Large block letters                         |
| 2 | `hacker`   | `>>>` system aesthetic                      |
| 3 | `cyber`    | Futuristic framed banner                    |
| 4 | `terminal` | Fake `root@system` shell session            |
| 5 | `matrix`   | Binary rain framing                         |
| 6 | `box`      | Clean unicode box                           |

```python
from systext import banner, available_banner_styles

banner("SYSTEXT")                      # style 1 (big)
banner("SYSTEXT", style=2)             # numeric selection
banner("SYSTEXT", style="cyber")       # named selection
banner("SYSTEXT", style="box", color="green", subtitle="v2.0")

print(available_banner_styles())  # ['big', 'hacker', 'cyber', 'terminal', 'matrix', 'box']
```

### Style 1 — `big`

```text
 #### #   #  #### ##### ##### #   # #####
#      # #  #       #   #      # #    #
 ###    #    ###    #   ####    #     #
    #   #       #   #   #      # #    #
####    #   ####    #   ##### #   #   #
```

### Style 2 — `hacker`

```text
>>> ================
>>> SYSTEXT
>>> ================
[ ACCESS GRANTED ]
```

### Style 3 — `cyber`

```text
══════════════════
▓▒░  SYSTEXT  ░▒▓
══════════════════
```

### Style 4 — `terminal`

```text
root@system:~$ ./SYSTEXT
[✓] SYSTEM ONLINE
```

### Style 5 — `matrix`

```text
:: 11001011111101110010111110101000101 ::
    #### #  # #### #### #### #  # ####
     ###  ##   ###  ##  ###   ##   ##
    ####  ##  ####  ##  #### #  #  ##
:: 01010111001010001011010001010100100 ::
```

### Style 6 — `box`

```text
╔════════════════════╗
║       SYSTEXT       ║
╚════════════════════╝
```

Invalid styles raise `ValueError` (`InvalidStyleError`):

```python
banner("SYSTEXT", style="nope")
# ValueError: Unknown banner style: 'nope'. Use 1-6 or one of: big, hacker, cyber, terminal, matrix, box.
```

The matrix strips are generated deterministically from the text, so output is
stable across runs. When printing to a stream that cannot encode unicode
(e.g. a Windows `cp1252` pipe), an ASCII transliteration is printed
automatically — the returned string is always the full-quality rendering.

Legacy style names from 1.0 (`block`, `small`, `slant`, `minimal`) still work
as aliases; `block` renders the same as `big`.

## Console

```python
from systext import info, success, warning, error, debug, set_debug

info("Starting")            # [*] Starting          (stdout)
success("Completed")        # [+] Completed         (stdout)
warning("Potential issue")  # [!] Potential issue   (stderr)
error("Failed")             # [-] Failed            (stderr)

set_debug(True)
debug("Payload length: 128")  # [DEBUG] Payload length: 128  (stderr)
```

Colors are enabled automatically on terminals and disabled when piped. Set
`NO_COLOR=1` to disable or `FORCE_COLOR=1` to force them. You can also control
this programmatically:

```python
from systext import set_color_enabled, reset_color_enabled

set_color_enabled(True)
reset_color_enabled()  # back to automatic detection
```

## Table

```python
from systext import table

out = table(
    ["Name", "Status", "Value"],
    [
        ["Target", "OK", "127.0.0.1"],
        ["Port", "OPEN", "8080"],
        ["Version", "FOUND", "1.2.3"],
    ],
)
print(out)
```

```text
+---------+--------+-----------+
| Name    | Status | Value     |
| Target  | OK     | 127.0.0.1 |
| Port    | OPEN   | 8080      |
| Version | FOUND  | 1.2.3     |
+---------+--------+-----------+
```

Per-column alignment (`align="right"` or `align=["left", "right"]`) and colored
headers (`colored=True`) are supported. `table` returns the rendered string.

## Hexdump

```python
from systext import hexdump

data = b"Hello World!"
hexdump(data, width=16, offset=0x1000, max_bytes=256)
```

```text
00000000  48 65 6c 6c 6f 20 57 6f  72 6c 64 21  Hello World!
```

Accepts `bytes`, `bytearray`, and `memoryview`. Pass `print_it=False` to get
the string without printing.

## Spinner and progress

```python
from systext import spinner, progress
import time

with spinner("Analyzing"):
    time.sleep(1)
# [+] Analyzing

with progress("Processing", total=100) as bar:
    for item in items:
        process(item)
        bar.update()
```

The spinner cleans up after itself, reports `[-] label` on failure, and never
leaves terminal artifacts behind.

## Timing

```python
from systext import timer, measure
import time

with timer("Analysis"):
    time.sleep(0.3)
# [+] Analysis completed in 0.301s

@measure
def load_config():
    ...

load_config()  # [+] load_config completed in 0.002s
```

## another features

```python
from systext import info, table, sha256, entropy, random_hex, is_ipv4, mask_secret

data = b"hello"

info(f"SHA256: {sha256(data)}")
info(f"Entropy: {entropy(data):.3f} bits/byte")

print(table(
    ["Check", "Result"],
    [
        ["Random token", random_hex(16)],
        ["IP valid", str(is_ipv4("10.0.0.1"))],
        ["Masked secret", mask_secret("sk-live-abcdef123456")],
    ],
))
```

## Python support

`systext` supports Python 3.9, 3.10, 3.11, 3.12, and 3.13 on all platforms.

## Security philosophy

`systext` is a *presentation* toolkit for defensive security work, PoCs,
reverse-engineering utilities, and automation scripts. It will never:

- execute analyzed files
- exploit systems or perform vulnerability exploitation
- scan networks or open network connections
- collect remote information

## License

MIT — see [LICENSE](LICENSE).
