mario_addons.plugins package

Submodules

mario_addons.plugins.read module

Functions for read commands.

mario_addons.plugins.read.read_csv_dicts(file, header, **kwargs)[source]

Read csv rows into an iterable of dicts.

Return type:Iterable[Mapping[Any, str]]
mario_addons.plugins.read.read_csv_tuples(file, **kwargs)[source]

Read csv rows into an iterable of tuples.

Return type:Iterable[Tuple]

mario_addons.plugins.walking module

Functions for walking a tree.

mario_addons.plugins.walking.build_mapping(pairs)[source]

Build a type-to-transformer mapping.

mario_addons.plugins.walking.build_new(old, new)[source]

Build a new instance of the old type, with new data.

mario_addons.plugins.walking.build_transforming_json_walker(pairs)[source]

Build a walker for json-like trees.

Return type:Callable
mario_addons.plugins.walking.build_walker(descend, handle_item)[source]

Build a walker with specified functions.

Return type:Callable
mario_addons.plugins.walking.get_type_object(namespaced_type_name)[source]

Turns a qualname into the corresponding object.

Return type:Type
mario_addons.plugins.walking.make_func(code, namespace)[source]

Make a transformer function.

Return type:Callable
mario_addons.plugins.walking.prefixes(multi_attribute_access)[source]

Get prefixes of a namepsaced name.

>>> prefixes('a.b.c')
['a.b.c', 'a.b', 'a']
Return type:List[str]
mario_addons.plugins.walking.traverse_one_level_json(handle_item, tree)[source]

Traverse one level of a json-like tree.

mario_addons.plugins.write module

Functions for write commands.

mario_addons.plugins.write.write_csv_dicts(rows, header, dialect)[source]

Write iterable of dicts to csv.

Return type:str
mario_addons.plugins.write.write_csv_tuples(rows, dialect)[source]

Write iterable of tuples to csv.

Return type:str
mario_addons.plugins.write.write_yaml(data)[source]

Write data to yaml string.

Return type:str

Module contents

A plugin module for mario.