pybson

Independent BSON codec for Python that doesn't depend on MongoDB.

Showing:

Popularity

Downloads/wk

0

GitHub Stars

356

Maintenance

Last Commit

2mos ago

Contributors

40

Package

Dependencies

0

License

BSD

Categories

Readme

bson

.. image:: https://img.shields.io/pypi/v/bson.svg :target: https://pypi.python.org/pypi/bson .. image:: https://img.shields.io/travis/py-bson/bson.svg :target: https://travis-ci.org/py-bson/bson .. image:: https://img.shields.io/pypi/pyversions/bson.svg :target: https://github.com/py-bson/bson

Independent BSON codec for Python that doesn't depend on MongoDB. The bson ObjectId implementation is forked from the PyMongo project, licensed under the Version 2.0 Apache License.

Installation

.. sourcecode:: bash

~ $ python setup.py install

or can use pip

.. sourcecode:: bash

~ $ pip install bson

Quick start

.. sourcecode:: python

import bson a = bson.dumps({"A":[1,2,3,4,5,"6", u"7", {"C":u"DS"}]}) b = bson.loads(a) b {'A': [1, 2, 3, 4, 5, '6', u'7', {'C': u'DS'}]}

Sending and receiving BSON objects to and from network sockets.

.. sourcecode:: python

from gevent import monkey, socket monkey.patch_all()

import bson bson.patch_socket() s = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.connect(("127.0.0.1", 12345)) s.sendobj({u"message" : "hello!"})

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100