Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/whtsky/bencoder.pyx
A fast bencode implementation in Cython
https://github.com/whtsky/bencoder.pyx
bencode bencoder bencoding bittorrent cython
Last synced: about 10 hours ago
JSON representation
A fast bencode implementation in Cython
- Host: GitHub
- URL: https://github.com/whtsky/bencoder.pyx
- Owner: whtsky
- License: bsd-3-clause
- Created: 2016-01-24T14:14:34.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-08-05T17:36:46.000Z (5 months ago)
- Last Synced: 2024-12-15T07:05:26.565Z (8 days ago)
- Topics: bencode, bencoder, bencoding, bittorrent, cython
- Language: Python
- Homepage:
- Size: 245 KB
- Stars: 33
- Watchers: 3
- Forks: 10
- Open Issues: 10
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
Bencoder.pyx
============A fast bencode implementation in Cython supports both Python2 & Python3 .
.. image:: https://img.shields.io/pypi/l/bencoder.pyx.svg
:alt: PyPI License
:target: https://pypi.org/project/bencoder.pyx/
.. image:: https://codecov.io/gh/whtsky/bencoder.pyx/branch/master/graph/badge.svg
:alt: Codecov Coverage
:target: https://codecov.io/gh/whtsky/bencoder.pyxInstall
-------.. code-block:: bash
pip install bencoder.pyx
Usage
-----.. code-block:: python
from bencoder import bencode, bdecode, bdecode2
assert bencode("WWWWWW") == b'6:WWWWWW'
assert bencode(233) == b'i233e'
with open("debian-8.3.0-amd64-netinst.iso.torrent", "rb") as f:
torrent = bdecode(f.read())
print(torrent['announce'])
decoded, length = bdecode2(b'6:WWWWWWi233e')
assert decoded == b'WWWWWW'
assert length == 8ChangeLog
----------Version 3.0.1
~~~~~~~~~~~~~~~
+ Add support for Python 3.11Versoin 3.0.0
~~~~~~~~~~~~~~~+ Add support for Python 3.9 & 3.10
+ Drop support for Python 2
+ Build wheels for musl & aarch64Version 2.0.1
~~~~~~~~~~~~~~~+ Add support for Python 3.8
+ Drop support for Python 3.4Version 2.0.0
~~~~~~~~~~~~~~~+ Use built-in dict instead of OrderedDict on Python >= 3.7
+ Drop support for Python 3.3
+ Fix bytes parsing when used with python-future `#41 `_Version 1.2.1
~~~~~~~~~~~~~~~+ Drop support for Python 2.6
+ Performance boost for `bencode` method. `#7 `_Version 1.2.0
~~~~~~~~~~~~~~~+ Add `bdecode2` method. `#6 `_
Version 1.1.3
~~~~~~~~~~~~~~~+ Performance Improvement
+ Fix package metainfo `#3 `_Version 1.1.2
~~~~~~~~~~~~~~~+ Support encode large int
Version 1.1.0
~~~~~~~~~~~~~~~+ Use OrderedDict instaed of dict
+ Support encoding subclasses of dict