Our great sponsors
-
transitions
A lightweight, object-oriented finite state machine implementation in Python with many extensions
-
WorkOS
The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.
-
KeenWrite
Discontinued Free, open-source, cross-platform desktop Markdown text editor with live preview, string interpolation, and math.
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
I've used https://github.com/pytransitions/transitions in production python systems.
It worked great but the system was fairly simple and wasn't changed often. In my opinion, it's nicer when the state machine can be defined as configuration (in XML or whatever) and then generate the code. Unfortunately that's not possible with vanilla pytransitions, but I suppose you could build a layer on top of it.
For example an ecommerce order tracking system with different status (in cart, paid, shipped, returned, so on). Spree solves it very elegantly, look at those "events", "transitions".
https://github.com/spree/spree/blob/4687e608b49236c2850500b0...
Also, Spree has this nice intro to FSMs
https://github.com/Humane-Documentation/Spree/blob/master/re...
I recently released a version of my free and open-source text editor, KeenWrite, that embeds requests to Kroki[0]. Kroki provides a REST API for generating many types of diagrams, including Mermaid diagrams. KeenWrite provides users with the ability to reference variables within the text. Combined, they make it easy to apply the DRY principle to documentation.[1] Even though the request goes over HTTPS, the diagrams are drawn in nearly real-time (and cached).
The screenshots show GraphViz diagrams, but changing "graphviz" to "mermaid" at the start of the code block will permit drawing Mermaid diagrams. See the video[2] for more ideas on how to mix variables with documentation.
[0]: https://kroki.io/
[1]: https://github.com/DaveJarvis/keenwrite#screenshots
[2]: https://www.youtube.com/watch?v=u_dFd6UhdV8
I'm working on XState for Python: https://github.com/davidkpiano/xstate-python
Still a work-in-progress, but hope to make this production-ready this year.