Namespaces | |
namespace | binary |
namespace | code |
namespace | dbref |
namespace | errors |
namespace | json_util |
namespace | max_key |
namespace | min_key |
namespace | objectid |
namespace | son |
namespace | timestamp |
namespace | tz_util |
Classes | |
class | BSON |
Functions | |
def | _bson_to_dict |
def | _dict_to_bson |
def | _element_to_bson |
def | _element_to_dict |
def | _elements_to_dict |
def | _get_array |
def | _get_binary |
def | _get_boolean |
def | _get_c_string |
def | _get_code_w_scope |
def | _get_date |
def | _get_int |
def | _get_long |
def | _get_null |
def | _get_number |
def | _get_object |
def | _get_oid |
def | _get_ref |
def | _get_regex |
def | _get_string |
def | _get_timestamp |
def | _make_c_string |
def | _to_dicts |
def | decode_all |
def | has_c |
def | is_valid |
Variables | |
_bson_to_dict = _cbson._bson_to_dict | |
_dict_to_bson = _cbson._dict_to_bson | |
dictionary | _element_getter |
_use_c = True | |
_use_uuid = True | |
decode_all = _cbson.decode_all | |
tuple | RE_TYPE = type(re.compile("")) |
def bson::_bson_to_dict | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 232 of file bson/__init__.py.
def bson::_dict_to_bson | ( | dict, | ||
check_keys, | ||||
top_level = True | ||||
) | [private] |
Definition at line 346 of file bson/__init__.py.
def bson::_element_to_bson | ( | key, | ||
value, | ||||
check_keys | ||||
) | [private] |
Definition at line 244 of file bson/__init__.py.
def bson::_element_to_dict | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 217 of file bson/__init__.py.
def bson::_elements_to_dict | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 224 of file bson/__init__.py.
def bson::_get_array | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 106 of file bson/__init__.py.
def bson::_get_binary | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 119 of file bson/__init__.py.
def bson::_get_boolean | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 137 of file bson/__init__.py.
def bson::_get_c_string | ( | data, | ||
length = None | ||||
) | [private] |
Definition at line 65 of file bson/__init__.py.
def bson::_get_code_w_scope | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 148 of file bson/__init__.py.
def bson::_get_date | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 141 of file bson/__init__.py.
def bson::_get_int | ( | data, | ||
as_class = None , |
||||
tz_aware = False , |
||||
unsigned = False | ||||
) | [private] |
Definition at line 55 of file bson/__init__.py.
def bson::_get_long | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 190 of file bson/__init__.py.
def bson::_get_null | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 155 of file bson/__init__.py.
def bson::_get_number | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 90 of file bson/__init__.py.
def bson::_get_object | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 98 of file bson/__init__.py.
def bson::_get_oid | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 133 of file bson/__init__.py.
def bson::_get_ref | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 178 of file bson/__init__.py.
def bson::_get_regex | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 159 of file bson/__init__.py.
def bson::_get_string | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 94 of file bson/__init__.py.
def bson::_get_timestamp | ( | data, | ||
as_class, | ||||
tz_aware | ||||
) | [private] |
Definition at line 184 of file bson/__init__.py.
def bson::_make_c_string | ( | string, | ||
check_null = False | ||||
) | [private] |
Definition at line 75 of file bson/__init__.py.
def bson::_to_dicts | ( | data, | ||
as_class = dict , |
||||
tz_aware = True | ||||
) | [private] |
DEPRECATED - `_to_dicts` has been renamed to `decode_all`. .. versionchanged:: 1.9 Deprecated in favor of :meth:`decode_all`. .. versionadded:: 1.7 The `as_class` parameter.
Definition at line 363 of file bson/__init__.py.
def bson::decode_all | ( | data, | ||
as_class = dict , |
||||
tz_aware = True | ||||
) |
Decode BSON data to multiple documents. `data` must be a string of concatenated, valid, BSON-encoded documents. :Parameters: - `data`: BSON data - `as_class` (optional): the class to use for the resulting documents - `tz_aware` (optional): if ``True``, return timezone-aware :class:`~datetime.datetime` instances .. versionadded:: 1.9
Definition at line 376 of file bson/__init__.py.
def bson::has_c | ( | ) |
Is the C extension installed? .. versionadded:: 1.9
Definition at line 498 of file bson/__init__.py.
def bson::is_valid | ( | bson | ) |
Check that the given string represents valid :class:`BSON` data. Raises :class:`TypeError` if `bson` is not an instance of :class:`str`. Returns ``True`` if `bson` is valid :class:`BSON`, ``False`` otherwise. :Parameters: - `bson`: the data to be validated
Definition at line 400 of file bson/__init__.py.
bson::_bson_to_dict = _cbson._bson_to_dict |
Definition at line 241 of file bson/__init__.py.
bson::_dict_to_bson = _cbson._dict_to_bson |
Definition at line 360 of file bson/__init__.py.
dictionary bson::_element_getter |
{ "\x01": _get_number, "\x02": _get_string, "\x03": _get_object, "\x04": _get_array, "\x05": _get_binary, "\x06": _get_null, # undefined "\x07": _get_oid, "\x08": _get_boolean, "\x09": _get_date, "\x0A": _get_null, "\x0B": _get_regex, "\x0C": _get_ref, "\x0D": _get_string, # code "\x0E": _get_string, # symbol "\x0F": _get_code_w_scope, "\x10": _get_int, # number_int "\x11": _get_timestamp, "\x12": _get_long, "\xFF": lambda x, y, z: (MinKey(), x), "\x7F": lambda x, y, z: (MaxKey(), x)}
Definition at line 194 of file bson/__init__.py.
bson::_use_c = True |
Definition at line 40 of file bson/__init__.py.
bson::_use_uuid = True |
Definition at line 46 of file bson/__init__.py.
bson::decode_all = _cbson.decode_all |
Definition at line 397 of file bson/__init__.py.
tuple bson::RE_TYPE = type(re.compile("")) |
Definition at line 52 of file bson/__init__.py.