Skip to content

Commit af3db7d

Browse files
committed
docs: document the IO optional extras in install instructions
List the yaml / validation / io extras (PyYAML, jsonschema) alongside diagrams, so the declarative JSON/YAML loaders introduced in 3.2.0 are discoverable from the install page and README. Signed-off-by: Fernando Macedo <fgmacedo@gmail.com>
1 parent b808f76 commit af3db7d

2 files changed

Lines changed: 18 additions & 4 deletions

File tree

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,13 @@ To generate diagrams, install with the `diagrams` extra (requires
372372
pip install python-statemachine[diagrams]
373373
```
374374

375+
To load statecharts from declarative documents, install the IO extras
376+
(`yaml` for YAML, `validation` for `validate=True`, or `io` for both):
377+
378+
```
379+
pip install python-statemachine[io]
380+
```
381+
375382

376383
## Contributing
377384

docs/installation.md

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,21 @@ Alternatively, if you prefer using [pip](https://pip.pypa.io):
2121
python3 -m pip install python-statemachine
2222
```
2323

24-
For those looking to generate diagrams from your state machines, [pydot](https://github.com/pydot/pydot) and [Graphviz](https://graphviz.org/) are required.
25-
Conveniently, you can install python-statemachine along with the `pydot` dependency using the extras option.
26-
For more information, please refer to our documentation.
24+
## Optional extras
25+
26+
Some features require extra dependencies, available as pip extras:
2727

2828
```shell
29-
python3 -m pip install "python-statemachine[diagrams]"
29+
python3 -m pip install "python-statemachine[diagrams]" # pydot, to generate diagrams from your machines
30+
python3 -m pip install "python-statemachine[yaml]" # PyYAML, to load YAML statechart documents
31+
python3 -m pip install "python-statemachine[validation]" # jsonschema, to validate documents (validate=True)
32+
python3 -m pip install "python-statemachine[io]" # PyYAML + jsonschema, the full JSON/YAML IO stack
3033
```
3134

35+
Diagram generation also requires the [Graphviz](https://graphviz.org/) system package (see
36+
[](diagram.md)). The `[yaml]`, `[validation]` and `[io]` extras back the declarative loaders
37+
documented in [](io/index.md); loading JSON needs no extra, as it uses only the standard library.
38+
3239

3340

3441
## From sources

0 commit comments

Comments
 (0)