This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Simple universal binary json decoder/encoder for Python.

Project Description
Simple UBJSON in Python
=======================

`UBJSON`_ is the universally compatible format specification for binary `JSON`_.
It's pretty and simple data format and `simpleubjson`_ aims to be also the same.

.. code-block:: python

>>> import simpleubjson
>>> ubjdata = simpleubjson.encode({'hello': 'world', 'тест': [1, 2, 3]})
>>> ubjdata
b'{Si\x08\xd1\x82\xd0\xb5\xd1\x81\xd1\x82[i\x01i\x02i\x03]SU\x05helloSi\x05world}'

:func:`simpleubjson.encode` function transforms Python objects into UBJSON
`binary` string data. To decode it back to Python objects use
:func:`simpleubjson.decode` function:

.. code-block:: python

>>> simpleubjson.decode(ubjdata)
{'hello': 'world', 'тест': [1, 2, 3]}

Moreover, you may also introspect UBJSON data via :func:`simpleubjson.pprint`
function:

.. code-block:: python

>>> simpleubjson.pprint(ubjdata)
[{]
[S] [i] [5] [hello]
[S] [i] [5] [world]
[S] [i] [8] [тест]
[[]
[i] [1]
[i] [2]
[i] [3]
[]]
[}]

This representation is a bit more human friendly than traditional hexview and
designed specially for UBJSON format.

Currently `simpleubjson` follows Draft-9 specification by default, but you
may change specification version by passing ``spec="draft-N"`` argument for
:func:`~simpleubjson.decode`, :func:`~simpleubjson.encode` and
:func:`~simpleubjson.pprint` functions.

.. _UBJSON: http://ubjson.org/
.. _JSON: http://json.org/
.. _simpleubjson: http://code.google.com/p/simpleubjson/

Changes
=======

0.7.0 (2014-06-21)
------------------

- Add support of UINT8 type for Draft-9 spec;
- Add support of CHAR type for Draft-9 spec;
- Optimize strings encoding with new types;
- Switch to BSD 2 clause license;

0.6.1 (2013-04-29)
------------------

- Fix compatibility with Python 3.x;
- Force binary strings have utf-8 charset on encoding;
- Improve UBJSON decoding performance;

0.6.0 (2013-04-10)
------------------

- Project refactoring and code cleanup;
- Raise overall performance for 100-400% times depending on test case;
- Update Draft-9 support to RC state: handle new containers markers;

0.5.0 (2012-07-07)
------------------

- Fix encoding of unsized objects;
- Fix pprinting containers with NoOp markers;
- Fix markers of integers values for Draft-9 spec;

0.4.0 (2012-06-29)
------------------

- Encode `set` and `frozenset` types;
- Experimental implementation of Draft-9 specification;
- Fix encoding of `dict` iterators;
- Support Python 3.x;

0.3.0 (2012-03-03)
------------------

- Add `simpleubjson.pprint` function to dump UBJSON data using ``[ ]``-notation;
- Allow decode standalone NoOp values;
- Encode `inf` and `-inf` values as `null`;
- Remove support of custom markers and handlers;
- Wrap `HUGE` values with `Decimal` class and encode `Decimal` instances back
to `HUGE`;

0.2.0 (2011-11-30)
------------------

- Allow decoder produce NoOp values;
- Allow to specify custom decoding/encoding handlers;
- Fix float/double values handling;

0.1.0 (2011-10-13)
------------------

- First version with support Draft-8 specification.
Release History

Release History

This version
History Node

0.7.0

History Node

0.6.1

History Node

0.6.0

History Node

0.5

History Node

0.4

Download Files

Download Files

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

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
simpleubjson-0.7.0.tar.gz (30.6 kB) Copy SHA256 Checksum SHA256 Source Jun 21, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting