- Notifications
You must be signed in to change notification settings - Fork18
statelyai/xstate-python
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
XState for Python - work in progress!
fromxstateimportMachinelights=Machine( {"id":"lights","initial":"green","states": {"green": {"on": {"TIMER":"yellow"},},"yellow": {"on": {"TIMER":"red"}},"red": {"on": {"TIMER":"green"}}, }, })state=lights.initial_state# state.value is greenstate=lights.transition(state,"TIMER")# state.value is yellowstate=lights.transition(state,"TIMER")# state.value is redstate=lights.transition(state,"TIMER")# state.value is green again
More advanced examples inthe "examples" folder
You can set up your development environment in two different ways.
UsingRemote Containers (recommended if you use VS Code)
Prerequisites
- VS Code IDE andRemote Containers extension
Steps
- Open the folder in a container. This will setup your environment with python (including python and pylance extensions), dependencies and download scxml tests.
- Run
poetry run pytest --covto run the tests! 👩🔬 (or run theRun teststask via VS Code or using VS Code Test explorer where you can debug as well)
Prerequisites
poetryfor package and dependency management
Steps
- Run
poetry installto create a virtual environment - Make sure test files are present and up to date by running
git submodule update --init - Run
poetry run pytest --covto run the tests! 👩🔬 (or run theRun teststask via VS Code or using VS Code Test explorer where you can debug as well)
SCXML tests are ran fromthe SCION Test Framework module.
About
XState for Python
Resources
License
Code of conduct
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.