GitXplorerGitXplorer
a

flatbencode

public
6 stars
2 forks
1 issues

Commits

List of commits on branch master.
Unverified
f41e25d6198e3ac6370f532b52ac04864d628c34

Add edge case

aacatton committed 8 years ago
Unverified
11ae22584b946fc438423d37a1349cd5bffe9f04

Hypothesis and python 3.6 is flaky

aacatton committed 8 years ago
Unverified
05a6034fec8af29a852f14599e593e9fee499ae1

Add test for trailing data

aacatton committed 8 years ago
Unverified
2d89889d975e9b5e152960f36a82dfd71f9eb233

Factor the Python >= 3.7 decorator

aacatton committed 8 years ago
Unverified
983a3ef359a0232d1820b8f88097ac4ec92af0c6

Reorder imports to be alphabetical

aacatton committed 8 years ago
Unverified
88cae88a69a1b3b0bfb60e94bf8f66f6882d3917

Add changelog

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.