Example #1
0
def parse_stream(stream: with_attr("read", "tell")) -> odict:
    return bs_to_py(BSON_Document.parse(stream))
Example #2
0
File: bson.py Project: poelzi/ejdb
def parse_stream(stream: with_attr("read", "tell")) -> odict:
    return bs_to_py(BSON_Document.parse(stream))
Example #3
0
def serialize_to_stream(document: dict, stream: with_attr("write", "flush")):
    py_to_bs(document).serialize(stream)
    stream.flush()
Example #4
0
File: bson.py Project: poelzi/ejdb
def serialize_to_stream(document: dict, stream: with_attr("write", "flush")):
    py_to_bs(document).serialize(stream)
    stream.flush()