A Bespoke Character-by-Character Text Printer.
Project description
TypyTypy (typytypy)
— 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.
Features
> Developer-Focused API
- 🎯 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.
> Expressive Typing Engine
- 🎭 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.
> Professional-Grade Foundation
- ⚡ 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.
Quick Start
Installation
pip install typytypy
Basic Usage
import 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)
Using "Character Personality" Presets
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!")
Available Presets
| 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 |
API Reference
Module-Level Functions
typytypy.type_out(text, base_delay=None, delay_range=None)
- Print text character-by-character using the default printer instance with optional timing overrides.
typytypy.get_available_presets()
- List all predefined timing presets (Character Presets) with their timing configuration details.
typytypy.use_preset(preset_name)
- Create a limited printer instance using a predefined timing preset.
- only the
type_out()method is available
- only the
Advanced Class
typytypy.PrintingPress(base_delay=None, delay_range=None)
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.
Documentation
Full documentation: https://VDundDB.github.io/typytypy-py
License
Apache License 2.0. See LICENSE for details.
Contributing
[!NOTE] 🚧 Contributions are welcome... soon.
"In the careful spacing of characters lies the true poetry of a message."
[...clack-click-clack...ting!]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file typytypy-0.1.0.tar.gz.
File metadata
- Download URL: typytypy-0.1.0.tar.gz
- Upload date:
- Size: 521.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5c066ce8bd339c5a059ee1622531fd7a41ee7fc474b8be8abb6816ad505a662f
|
|
| MD5 |
675fdd6e58449f0ca679bad3776dd395
|
|
| BLAKE2b-256 |
5db60c5288c18f28eede5e9f4212fde4d82f6addc5af1918b5af55f8f18651b0
|
File details
Details for the file typytypy-0.1.0-py3-none-any.whl.
File metadata
- Download URL: typytypy-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0e58290064965828585be6d59a34e72bf8a8ee663254dbd76123876791fef57c
|
|
| MD5 |
6ed743aa50fa1557367b703ce60fb87c
|
|
| BLAKE2b-256 |
92b7847dcb9b9a5fd56dd6481b3f15ca13a7a48176f8f0e7ea8a06894f603d2f
|