Python 3 port of the bencode library, with tests