Config
Main configuration for CodeTyper.
Usage
Config()This configuration controls all aspects of how CodeTyper types and executes your code. Created by parsing script files with YAML frontmatter.
Parameters
language: Literal["r", "python", "quarto"]-
Programming language of the code
output_file: str-
Path where typed code will be saved
typing_speed: float = 0.05-
Seconds to wait between typing each character (default: 0.05)
execute_blocks: bool = True-
Whether to execute code after typing in terminal mode (default: True)
pause_between_blocks: float = 2.0-
Seconds to pause between blocks (default: 2.0)
blocks: List[CodeBlock] = None-
List of code blocks to type
frontmatter: Optional[str] = None-
Raw frontmatter text (for Quarto files)
mode: Literal["terminal", "ide"] = "terminal"-
Typing mode: ‘terminal’ or ‘ide’ (default: ‘terminal’)
ide_path: Optional[str] = None-
Custom path to Positron.app (if not using default location)
format_output: bool = False- Whether to format output with Ruff/styler after typing (default: False)
Examples
>>> config = Config(
... language='python',
... output_file='demo.py',
... typing_speed=0.05,
... blocks=[...]
... )