flatson package

Submodules

flatson.flatson module

class flatson.flatson.Field[source]

Bases: flatson.flatson.Field

is_array()[source]
is_simple_list()[source]
serialization_options
class flatson.flatson.Flatson(schema, field_sep=u'.')[source]

Bases: object

This class implements flattening of JSON objects

fieldnames

Field names inferred from schema

flatten(obj)[source]

Return a list with the field values

flatten_dict(obj)[source]

Return an OrderedDict dict preserving order of keys in fieldnames

classmethod from_schemafile(schemafile)[source]

Create a Flatson instance from a schemafile

register_serialization_method(name, serialize_func)[source]

Register a custom serialization method that can be used via schema configuration

flatson.flatson.create_getter(path, field_sep=u'.')[source]
flatson.flatson.extract_first(array_value, **kwargs)[source]
flatson.flatson.extract_key_values(array_value, separators=(u';', u', ', u':'), **kwargs)[source]

Serialize array of objects with simple key-values

flatson.flatson.infer_flattened_field_names(schema, field_sep=u'.')[source]
flatson.flatson.join_values(array_value, separator=u', ', **kwargs)[source]

Module contents