A python command line tool for creating finite state machine diagrams from a file. Make deterministic and non-deterministic automata easily!
Features · Installation · Usage · Support
- Allows easy creation of an FSM diagram anywhere from a YAML file
- Quickly create non-deterministic automata with epsilon transition support.
- Included installer for Graphviz for Windows and MacOS.
- Easy to install and use
- Diagrams are automatically optimized to be the ideal size.
- Allow changing output format
- Improve input file capabilities
- Add CLI options for sizing output
- Add more rigorous input file checking
- Linux support for installer
- Improve reliability of installer
To use FSMD, Python 3.7 or greater is required to be installed. You must also have pip as well.
To install FSMD you can run:
pip install FSMD
If you want to run the project directly, you can run the main.py file in the source folder, and Typer should take care of the rest.
The Graphviz library is required for FSMD to work properly, there are a few two ways (unless you are on Linux) to do this.
FSMD includes an automatic installer for Graphviz. Each platform has different steps.
The automatic installer is experimental and not guaranteed to work, it's recommended to install Graphviz yourself if the automatic installer does not work for you.
Windows
To install on Windows, run the following command:
FSMD install
Note: The windows installer does not add the Graphviz executables to your system path. It instead installs to a location in %LOCALAPPDATA
, which is added to the PATH only when running FSMD. If you don't know what this means, don't worry about it.
MacOS
Automatic installation on MacOS requires Homebrew to be installed. You can install it by following the steps on this page.
Once you meet all the requirements, run the following command:
FSMD install
Visit the Graphviz Download Page and follow the steps to install Graphviz for your platform.
Once downloaded and installed, make sure Graphviz is in your path by running:
dot --version
If the command runs with no issues, then you are ready to start using FSMD.
Once you have the tool installed, you will need to create a file for FSMD to create a diagram of. Please see the FSM File Documentation for details.
To create the diagram, run the following command:
FSMD create FORMAT INPUT_FILE OUTPUT_FOLDER
Where FORMAT is png
or svg
To view all the options and arguments for the create command you can run:
FSMD create --help
I am an active college student, so I stay pretty busy, but feel free to open an issue if you run into any problems, and I will look into it as soon as I can.