avro_to_python.writer package

Submodules

avro_to_python.writer.writer module

Writer class for writing python avro files

class avro_to_python.writer.writer.AvroWriter(tree: dict, pip: str = None, top_level_package: str = None, author: str = None, package_version: str = None)[source]

Bases: object

writer class for writing python files

Should initiate around a tree object with nodes as:

{
‘children’: {}, ‘files’: {}, ‘visited’: False

}

The “keys” of the children are the namespace names along avro namespace paths. The Files are the actual files within the namespace that need to be compiled.

Note: The visited flag in each node is only for node traversal.

This results in the following behavior given this sample tree:

tree = {
‘children’: {‘test’: {
‘children’: {}, ‘files’: {‘NestedTest’: …}, ‘visited’: False

}}, ‘files’: {‘Test’ …}, ‘visited’: False

}

files generated: /Test.py /test/NestedTest.py

files = []
root_dir = None
write(root_dir: str) → None[source]

Public runner method for writing all files in a tree

root_path: str
root path to write files to
None

Module contents