This Python tool allows you to draw signal-flow graphs, calculate transfer functions (SymPy code is generated for further use in Jupyter notebooks), do graph manipulations (e.g., node elimination and graph transposition), and save a graph as TikZ for use in LaTeX documentation.
In addition to Generate Mason, do a Generate Equations.
Result (in Python) similar to (2) in https://link.springer.com/article/10.1007/s10470-018-1131-7