Network flow class for Python