Skip to main content

AnsI/O

pytest

AnsI/O module for ansi input & output

Example usage

Ansi input

from ansio import ansi_input, application_keypad, mouse_input
from ansio.input import InputEvent, get_input_event

with ansi_input, application_keypad, mouse_input:
    while True:
        event: InputEvent = get_input_event()
        print(event.pressed, repr(event.shortcut))

Example output:

True 'alt+shift+a'
True 'ctrl+a'
True 'tab'
True 'shift+up'
True 'a'
True 'primary_click'
False 'primary_click'
True 'ctrl+primary_click'
False 'ctrl+primary_click'

Ansi output

from ansio import ansi_output
from ansio.colors import blue_bg, invert, italic, yellow

with ansi_output:
    print(f'Print in {yellow(blue_bg("color"))} and with {italic(invert("styles"))}')

Example output:

Metadata

Release files for ansio 0.0.2

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

Source distribution (sdist)

Source distribution for ansio 0.0.2
File Size Uploaded
ansio-0.0.2.tar.gz 27.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ansio 0.0.2
File Interpreter ABI Platform
ansio-0.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 49.0 kB

Release files / ansio-0.0.2.tar.gz

Download URL ansio-0.0.2.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
eba3d1f324a7861a02a85e814917fd4dca38f3b29d1a04e9292fa933afd8a218
BLAKE2b-256 checksum
How to use checksums
511d2d585d8f12384da76b308272471f812e2df63dc3127d0140f9e60f40e6a3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release files / ansio-0.0.2-py3-none-any.whl

Download URL ansio-0.0.2-py3-none-any.whl
Size 21.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d79a75e9910c4acaa23747c9e83816e6b941993f51390f774a41c064d8aa3fff
BLAKE2b-256 checksum
How to use checksums
b85d4e4091a66928c8d246832e5b5c4347f8f6090e95c942712da2c156021974
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.12.4

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

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