Skip to main content

Simple bencode parser (for Python 2, Python 3 and PyPy)

Project description

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bencode.py-1.2.0.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

bencode.py-1.2.0-py2.py3-none-any.whl (5.1 kB view details)

Uploaded Python 2Python 3

File details

Details for the file bencode.py-1.2.0.tar.gz.

File metadata

  • Download URL: bencode.py-1.2.0.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bencode.py-1.2.0.tar.gz
Algorithm Hash digest
SHA256 65efa44fef2172cc54587bb04c7f703d1471f7443e07bf3da76f6f9090269018
MD5 f1389b769c575fd17333a109b0804d3a
BLAKE2b-256 59fbaa4ad360601acdb6f669b4d2260562d919945ae541ab716d685dcb42b9f0

See more details on using hashes here.

File details

Details for the file bencode.py-1.2.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bencode.py-1.2.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 133e74efe4f9bdab7e4e39bd42204096e268952a90fdf43c97198f0cf5cc5a0a
MD5 d82505d83bb57ea89342d78ea8da4b1a
BLAKE2b-256 9cc914a2fe2ce1acc458d390af16cf53f1b669230581093bba553f4bc855a617

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page