The BitTorrent protocol uses an efficient file format that allows you to transmit strings, integers, lists, and dictionaries. This is a library that makes doing that easy while affording you luxuries from Python3.7 (such as typing).
The best way to install this package as of now is via GitHub.
git clone https://github.com/ExSidius/bencoding.git
cd bencoding
pip install -e .
This library is exceedingly well tested - tests come straight from the [BitTorrent Specification] (https://wiki.theory.org/index .php/BitTorrentSpecification#Bencoding) and also from other [Bencoding libraries](https://github.com/fuzeman/bencode .py/blob/master/tests/bencode_tests.py).