Metadata-Version: 2.4
Name: ezclear
Version: 0.4
Summary: Cross-platform terminal clearing library
Author: Unidex101
License-Expression: CC0-1.0
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# EzClear.py

**Simple cross-platform terminal clearing library.**

Clean, efficient, and thoughtful - with proper alternate screen support and automatic cleanup.

## Features

- Zero dependencies
- Works on Windows, macOS, and Linux (including proper Windows Virtual Terminal support)
- Alternate screen buffer mode (like `vim`/`nano` - restores original content on exit)
- Automatic restoration of cursor visibility and text attributes via `atexit`
- TTY-aware (safe for scripts, pipes, and non-interactive environments)
- Tiny and fast

## Installation

```bash
pip install ezclear
```

## Usage

```python
from ezclear import clear, fullscreen, cls

# Basic clear (home + clear screen)
clear()

# Alias
cls()

# Full-featured clear
clear(
    alt_screen=True,      # Use alternate screen buffer (recommended for TUIs)
    reset=True,           # Reset colors and text attributes
    hide_cursor=True      # Hide blinking cursor (great for games/dashboards)
)

# Convenience for full-screen applications
fullscreen()              # Same as clear(alt_screen=True, reset=True, hide_cursor=True)

# Your TUI / game / dashboard code here...
print("Hello from the clean screen!")
# No need to manually restore - atexit handler does it for you
```

### When to use each mode:

- `clear()` - Standard clear, good for scripts and simple CLIs
- `fullscreen()` / `clear(alt_screen=True)` - Ideal for games, TUIs, status monitors, etc.
- `hide_cursor=True` - Perfect for interactive full-screen apps

## How it works:

- Uses ANSI escape sequences for maximum compatibility
- Enables Virtual Terminal Processing on Windows automatically (no `colorama` needed)
- Gracefully does nothing in non-TTY environments (pipes, redirects, CI, etc.)

## License

[CC0 1.0 Universal (Public Domain)](LICENSE)
