Metadata-Version: 2.1
Name: bencoded
Version: 0.1.1
Summary: Decode benocoded binary files.
License: MIT
Author: Maxwell Muoto
Author-email: maxmuoto@gmail.com
Requires-Python: >=3.8,<4.0
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Dist: typing-extensions (>=4.12.2,<5.0.0)
Description-Content-Type: text/markdown

# bencoding

`bencoding` is a simple Python library for decoding bencoded data.

## Installation

```bash
pip install bencoded
```

## Usage

```python
import bencoding

data = bencoding.decode(b'li1ei2ei3ee')
print(data) # [1, 2, 3]

data = bencoding.decode(b'd3:foo3:bare')
print(data) # {'foo': 'bar'}

data = bencoding.decode(b'i42e')
print(data) # 42

data = bencoding.decode(b'4:spam')  
print(data) # 'spam'

my_torrent = pathlib.Path('my_torrent.torrent')
my_torrent_bytes = my_torrent.read_bytes()
data = bencoding.decode(my_torrent_bytes)
print(data) # {'announce': 'http://tracker.example.com:80/announce', ...}
```

