β A Bespoke Character-by-Character Text Printer.
[click-clack-clack...]
A utility Python library which provides for a realistic, "real-time typing" simulation with highly configurable implementations. It features a flexible API for both simple and advanced use, quick-use "character personality" presets, and granular timing control for creating custom text presentations with authentic temporal dynamics.
Born of the KitschCode philosophy of applying meticulous craftsmanship to humble functionality.
Note
TypyTypy is currently still in BETA release (but hopefully that changes soon). Notwithstanding, TypyTypy has a comprehensive test suite (100% statement and branch coverage with pytest), is Ruff-linted, Black-formatted, and mypy type-checked.
- π― Simple Direct Usage: Get started with a single function call:
typytypy.type_out("Hello, World!"). - π Layered Design: A flexible API offers both module-level convenience functions and advanced, object-oriented instance management.
- π Character Personalities: Simulate distinct typing styles with built-in presets like
NERVOUS,CONFIDENT, andROBOTIC. - β±οΈ Granular Timing Control: Define custom timing profiles to precisely control typing rhythm for specific keywords.
- ποΈβπ¨οΈ High-Fidelity Output: Renders text as "real-time typing" simulation, perfectly preserving all original formatting, spacing, and line breaks.
- β‘ Zero Dependencies: Pure Python implementation for a lightweight and hassle-free integration.
- π Robust & Type-Safe: Comprehensive validation and full type safety ensure predictable, error-free behavior.
- π¦ Modern Packaging: Built and packaged using contemporary Python standards for seamless installation and use.
pip install typytypyimport typytypy
# Basic typewriter effect
typytypy.type_out("Hello, World!")
# ... with custom timing
typytypy.type_out("How are we doing today?",
base_delay=0.25, delay_range=0.5)import typytypy
# Discover available presets
available_presets = typytypy.get_available_presets()
print(available_presets)
# Instantiate desired preset printer(s)
nervous = typytypy.use_preset("nervous")
confident = typytypy.use_preset("confident")
# Use instantiated preset printer(s)
nervous.type_out("Um, hello there...")
confident.type_out("Good morning, team!")| Preset | Base Delay (base_delay) |
Delay Range (delay_range) |
Description |
|---|---|---|---|
default |
0.015s | 0.042s | Standard typing speed |
emphasis |
~0.031s | ~0.099s | Moderate typing speed |
slow |
0.300s | 0.300s | Deliberate, careful |
contemplative |
0.150s | 0.300s | Thoughtful, reflective |
nervous |
0.100s | 0.400s | Anxious, hesitant |
average |
0.120s | 0.240s | Researched human average typing speed |
confident |
0.080s | 0.160s | Steady, professional |
robotic |
0.100s | 0.050s | Mechanical, consistent |
chaotic |
0.007s | 0.993s | Distracted, erratic |
- Print text character-by-character using the default printer instance with optional timing overrides.
- List all predefined timing presets (Character Presets) with their timing configuration details.
- Create a limited printer instance using a predefined timing preset.
- only the
type_out()method is available
- only the
Advanced printer with full profile management capabilities.
Core Methods:
type_out(text, base_delay=None, delay_range=None): Print text character-by-character, applying profile timings for recognized words and fallback timings for others.set_timing(base_delay, delay_range): Update the instance's default timing parameters.
Profile Management:
create_profile(profile_name, base_delay, delay_range, words=None): Create a new timing profile with optional initial words.add_words_to_profile(profile_name, words): Add words to an existing profile. Accepts a single string or list of strings.remove_words_from_profile(profile_name, words): Remove words from a profile. Accepts a single string or list of strings.list_profiles(): Return list of all profile names in insertion order.get_profile_info(profile_name): Return dictionary with profile details:base_delay,delay_range,word_count, andwordslist.update_profile_timing(profile_name, base_delay, delay_range): Update timing parameters for an existing profile.delete_profile(profile_name): Delete an entire profile and clean up all mappings.
Configuration:
set_profile_case_sensitivity(sensitive): Configure case-sensitivity for word matching.
- Python 3.10+
- No runtime dependencies
git clone https://github.com/VDundDB/typytypy-py.git
cd typytypy-pypip install -e ".[dev]"ruff check src/ tests/
black --check src/ tests/
mypy src/ tests/
# Run all tests with coverage
pytestFull documentation: https://VDundDB.github.io/typytypy-py
Apache License 2.0. See LICENSE for details.
Note
π§ Contributions are welcome... soon.
"In the careful spacing of characters lies the true poetry of a message."
[...clack-click-clack...ting!]