Pure Python implementation of the BiDi layout algorithm
