bach.SeriesJson.json
property jsonβ
: bach.series.series_json.JsonAccessor
Get access to json operations via the class thatβs returned through this accessor.
Use as my_series.json.get_value()
or my_series.json[:2]
class JsonAccessorβ
(series_object)Class with accessor methods to JSON type data.
array_containsβ
(item)flatten_arrayβ
()Converts elements in an array into a set of rows.
Since the operation might destroy the order of the elements, a series containing the offset is also returned.
Returnsβ
Tuple with SeriesJson (element from the array) and SeriesInt64 (0-based offset of the element)
Both returned series objects will share same base node, but this node is not the same as the unflatten Series.
This assumes the top-level item in the json is an array.
get_array_lengthβ
()Get the length of the toplevel array.
This assumes the top-level item in the json is an array. Will result in an exception (later on) if thatβs not the case!
get_valueβ
(key, as_str=False)Get item from toplevel object by key.
Parametersβ
key
β the key to return the values for.as_str
β if True, it returns a string Series, json otherwise. Particular useful if the returned value is in fact a string. In json the string will be represented as a quoted string, if this field is set to true, the returned SeriesString will not have additional quotes.
Returnsβ
series with the selected object value.