GitXplorerGitXplorer
a

flatbencode

public
6 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
428911329850530fbd80f1241496d6eb9b8fd1c2

Update ChangeLog

aacatton committed 8 years ago
Unverified
6e9f56ee25b27d2450de79ae81b345bbc5f44864

Ensures that all dictionary keys are only bytes when encoding

aacatton committed 8 years ago
Unverified
27b8a952d2b3b4b4b0f88725e45e6788ec9adcef

Prepare next release

aacatton committed 8 years ago
Unverified
77a6e2d68b0c230be06a7229038fc1f7c72533d0

Release 0.2.0

aacatton committed 8 years ago
Unverified
4840cc2d6ecd0abd275677f76ee31047be5792b3

Some marketing

aacatton committed 8 years ago
Unverified
e7ecf58ab92225ddcf6f9e3fe29e581567e621fc

Ignore hypothesis cache

aacatton committed 8 years ago

README

The README file for this repository.

flatbencode

.. image:: https://travis-ci.org/acatton/flatbencode.svg?branch=master :target: https://travis-ci.org/acatton/flatbencode

Fast, safe and thoroughly tested implementation of bencode in pure Python 3, without any C extension.

This is called flatbencode because the algorithm for decoding a bencode structure is non-recursive, thus preventing RuntimeException.

Usage

.. code:: python

>>> from flatbencode import encode, decode
>>> encode({b'foo': [b'bar', 1]})
b'd3:fool3:bari1eee'
>>> decode(b'ldei0e0:e')
[OrderedDict(), 0, b'']

Run tests

.. code::

$ pip install pytest hypothesis
$ py.test -v

Changelog

v0.3.0 (not released yet) ^^^^^^^^^^^^^^^^^^^^^^^^^

v0.2.1 (2016-10-22) ^^^^^^^^^^^^^^^^^^^

  • Do not accept strings as dictionary keys [Antoine Catton]

v0.2.0 (2016-10-22) ^^^^^^^^^^^^^^^^^^^

  • Raise an exception when there's still data left. [Tim Ruffing, #2]
  • Use bytes as python dictionary keys (instead of strings) [Tim Ruffing, #2]
  • Sort dictionary keys when serializing (follows the BEP-0003) [Antoine Catton]

v0.1.0 (2016-06-12) ^^^^^^^^^^^^^^^^^^^

  • Initial release.
  • Can decode bencoding into a python datastructure.
  • Can encode a python datastructure into bencoding serialization format.