Typio: Make Your Terminal Type Like a Human
Python
44
74 commits
updated Sep 21, 2026
Typio is a lightweight Python library that prints text to the terminal as if it were being typed by a human. It supports multiple typing modes (character, word, line, sentence, typewriter, and adaptive), configurable delays and jitter for natural variation, and seamless integration with existing code via a simple function or a decorator. Typio is designed to be minimal, extensible, and safe, making it ideal for demos, CLIs, tutorials, and storytelling in the terminal.
| Branch | main | dev |
| CI |
pip install .pip install typio==1.3Use type_print function to print text with human-like typing effects. You can control the typing speed, randomness, mode, output stream, and output flushing behavior.
from typio import type_print
from typio import TypeMode
type_print("Hello, world!")
type_print(
"Typing with style and personality.",
delay=0.06,
jitter=0.02,
end="\n",
mode=TypeMode.ADAPTIVE,
flush=False,
)
You can also redirect the output to any file-like object:
with open("output.txt", "w") as file:
type_print("Saved with typing effects.", file=file)
| Name | Type | Description | Default |
|---|---|---|---|
text | str | Text to be printed | -- |
delay | float | Base delay (seconds) between emitted units | 0.04 |
jitter | float | Random delay variation (seconds) | 0 |
end | str | Ending character(s) | \n |
mode | TypeMode | Callable | Typing mode (built-in or custom) | TypeMode.CHAR |
seed | int | Random seed for reproducible output | None |
file | TextIOBase | Output stream | sys.stdout |
flush | bool | Automatically flush output after each emitted unit | True |
| Mode | Description |
|---|---|
TypeMode.CHAR | Emit text character by character |
TypeMode.WORD | Emit text word by word, preserving whitespace |
TypeMode.LINE | Emit text line by line |
TypeMode.SENTENCE | Emit text character by character with longer pauses after ., !, ? |
TypeMode.TYPEWRITER | Emit text character by character with longer pauses after newlines |
TypeMode.ADAPTIVE | Emit text with adaptive delays based on character type (spaces, punctuation, alphanumeric) |
TypeMode.ACCELERATE | Emit text character by character with progressively decreasing delay (gradually speeds up over time) |
TypeMode.DECELERATE | Emit text character by character with progressively increasing delay (gradually slows down over time) |
TypeMode.BURST | Emit text in bursts of characters followed by short pauses |
TypeMode.FAT_FINGER | Emit text mimicking human typos and corrections |
TypeMode.THOUGHTFUL | Emit text while pause slightly before long words to simulate thinking |
TypeMode.HEARTBEAT | Emit text with alternating short and long pauses to simulate a heartbeat-like rhythm |
TypeMode.REWIND | Emit text while occasionally deleting and retyping words to simulate reconsideration |
TypeMode.GLITCH | Emit text with occasional random glitches that are quickly corrected |
TypeMode.RANDOM_CASE | Emit text with randomly varying character casing |
TypeMode.WAVE | Emit text with sinusoidal delay variation |
TypeMode.STUTTER | Emit text with stuttering effect on some words |
TypeMode.NERVOUS | Emit text erratically typing with inconsistent pauses |
TypeMode.HESITATION | Emit text with occasional pauses within words to simulate human hesitation |
TypeMode.OVERTHINK | Emit text while occasionally deleting and retyping a chunk of text to simulate overthinking |
TypeMode.CONFIDENT | Emit text quickly with brief pauses, adding longer delays after punctuation to simulate confident typing |
TypeMode.ECHO | Emit text with occasional repetition of characters faintly, like a glitchy terminal echo |
TypeMode.DRUNK | Emit text with erratic timing and occasional character duplication or skipping |
TypeMode.GLIDE | Emit text with smooth deceleration then acceleration |
TypeMode.FOCUS_DRIFT | Emit text with occasional attention drift, causing slowdowns and pauses mid-word |
TypeMode.RUBBER_DUCK | Emit text while occasionally repeating fragments as if explaining thoughts aloud to a rubber duck |
TypeMode.PANIC | Emits text with an increasing rate of typos and slower typing speed to simulate panicking |
Use the @typestyle decorator to apply typing effects to all print calls inside a function, without changing the function's implementation.
from typio import typestyle
from typio import TypeMode
@typestyle(delay=0.05, mode=TypeMode.TYPEWRITER, flush=True)
def intro():
print("Welcome to Typio.")
print("Every print is typed.")
intro()
| Name | Type | Description | Default |
|---|---|---|---|
delay | float | Base delay (seconds) between emitted units | 0.04 |
jitter | float | Random delay variation (seconds) | 0 |
seed | int | Random seed for reproducible output | None |
mode | TypeMode | Callable | Typing mode (built-in or custom) | TypeMode.CHAR |
flush | bool | Automatically flush output after each emitted unit | True |
Typio also allows defining custom typing modes.
A custom mode is a callable that receives a typing context and the text being printed.
This custom mode, named dramatic, adds exaggerated pauses after punctuation to create a dramatic typing effect.
from typio import TypioContext
def dramatic(ctx: TypioContext, text: str):
for ch in text:
ctx.emit(ch)
if ch in ".!?":
ctx.sleep(delay=ctx.delay * ctx.random.uniform(3, 7))
Usage with type_print function:
type_print(
"Wait... what?!",
mode=dramatic,
delay=0.05,
jitter=0.02,
flush=True
)
Usage with @typestyle decorator:
@typestyle(delay=0.06, mode=dramatic, flush=True)
def demo():
print("This is serious.")
print("Very serious!")
demo()
This table describes the TypioContext API, which is the interface exposed to custom typing modes for emitting text, controlling timing, and accessing delay settings.
| Name | Type | Description |
|---|---|---|
emit(text) | method | Emit a text fragment using typing effects |
sleep(delay=None, jitter=None) | method | Pause execution with optional delay and jitter override |
flush() | method | Flush the underlying output stream |
delay | property | Base delay in seconds |
jitter | property | Jitter value in seconds |
random | property | Random generator controlled by Typio's seed parameter |
Typio provides a simple command line interface for printing text with typing effects.
> typio "Hello world!" --mode=typewriter --delay=0.03
Pass --seed to make randomized modes reproducible:
> typio "Hello world!" --mode=glitch --seed=42
Just fill an issue and describe it. We'll check it ASAP!
Give a ⭐️ if this project helped you!
Python
98.3%
Typio: Make Your Terminal Type Like a Human
Python
44
74 commits
updated Sep 21, 2026
Typio is a lightweight Python library that prints text to the terminal as if it were being typed by a human. It supports multiple typing modes (character, word, line, sentence, typewriter, and adaptive), configurable delays and jitter for natural variation, and seamless integration with existing code via a simple function or a decorator. Typio is designed to be minimal, extensible, and safe, making it ideal for demos, CLIs, tutorials, and storytelling in the terminal.
| Branch | main | dev |
| CI |
pip install .pip install typio==1.3Use type_print function to print text with human-like typing effects. You can control the typing speed, randomness, mode, output stream, and output flushing behavior.
from typio import type_print
from typio import TypeMode
type_print("Hello, world!")
type_print(
"Typing with style and personality.",
delay=0.06,
jitter=0.02,
end="\n",
mode=TypeMode.ADAPTIVE,
flush=False,
)
You can also redirect the output to any file-like object:
with open("output.txt", "w") as file:
type_print("Saved with typing effects.", file=file)
| Name | Type | Description | Default |
|---|---|---|---|
text | str | Text to be printed | -- |
delay | float | Base delay (seconds) between emitted units | 0.04 |
jitter | float | Random delay variation (seconds) | 0 |
end | str | Ending character(s) | \n |
mode | TypeMode | Callable | Typing mode (built-in or custom) | TypeMode.CHAR |
seed | int | Random seed for reproducible output | None |
file | TextIOBase | Output stream | sys.stdout |
flush | bool | Automatically flush output after each emitted unit | True |
| Mode | Description |
|---|---|
TypeMode.CHAR | Emit text character by character |
TypeMode.WORD | Emit text word by word, preserving whitespace |
TypeMode.LINE | Emit text line by line |
TypeMode.SENTENCE | Emit text character by character with longer pauses after ., !, ? |
TypeMode.TYPEWRITER | Emit text character by character with longer pauses after newlines |
TypeMode.ADAPTIVE | Emit text with adaptive delays based on character type (spaces, punctuation, alphanumeric) |
TypeMode.ACCELERATE | Emit text character by character with progressively decreasing delay (gradually speeds up over time) |
TypeMode.DECELERATE | Emit text character by character with progressively increasing delay (gradually slows down over time) |
TypeMode.BURST | Emit text in bursts of characters followed by short pauses |
TypeMode.FAT_FINGER | Emit text mimicking human typos and corrections |
TypeMode.THOUGHTFUL | Emit text while pause slightly before long words to simulate thinking |
TypeMode.HEARTBEAT | Emit text with alternating short and long pauses to simulate a heartbeat-like rhythm |
TypeMode.REWIND | Emit text while occasionally deleting and retyping words to simulate reconsideration |
TypeMode.GLITCH | Emit text with occasional random glitches that are quickly corrected |
TypeMode.RANDOM_CASE | Emit text with randomly varying character casing |
TypeMode.WAVE | Emit text with sinusoidal delay variation |
TypeMode.STUTTER | Emit text with stuttering effect on some words |
TypeMode.NERVOUS | Emit text erratically typing with inconsistent pauses |
TypeMode.HESITATION | Emit text with occasional pauses within words to simulate human hesitation |
TypeMode.OVERTHINK | Emit text while occasionally deleting and retyping a chunk of text to simulate overthinking |
TypeMode.CONFIDENT | Emit text quickly with brief pauses, adding longer delays after punctuation to simulate confident typing |
TypeMode.ECHO | Emit text with occasional repetition of characters faintly, like a glitchy terminal echo |
TypeMode.DRUNK | Emit text with erratic timing and occasional character duplication or skipping |
TypeMode.GLIDE | Emit text with smooth deceleration then acceleration |
TypeMode.FOCUS_DRIFT | Emit text with occasional attention drift, causing slowdowns and pauses mid-word |
TypeMode.RUBBER_DUCK | Emit text while occasionally repeating fragments as if explaining thoughts aloud to a rubber duck |
TypeMode.PANIC | Emits text with an increasing rate of typos and slower typing speed to simulate panicking |
Use the @typestyle decorator to apply typing effects to all print calls inside a function, without changing the function's implementation.
from typio import typestyle
from typio import TypeMode
@typestyle(delay=0.05, mode=TypeMode.TYPEWRITER, flush=True)
def intro():
print("Welcome to Typio.")
print("Every print is typed.")
intro()
| Name | Type | Description | Default |
|---|---|---|---|
delay | float | Base delay (seconds) between emitted units | 0.04 |
jitter | float | Random delay variation (seconds) | 0 |
seed | int | Random seed for reproducible output | None |
mode | TypeMode | Callable | Typing mode (built-in or custom) | TypeMode.CHAR |
flush | bool | Automatically flush output after each emitted unit | True |
Typio also allows defining custom typing modes.
A custom mode is a callable that receives a typing context and the text being printed.
This custom mode, named dramatic, adds exaggerated pauses after punctuation to create a dramatic typing effect.
from typio import TypioContext
def dramatic(ctx: TypioContext, text: str):
for ch in text:
ctx.emit(ch)
if ch in ".!?":
ctx.sleep(delay=ctx.delay * ctx.random.uniform(3, 7))
Usage with type_print function:
type_print(
"Wait... what?!",
mode=dramatic,
delay=0.05,
jitter=0.02,
flush=True
)
Usage with @typestyle decorator:
@typestyle(delay=0.06, mode=dramatic, flush=True)
def demo():
print("This is serious.")
print("Very serious!")
demo()
This table describes the TypioContext API, which is the interface exposed to custom typing modes for emitting text, controlling timing, and accessing delay settings.
| Name | Type | Description |
|---|---|---|
emit(text) | method | Emit a text fragment using typing effects |
sleep(delay=None, jitter=None) | method | Pause execution with optional delay and jitter override |
flush() | method | Flush the underlying output stream |
delay | property | Base delay in seconds |
jitter | property | Jitter value in seconds |
random | property | Random generator controlled by Typio's seed parameter |
Typio provides a simple command line interface for printing text with typing effects.
> typio "Hello world!" --mode=typewriter --delay=0.03
Pass --seed to make randomized modes reproducible:
> typio "Hello world!" --mode=glitch --seed=42
Just fill an issue and describe it. We'll check it ASAP!
Give a ⭐️ if this project helped you!
Python
98.3%