Skip to content
This repository was archived by the owner on Nov 13, 2025. It is now read-only.
/ hrbson Public archive
forked from py-bson/bson

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

License

Unknown, Apache-2.0 licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE_APACHE
Notifications You must be signed in to change notification settings

helloretail/hrbson

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

208 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hrbson

This was forked from https://github.com/py-bson/bson, because it's name would clash with pymongo, which also installs a bson library.

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

~ $ poetry add git+https://github.com/helloretail/hrbson.git

Quick start

>>> import hrbson
>>> a = hrbson.dumps({"A":[1,2,3,4,5,"6", u"7", {"C":u"DS"}]})
>>> b = hrbson.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.

>>> from gevent import monkey, socket
>>> monkey.patch_all()
>>>
>>> import hrbson
>>> hrbson.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

Unknown, Apache-2.0 licenses found

Licenses found

Unknown
LICENSE
Apache-2.0
LICENSE_APACHE

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%