Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

207 Commits

Repository files navigation

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

~ $ python setup.py install

or can use pip

~ $ pip install bson

Quick start

>>>importbson>>>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.

>>>fromgeventimportmonkey, socket>>>monkey.patch_all()
>>>>>>importbson>>>bson.patch_socket()
>>>s=socket.socket(socket.AF_INET, socket.SOCK_STREAM)
>>>s.connect(("127.0.0.1", 12345))
>>>s.sendobj({u"message" : "hello!"})

About

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

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages