Changelog
Release history and what changed in each version.
Changelog
All notable changes to XState-StateMachine for Python are documented here.
For the full changelog with commit history, see CHANGELOG.md on GitHub.
[0.5.0] — 2026-03-23 (Current Release)
Added
- Pythonic API — three new styles for defining state machines in pure Python:
StateMachinebase class with metaclass (class-based declarative API)MachineBuilderfluent builder APIbuild_machine()functional API withStateobjects
@action,@guard,@servicedecorators for marking functions with automatic name mapping (snake_case to camelCase)State.to()transition API with|operator for combining transitionsState.internal()method for internal transitions (no state change)State.enter()/State.exit()decorators for entry/exit action registration- CLI
--templateflag with 5 code generation templates:pythonic-class—StateMachinesubclasspythonic-builder—MachineBuilderchainpythonic-functional—build_machine()callclass-json— class-based with JSON at runtime (default)function-json— module functions with JSON at runtime
- Strategy pattern architecture for CLI code generation (easily extensible)
- Rich generated code with type hints, docstrings, error handling (try/except), and logging
- 143 Pythonic API tests across 20 test classes
- Stress test suite with 50 real-world XState machine configs
- Comprehensive documentation overhaul (25 guide pages)
Changed
_resolve_target()signature updated with context-aware resolution for nested states- Generated code now uses PEP 8 snake_case function names with auto-mapping to camelCase
- Template selection replaces the old
--styleflag - Default async mode is template-dependent: sync for Pythonic templates, async for JSON templates
Fixed
- Nested state target resolution when using dot-path references
- State/event name collision in generated code (event variables now get
_eventsuffix) - Empty actions list emission in generated transition code
- Conditional
servicedecorator import (only imported when services exist) - Function complexity compliance (flake8 C901) in generator code
- Windows console encoding errors with emoji characters in CLI output
Deprecated
--styleflag (class/function) — use--templateinstead. Maps toclass-json/function-json. Will be removed in v0.6.0.
[0.4.3] — 2025-02-03
- Python 3.14 support
- Build system migration to
uv
[0.4.2] — 2025-08-13
reenterflag for self-transitions (forces exit/re-entry)
[0.4.1] — 2025-07-27
- Enhanced sync actor spawning in
SyncInterpreter - Hierarchical machine generation in CLI (
--json-parent,--json-child) - CLI subcommand aliases (
gtforgenerate-template)
[0.4.0] — 2025-07-16
- CLI tool introduction (
xsm generate-template) aftertransition support inSyncInterpreter
[0.3.x]
- Plugin framework (
PluginBase,LoggingInspector) - Snapshot system (save/restore interpreter state)
- Actor spawning (
invokewith machine sources) - Dual execution engines (
Interpreter+SyncInterpreter)
[0.2.x]
LogicLoaderwith auto-discovery (snake_case → camelCase mapping)logic_providersandlogic_modulessupport increate_machine()- PyPI packaging and distribution
[0.1.0]
- Initial release
- XState JSON parsing and validation
- Async interpreter with full statechart support
- Hierarchical states, parallel states, final states
- Guards, actions, services
after(delayed) andalways(eventless) transitions