Forked from https://bitbucket.org/james_taylor/bx-python/