Utilities¶
Data structures¶
-
class
route4me.sdk.utils.PagedList(total=None, limit=None, offset=None, items=None)[source]¶ Bases:
listEnumerable structure for array-like responses of the Route4Me API.
Several endpoints of Route4Me API return enumerable responses, which contains meta-information about paging (fields like
total,limit,offset). This class allows enumerating requested data along with mentioned meta-data fields.-
limit¶ Limit used during endpoint access
Getter: Value of limitparameter if it was used in queryReturn type: int
-
Typeconv¶
-
route4me.sdk._internals.typeconv.bool201(boolvalue)[source]¶ Converts
boolvalue to string:u'0'oru'1'— a returned value is in unicode.Parameters: boolvalue (bool) – Value to convert Returns: String '0'or'1'Return type: str Raises: TypeError – if not a bool argument was passed
-
route4me.sdk._internals.typeconv.str2bool(strvalue, default=None)[source]¶ Converts string value to
bool. Can parse human-readable values, like'yes'and'off'.If value is not recognized – the value of the :paramref:`~str2bool.default` argument will be returned.
Note
str2bool()is not an extension of defaultbool. For example, it doesn’t recognize integer2(or any other number) asTruevalue.Parameters: Returns: Parsed boolean value or :paramref:`~str2bool.default` (if defined). Not a bool value will be returned only if value was not recognized.
Return type: bool or *