Skip to main content

vt102 implements a subset of the vt102 specification (the subset that should be most useful for use in software). Two classes: stream, which parses the command stream and dispatches events for commands, and screen which, when used with a stream maintains a buffer of strings representing the screen of a terminal.

Why would you ever want to use this?

  • Screen scraping.

  • Cheating at nethack (I swear to god I will ascend)

  • Chicks dig terminals, and err… VT?

Here’s a quick example:

>>> from vt102 import screen, stream
>>> st = stream()
>>> sc = screen((10, 10))
["          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          "]
>>> sc.attach(st)
>>> st.process("Text goes here")
>>> repr(sc)
["Text goes ",
 "here      ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          "]
>>> st.process("\x1b[H\x1b[K")
>>> repr(sc)
["          ",
 "here      ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          ",
 "          "]

Metadata

Release files for vt102 0.2.1

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

Source distribution (sdist)

Source distribution for vt102 0.2.1
File Size Uploaded
vt102-0.2.1.tar.gz 10.7 kB Details

Release files / vt102-0.2.1.tar.gz

Download URL vt102-0.2.1.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
5ba9b5230cd438ebcfbc26411d5f6bd95c4c20b0269c5d836b5f816fd83768d0
BLAKE2b-256 checksum
How to use checksums
af29c09ab0294922601095e61f68a0979bda9d15a52a6d8970c0345680e881c6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.5

1 release file

0.4

1 release file

0.3.3

1 release file

0.3.2

1 release file

0.3.1

1 release file

0.3

1 release file

This release

0.2.1 This release

1 release file

0.2.0

1 release file

0.1.8

1 release file

0.1.7

2 release files

0.1.6

1 release file

0.1.5

1 release file

0.1.4

1 release file

0.1.3

1 release file

0.1.2

1 release file

0.1.1

1 release file

0.1

1 release file

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