Skip to main content

To decode the Bencode string to Python native datatypes

Project description

Bencoder Decoder Library

A python library to decode the Bencode String to native Python data types i.e int,str,list and dictionary.

How to use: There are two ways to use this Library.

a) Clone GitHub Repo:

  • Clone the github repo https://github.com/malhotraguy/klik_interview
  from bencode.bencode_decoder import decoder
  bencode_data = "8:robots54"
  decoded_value = decoder(bencode_data=bencode_data)
  print(decoded_value)
  # robots54
  bencode_data = "l5:green3:red4:bluee"
  decoded_value = decoder(bencode_data=bencode_data)
  print(decoded_value)
  # ["green", "red", "blue"]
  • For more examples refer to tests folder.

b) Install as python library:

  • Install the library: pip install klik-bencode==0.1
 from bencode.bencode_decoder import decoder
 bencode_data = "8:robots54"
 decoded_value = decoder(bencode_data=bencode_data)
 print(decoded_value)
 # robots54
 bencode_data = "l5:green3:red4:bluee"
 decoded_value = decoder(bencode_data=bencode_data)
 print(decoded_value)
 # ["green", "red", "blue"]

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

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

Source Distribution

klik-bencode-0.1.tar.gz (2.0 kB view details)

Uploaded Source

Built Distribution

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

klik_bencode-0.1-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file klik-bencode-0.1.tar.gz.

File metadata

  • Download URL: klik-bencode-0.1.tar.gz
  • Upload date:
  • Size: 2.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for klik-bencode-0.1.tar.gz
Algorithm Hash digest
SHA256 13c7eb85da28192315360c6a917e28ec217f7ac1d02c0de483406ea2e81b34b5
MD5 8f79abeae8285ba79c259f9e55085bde
BLAKE2b-256 ee4c8e4b954aafadbdeb9621e6a9acc02eb475805b37764bb39f570c81925e77

See more details on using hashes here.

File details

Details for the file klik_bencode-0.1-py3-none-any.whl.

File metadata

  • Download URL: klik_bencode-0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.5

File hashes

Hashes for klik_bencode-0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 98dc0a783f3d3a05f476e8beff5a904003037d26fcdbe8f3599b45292ea1cd0a
MD5 60066cbdd61edb306a43c5e7a2ce701f
BLAKE2b-256 f708e0f6be14005bbd6af588c9bab915b816d10464ad822907332103f76c70e2

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