Skip to content

Open-source MIT-licensed library for parsing and converting objects to and from bencode format

License

Notifications You must be signed in to change notification settings

purplesyringa/bencode-open

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bencode

bencode-open is an open-source MIT-licensed library for parsing and converting objects to and from Bencode format.

Rationale

bencode-open is MIT-licensed and can thus be included to almost all software, compared to bencode and bencode.py.

Installation

bencode-open is available on GitHub and on PyPI.

Installing bencode-open from PyPI is recommended and can be done as follows:

pip install bencode-open

Usage

import bencode_open

print(bencode_open.dumps(b"Hello?"))  # Outputs b"6:Hello?"
print(bencode_open.dumps(17))  # Outputs b"i17e"

print(bencode_open.loads(b"6:Hello?"))  # Outputs b"Hello?"
print(bencode_open.loads(b"i17e"))  # Outputs 17

Running tests

python test.py

About

Open-source MIT-licensed library for parsing and converting objects to and from bencode format

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages