Python library executing long concurrent actions with inter-dependencies