Skip to main content

PyPI Python package PyPI - License

For of cusser with added support of Python 3.11+

cusser 🤬

cusser

A curses wrapper that understands ANSI escape code sequences

cusser is a lightweight Python package for teaching curses how to use ANSI escape code sequences. It works by wrapping the curses standard window object and intercepting escape code sequences.

Features

Installation

$ pip install cusser

Usage

In[1]:
import curses

In[2]:
from a8c_cusser import Cusser

In[3]:


def app(stdscr) -> None:
    ...: """Start a new application."""
    ...:
    if not isinstance(stdscr, Cusser):
        ...: stdscr = Cusser(stdscr)
    ...:
    ...: ultra_violet = (100, 83, 148)
    ...: x, y = 34, 12
    ...: stdscr.addstr(
        ...:         f"\033[2J\033[{x};{y}H"
    ...: "\033[1;32mHello "
    ...:         f"\033[;3;38;2;{';'.join(map(str, ultra_violet))}m"
    ...: "cusser"
    ...:         "\033[m 🤬!"
    ...:     )
    ...: stdscr.refresh()
    ...: stdscr.getch()
    ...:


In[4]: curses.wrapper(app)

Screenshot

Credits

Photo by Gwendal Cottin on Unsplash.

Metadata

Release files for a8c-cusser 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for a8c-cusser 0.2.0
File Size Uploaded
a8c_cusser-0.2.0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for a8c-cusser 0.2.0
File Interpreter ABI Platform
a8c_cusser-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 14.8 kB

Release files / a8c_cusser-0.2.0.tar.gz

Download URL a8c_cusser-0.2.0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
7eaa1e5a2fb3d267a634d3ddcb81c951a778b3f1e6c3a84c3ebb0899e405dccd
BLAKE2b-256 checksum
How to use checksums
cc09a91d60871c7f1f4bc9669f546b617d8cbb128570c5a447a2febeb55bf83d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release files / a8c_cusser-0.2.0-py3-none-any.whl

Download URL a8c_cusser-0.2.0-py3-none-any.whl
Size 8.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bbb592367be8065b729b23126728c3d6398f5abf05162324b42a1be29498cb9b
BLAKE2b-256 checksum
How to use checksums
a9612e323f04756bf22595849204e70fa405c9971bac845e094844d18b294ec2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.15

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page