Skip to main content

Typio: Make Your Terminal Type Like a Human


built with Python3 GitHub repo size PyPI version

Overview

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.

PyPI Counter
Github Stars
Branch main dev
CI
Code Quality CodeFactor

Installation

Source Code

PyPI

Usage

Function

Use 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.

Example

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)

Parameters

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

Built-in Modes

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

Decorator

Use the @typestyle decorator to apply typing effects to all print calls inside a function, without changing the function's implementation.

Example

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()

Parameters

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

Custom Mode

Typio also allows defining custom typing modes.

A custom mode is a callable that receives a typing context and the text being printed.

Example

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()

Parameters

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

CLI

Typio provides a simple command line interface for printing text with typing effects.

Example

> typio "Hello world!" --mode=typewriter --delay=0.03

Pass --seed to make randomized modes reproducible:

> typio "Hello world!" --mode=glitch --seed=42

Screen Record

Issues & Bug Reports

Just fill an issue and describe it. We'll check it ASAP!

  • Please complete the issue template

Show Your Support

Star This Repo

Give a ⭐️ if this project helped you!

Donate to Our Project

Bitcoin

1KtNLEEeUbTEK9PdN6Ya3ZAKXaqoKUuxCy

Ethereum

0xcD4Db18B6664A9662123D4307B074aE968535388

Litecoin

Ldnz5gMcEeV8BAdsyf8FstWDC6uyYR6pgZ

Doge

DDUnKpFQbBqLpFVZ9DfuVysBdr249HxVDh

Tron

TCZxzPZLcJHr2qR3uPUB1tXB6L3FDSSAx7

Ripple

rN7ZuRG7HDGHR5nof8nu5LrsbmSB61V1qq

Binance Coin

bnb1zglwcf0ac3d0s2f6ck5kgwvcru4tlctt4p5qef

Tether

0xcD4Db18B6664A9662123D4307B074aE968535388

Dash

Xd3Yn2qZJ7VE8nbKw2fS98aLxR5M6WUU3s

Stellar

GALPOLPISRHIYHLQER2TLJRGUSZH52RYDK6C3HIU4PSMNAV65Q36EGNL

Zilliqa

zil1knmz8zj88cf0exr2ry7nav9elehxfcgqu3c5e5

Coffeete

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

Unreleased

1.3 - 2026-09-21

Added

  • flush parameter
  • TypioContext.random property

Changed

  • Global random state pollution bug fixed
  • Test system modified
  • README.md updated
  • --mode CLI argument modified
  • Validation system modified
  • functions.py renamed to core.py
  • TypioContext.sleep method modified

1.2 - 2026-08-17

Added

  • text CLI argument
  • seed parameter
  • --seed CLI argument
  • _TypioPrinter._split_tokens method

Changed

  • _TypioPrinter.write return bug fixed
  • Delay zero value bug fixed
  • Jitter zero value bug fixed
  • Test system modified
  • Dependencies structure modified

1.1 - 2026-06-03

Added

  • RUBBER_DUCK mode
  • PANIC mode

Changed

  • Test system modified
  • README.md updated

1.0 - 2026-05-18

Added

  • DRUNK mode
  • GLIDE mode
  • FOCUS_DRIFT mode
  • TypioValidationError class

Changed

  • Test system modified
  • README.md updated

0.9 - 2026-04-28

Added

  • HESITATION mode
  • OVERTHINK mode
  • CONFIDENT mode
  • ECHO mode

Changed

  • Test system modified
  • README.md updated

0.8 - 2026-04-20

Added

  • RANDOM_CASE mode
  • WAVE mode
  • STUTTER mode
  • NERVOUS mode

Changed

  • Test system modified
  • README.md updated

0.7 - 2026-04-09

Added

  • HEARTBEAT mode
  • REWIND mode
  • GLITCH mode

Changed

  • Test system modified
  • README.md updated

0.6 - 2026-03-27

Added

  • THOUGHTFUL mode
  • FAT_FINGER mode
  • BURST mode

0.5 - 2026-03-09

Added

  • ACCELERATE mode
  • DECELERATE mode
  • Screen record video

Changed

  • CLI messages updated
  • CLI modified
  • Test system modified

0.4 - 2026-02-19

Added

  • Command line interface

Changed

  • _emit method modified
  • README.md updated
  • Test system modified

0.3 - 2026-02-11

Added

  • TypioContext class

Changed

  • Test system modified
  • README.md updated
  • _TypioPrinter class all attributes changed to private
  • _emit method modified
  • _sleep function modified

0.2 - 2026-02-04

Changed

  • README.md updated
  • end parameter added to type_print function
  • Test system modified

0.1 - 2026-01-31

Added

  • type_print function
  • typestyle decorator
  • CHAR mode
  • WORD mode
  • LINE mode
  • SENTENCE mode
  • TYPEWRITER mode
  • ADAPTIVE mode

Metadata

Release files for typio 1.3

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

Source distribution (sdist)

Source distribution for typio 1.3
File Size Uploaded
typio-1.3.tar.gz 23.3 kB Details

Built distribution (wheel)

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

Total release size: 39.6 kB

Release files / typio-1.3.tar.gz

Download URL typio-1.3.tar.gz
Size 23.3 kB
Tags Source
SHA-256 checksum
How to use checksums
4ac0b0d517887965da7bd6960b05fa8e5608f5a81b63a87e6f2b5229ca342461
BLAKE2b-256 checksum
How to use checksums
795fd681589da136dee91f58392b81b2a87681e3eef2c3857ec272295c660f10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / typio-1.3-py3-none-any.whl

Download URL typio-1.3-py3-none-any.whl
Size 16.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
aeb9345e68b04794a954daaa93e9b4d466647f195b81c59e2ada366c2d256a25
BLAKE2b-256 checksum
How to use checksums
01ee4ee304d1750ad7ec803b2dfe2b141e8ce61c4c84417d3a9a5486e2dedfd5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

This release

1.3 This release

2 release files

1.2

2 release files

1.1

2 release files

1.0

2 release files

0.9

2 release files

0.8

2 release files

0.7

2 release files

0.6

2 release files

0.5

2 release files

0.4

2 release files

0.3

2 release files

0.2

2 release files

0.1

2 release files

0.0.0

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