Skip to main content

bencode.py

https://img.shields.io/pypi/v/bencode.py.svg?style=flat-square https://img.shields.io/travis/fuzeman/bencode.py.svg?style=flat-square https://img.shields.io/coveralls/fuzeman/bencode.py/master.svg?style=flat-square

Simple bencode parser (for Python 2, Python 3 and PyPy), forked from the bencode package by Thomas Rampelberg.

Usage

Encode:

import bencode

bencode.encode({'title': 'Example'})
# 'd5:title7:Examplee'

bencode.encode(12)
# 'i12e'

Decode:

import bencode

bencode.decode('d5:title7:Examplee')
# {'title': 'Example'}

bencode.decode('i12e')
# 12

API

bencode.bencode(value)

bencode.encode(value)

Encode value into the bencode format.

bencode.bdecode(value)

bencode.decode(value)

Decode bencode formatted string value.

bencode.bread(fd)

Read bencode formatted string from file or path fd.

bencode.bwrite(data, fd)

Write data as a bencode formatted string to file or path fd.

Metadata

Release files for bencode.py 3.0.1

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

Source distribution (sdist)

Source distribution for bencode.py 3.0.1
File Size Uploaded Provenance Actions
bencode.py-3.0.1.tar.gz 16.8 kB Without provenance Details for bencode.py-3.0.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for bencode.py 3.0.1
File Interpreter ABI Platform Actions
bencode.py-3.0.1-py2.py3-none-any.whl Python 2, Python 3 none any Details for bencode.py-3.0.1-py2.py3-none-any.whl

Total release size: 31.5 kB

Release files / bencode.py-3.0.1.tar.gz

Download URL bencode.py-3.0.1.tar.gz
Size 16.8 kB
Tags Source
SHA-256 checksum
How to use checksums
3caad17ed5712a84ac90e86919b61c936d18a0d2123d6bab33330a694b645f51
BLAKE2b-256 checksum
How to use checksums
536d530affcf38b085ce8a58267252575b4aa02dd07e7bd0e1e4c415e004c320
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15

Release files / bencode.py-3.0.1-py2.py3-none-any.whl

Download URL bencode.py-3.0.1-py2.py3-none-any.whl
Size 14.6 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
0c94470087228c3b18461b4a00ddf939a98868ac0e74f690b792b9f244d31e6d
BLAKE2b-256 checksum
How to use checksums
bf47a680bec9c96c336e3523327c633c36d7d32fe44f6e03c4da380c6e59a1f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/39.0.1 requests-toolbelt/0.9.1 tqdm/4.32.1 CPython/2.7.15

Security for bencode.py 3.0.1

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