Skip to content
/ bson Public
forked from py-bson/bson

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

License

Notifications You must be signed in to change notification settings

frewsxcv/bson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

92 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bson

image

image

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

Installation

bash

~ $ python setup.py install

or can use pip

bash

~ $ pip install bson

Quick start

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.

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!"})

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%