BSON (Binary JSON) encoding and decoding.
BSON (Binary JSON) data.
Decode this BSON data.
The default type to use for the resultant document is dict. Any other class that supports __setitem__() can be used instead by passing it as the as_class parameter.
If tz_aware is True (recommended), any datetime instances returned will be timezone-aware, with their timezone set to bson.tz_util.utc. Otherwise (default), all datetime instances will be naive (but contain UTC).
Parameters: |
|
---|
Changed in version 2.7: Added compile_re option.
New in version 1.9.
Encode a document to a new BSON instance.
A document can be any mapping type (like dict).
Raises TypeError if document is not a mapping type, or contains keys that are not instances of basestring (str in python 3). Raises InvalidDocument if document cannot be converted to BSON.
Parameters: |
|
---|
New in version 1.9.
Decode BSON data to multiple documents.
data must be a string of concatenated, valid, BSON-encoded documents.
Parameters: |
|
---|
Changed in version 2.7: Added compile_re option.
New in version 1.9.
Is the C extension installed?
New in version 1.9.
Is the uuid module available?
New in version 2.3.
Check that the given string represents valid BSON data.
Raises TypeError if bson is not an instance of str (bytes in python 3). Returns True if bson is valid BSON, False otherwise.
Parameters: |
|
---|
Sub-modules: