Open Source Stenography Software providing real-time stenographic typing, machine support, and plugin architecture.
—
Plover's configuration system provides comprehensive settings management with file persistence, validation, and runtime updates. It supports all aspects of stenographic operation including machine settings, dictionary management, output control, and GUI preferences.
Core configuration class providing access to all Plover settings with automatic persistence and validation.
class Config:
"""Configuration management with file persistence."""
def __init__(self, path: str = None):
"""
Initialize configuration.
Args:
path: Path to configuration file, uses default if None
Creates configuration instance and loads from file if it exists.
"""
def load(self) -> None:
"""
Load configuration from file.
Reads configuration from the specified file path,
applying defaults for any missing values.
"""
def save(self) -> None:
"""
Save configuration to file.
Writes current configuration state to file,
creating directories as needed.
"""
def clear(self) -> None:
"""
Clear all configuration values.
Resets configuration to empty state,
requiring reload or manual setting of values.
"""
def __getitem__(self, key: str):
"""
Get configuration value.
Args:
key: Configuration key to retrieve
Returns:
Value associated with the key
Raises:
KeyError: If key not found
"""
def __setitem__(self, key: str, value) -> None:
"""
Set configuration value.
Args:
key: Configuration key to set
value: Value to associate with key
Updates configuration immediately.
"""
def as_dict(self) -> dict:
"""
Get configuration as dictionary.
Returns:
Complete configuration as dictionary
Useful for serialization or bulk operations.
"""
def update(self, **kwargs) -> None:
"""
Update multiple configuration values.
Args:
**kwargs: Key-value pairs to update
Efficiently updates multiple settings at once.
"""Specialized configuration for individual dictionary entries with path management and state control.
class DictionaryConfig:
"""Configuration for individual dictionary entries."""
def __new__(cls, path: str, enabled: bool = True) -> 'DictionaryConfig':
"""
Create dictionary configuration.
Args:
path: Path to dictionary file
enabled: Whether dictionary is enabled for lookup
Returns:
DictionaryConfig instance
Creates named tuple-based configuration for dictionary.
"""
@property
def short_path(self) -> str:
"""
Get shortened path for display.
Returns:
Abbreviated path suitable for UI display
Removes common prefixes and shortens long paths.
"""
def to_dict(self) -> dict:
"""
Convert to dictionary representation.
Returns:
Dictionary with 'path' and 'enabled' keys
Useful for serialization and API consistency.
"""
def replace(self, **kwargs) -> 'DictionaryConfig':
"""
Create copy with specified changes.
Args:
**kwargs: Fields to change (path, enabled)
Returns:
New DictionaryConfig with changes applied
Immutable update pattern for configuration changes.
"""
@staticmethod
def from_dict(d: dict) -> 'DictionaryConfig':
"""
Create from dictionary representation.
Args:
d: Dictionary with 'path' and optionally 'enabled' keys
Returns:
DictionaryConfig instance
Reconstructs configuration from serialized form.
"""Controls stenographic text output behavior and formatting preferences.
Available Settings:
space_placement: Where spaces are placed around words ('Before Output', 'After Output')start_attached: Whether to start with attached output modestart_capitalized: Whether to start with capitalized output modeundo_levels: Number of undo levels to maintain (integer)time_between_key_presses: Timing delay between key presses in millisecondskeyboard_layout: Physical keyboard layout for key mappingControls diagnostic logging and stroke recording capabilities.
Available Settings:
log_file_name: Path to log file for diagnostic outputenable_stroke_logging: Whether to log stenographic strokesenable_translation_logging: Whether to log translation resultsControls graphical user interface behavior and appearance.
Available Settings:
start_minimized: Whether to start application minimizedshow_stroke_display: Whether to show stroke display windowshow_suggestions_display: Whether to show suggestions displaytranslation_frame_opacity: Opacity level for translation display (0.0-1.0)Controls stenotype machine connection and communication settings.
Available Settings:
auto_start: Whether to automatically start machine on launchmachine_type: Type of stenotype machine to usemachine_specific_options: Dictionary of machine-specific configuration optionsControls stenotype system definitions and key mapping.
Available Settings:
system_name: Name of stenotype system to usesystem_keymap: Key mapping configuration for the selected systemControls dictionary loading, precedence, and management.
Available Settings:
dictionaries: List of DictionaryConfig objects defining loaded dictionariesControls extension and plugin behavior.
Available Settings:
enabled_extensions: List of extension names to enable on startupfrom plover.config import Config, DictionaryConfig
from plover.oslayer.config import CONFIG_FILE
# Create and load configuration
config = Config(CONFIG_FILE)
config.load()
# Get configuration values
machine_type = config['machine_type']
auto_start = config['auto_start']
dictionaries = config['dictionaries']
# Set configuration values
config['machine_type'] = 'Keyboard'
config['auto_start'] = True
config['undo_levels'] = 50
# Update multiple values at once
config.update(
start_minimized=False,
show_stroke_display=True,
translation_frame_opacity=0.8
)
# Work with dictionary configuration
dict_config = DictionaryConfig('/path/to/dict.json', enabled=True)
print(dict_config.short_path)
# Convert to dictionary
dict_data = dict_config.to_dict()
# Result: {'path': '/path/to/dict.json', 'enabled': True}
# Create from dictionary
new_dict_config = DictionaryConfig.from_dict({
'path': '/another/dict.json',
'enabled': False
})
# Update dictionary configuration
updated_config = dict_config.replace(enabled=False)
# Manage dictionary list
current_dicts = config['dictionaries']
new_dict = DictionaryConfig('/new/dictionary.json')
config['dictionaries'] = current_dicts + [new_dict]
# Save configuration
config.save()
# Get complete configuration
all_settings = config.as_dict()Plover stores configuration in JSON format with the following structure:
{
"machine_type": "Keyboard",
"auto_start": true,
"start_minimized": false,
"undo_levels": 100,
"time_between_key_presses": 0.0,
"space_placement": "Before Output",
"start_attached": false,
"start_capitalized": false,
"keyboard_layout": "QWERTY",
"log_file_name": "plover.log",
"enable_stroke_logging": true,
"enable_translation_logging": true,
"show_stroke_display": false,
"show_suggestions_display": false,
"translation_frame_opacity": 0.8,
"system_name": "English Stenotype",
"system_keymap": {},
"machine_specific_options": {},
"dictionaries": [
{
"path": "main.json",
"enabled": true
},
{
"path": "user.json",
"enabled": true
}
],
"enabled_extensions": []
}Configuration files are stored in platform-specific locations:
%APPDATA%/plover/plover.cfg~/Library/Application Support/plover/plover.cfg~/.config/plover/plover.cfgDictionary paths in configuration can be:
Configuration values are validated for correct types:
Missing configuration values are populated with sensible defaults:
Plover automatically migrates older configuration formats to current schema, preserving user settings while adding new options with defaults.
from typing import Dict, List, Union, Optional, Any
from pathlib import Path
ConfigValue = Union[str, int, bool, float, List, Dict]
ConfigDict = Dict[str, ConfigValue]
ConfigPath = Union[str, Path]
DictionaryConfigDict = Dict[str, Union[str, bool]]
DictionaryConfigList = List[DictionaryConfig]
MachineOptions = Dict[str, Any]
SystemKeymap = Dict[str, str]
ExtensionList = List[str]Install with Tessl CLI
npx tessl i tessl/pypi-plover