Metadata-Version: 2.4
Name: bcoder
Version: 3.0
Summary: Tool to decode and encode .torrent files
Author: Mykola Bezrukyi
License-Expression: MIT
License-File: LICENSE
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/mbezrukyi/bcoder
Description-Content-Type: text/markdown

# bcoder

Encode and decode [bencode](https://www.bittorrent.org/beps/bep_0003.html#bencoding), the format of `.torrent` files.

```
pip install bcoder
```

```python
import bcoder

bcoder.encode({b"spam": [b"eggs", 42]})  # b"d4:spaml4:eggsi42eee"
bcoder.decode(b"d4:spaml4:eggsi42eee")  # {b"spam": [b"eggs", 42]}
```

Values are `int`, `bytes`, `list` and `dict` with `bytes` keys. `encode` raises `TypeError` for anything else. `decode` raises `bcoder.DecodeError` for malformed data.
