Skip to content

Update README.md #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
Concise Binary Object Representation (CBOR) is a superset of JSON's schema that's faster and more compact.
An implementation of [RFC 7049](https://tools.ietf.org/html/rfc7049) - Concise Binary Object Representation (CBOR) in Python, including a C-accelerated implementation.

* http://tools.ietf.org/html/rfc7049
* http://cbor.io/
[CBOR](https://cbor.io/) is comparable to JavaScript Object Notation (JSON); it has a superset of JSON’s ability, but serializes to a binary format which is smaller and faster to generate and parse. The `cbor` library provides convenient `loads()` and `dumps()` methods like the `json` standard library for JSON.

This Python implementation provides loads()/dumps() like the json standard library.
The C-accelerated implemenation runs 3-5 times faster than the Python standard library's C-accelerated implementation of JSON. The following compares the `cbor` library to the standard `json` library in Python 2.7:

Compare to Python 2.7.5's standard library implementation of json:
```bash
serialized 50000 objects:
into 1163097 cbor bytes in 0.05 seconds (1036613.48/s)
and 1767001 json bytes in 0.22 seconds (224772.48/s)

```
#!

serialized 50000 objects into 1163097 cbor bytes in 0.05 seconds (1036613.48/s) and 1767001 json bytes in 0.22 seconds (224772.48/s)
compress to 999179 bytes cbor.gz and 1124500 bytes json.gz
load 50000 objects from cbor in 0.07 secs (763708.80/sec) and json in 0.32 (155348.97/sec)

load 50000 objects:
from cbor in 0.07 secs (763708.80/sec)
and json in 0.32 (155348.97/sec)
```

There is also a pure-python implementation which gets about 1/3 the speed of json's C augmented speed.
There is also a pure-python implementation which gets about 1/3 the speed of the standard `json` C-accelerated speed.

Tested in Python 2.7.5, 2,7.6, 3.3.3, 3.4.0, and 3.5.2

Available on pypi:
[Listed on PyPI](https://pypi.org/project/cbor/) the `cbor` library can be installed using:

```bash
pip install cbor
````

---

For Go implementation, see:
https://github.com/brianolson/cbor_go
For an equivalent Go implementation, see https://github.com/brianolson/cbor_go