Converts a title insurance workflow from ResWare's db into Graphviz's dot language and renders it with Graphviz.
- database.py connects to a SQL Server database
- resware_model.py loads ResWare's ActionList information from its db
- graph.py turns the ResWare information loaded in resware_model into a connected graph and converts that to dot
- web.py Loads the graph from the db, converts it to SVG with dot, and serves that as a web page
All instructions below assume Mac. For other platforms, installing equivalent packages should work
-
brew install graphviz
-
Install
freetds
Workaround for issues with pymssql install
brew install [email protected] brew link --force [email protected]
-
Setup a Python 3 virtualenv:
virtualenv -ppython3 venv
-
Activate the virtualenv:
. venv/bin/activate
-
Install Cython
pip install cython
(this is required as a workaround for a bug in pip's dependency resolution, see https://www.pivotaltracker.com/story/show/160182896) -
Install the Python requirements in the virtualenv:
pip install -r requirements.txt
-
Update the RESWARE_DATABASE keys in .env to point to your ResWare database and set ACTION_LIST_DEF_ID to the id of the action list you want to graph
-
Run
gunicorn --reload web:app
and go to localhost:8000 to see the output
You can also run python graph.py
to produce the dot output from the database. You can pipe the output to graphviz to produce an image e.g. python graph.py | dot -Tpng -oflow.png
and then open flow.png.
This app will run directly on Heroku. To set it up:
- Add
https://github.com/heroku/heroku-buildpack-apt.git
,https://github.com/weibeld/heroku-buildpack-graphviz.git
, andheroku/python
as buildpacks to your app in that order. - Setup the keys in .env in the Heroku config for the app i.e. add your database configuration along with the action list you want to view and the token to prevent random viewers.
heroku git:remote -a st-flow
in a clone of this repo substituting your app name.
After that you can
git push heroku master
from this repo to deploy the latest
./venv/bin/black [filenames]