Metadata-Version: 2.4
Name: better-clear
Version: 0.1.1
Classifier: Programming Language :: Rust
Classifier: Programming Language :: Python :: Implementation :: CPython
Classifier: Programming Language :: Python :: Implementation :: PyPy
License-File: LICENCE
Summary: Have you ever felt that clearing the console with os.system is a bit... hacky?
License-Expression: MIT
Requires-Python: >=3.9
Description-Content-Type: text/markdown; charset=UTF-8; variant=GFM
Project-URL: Homepage, https://codeberg.org/NotHMRC/better-clear

# better-clear

Clear the terminal screen from Python without spawning a subprocess.

```python
import better_clear

better_clear.clear()                  # clear the screen and scrollback
better_clear.clear(scrollback=False)  # keep the scrollback
```

Unlike `os.system("clear")`, it doesn't start a shell, doesn't depend on
`clear`/`cls` being on `PATH`, and does nothing when stdout is redirected, so
it never writes escape codes into files or pipes.

It's a small Rust extension built with [PyO3](https://pyo3.rs) and
[crossterm](https://github.com/crossterm-rs/crossterm), which writes ANSI
escape codes on Unix and modern Windows terminals and falls back to the Win32
console API on legacy Windows consoles.

**yes this is written with claude**

