Skip to main content

bencoding

bencoding is a simple Python library for decoding bencoded data.

Installation

pip install bencoded

Usage

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', ...}

Metadata

Release files for bencoded 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bencoded 0.1.2
File Size Uploaded Provenance
bencoded-0.1.2.tar.gz 5.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for bencoded 0.1.2
File Interpreter ABI Platform
bencoded-0.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 9.2 kB

Release files / bencoded-0.1.2.tar.gz

Download URL bencoded-0.1.2.tar.gz
Size 5.3 kB
Tags Source
SHA-256 checksum
How to use checksums
57d16d88f5820f10413039a088231b9702f217a562e05e5f124eb9d240739bf2
BLAKE2b-256 checksum
How to use checksums
fd71db05eb0570439b33a60eae934da2700ff37f228acadbe9fba28948613419
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Release files / bencoded-0.1.2-py3-none-any.whl

Download URL bencoded-0.1.2-py3-none-any.whl
Size 3.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3923bb64a7d281b5e04f8b7b261f35829762dfcd31668bf3a60a3e7bca8f0387
BLAKE2b-256 checksum
How to use checksums
4c6a9040b351291aff4bfdb68ba234e0bb991dd05d051e01de8a6f6fd4f2efc7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.5.13

Security for bencoded 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page