API

AutoGenFiles Core

The core module of AutoGenFiles project

autogenfiles.autogenfiles.run(variables: dict, output_path: str)

Runs the logic for generating rendered templates outcome

Params:
dir_name

str, Required Name of output directory

Files Helper

Helper functions to deal with files

autogenfiles.files_helper.create_subfolder_structure(subfolders, output_path)

Creates subfolders inside output path

Params
subfolders: list(str), Required

A list of string cotaining templates/ subfolders names

output_path: str, Required

Output directory to write rendered templates

autogenfiles.files_helper.guarantee_trailing_slash(directory_name: str) str

Adds a trailling slash when missing

Params:
directory_name

str, required A directory name to add trailling slash if missing

Returns

A post processed directory name with trailling slash

autogenfiles.files_helper.prepare_files_and_subfolders(templates_dir: str = 'templates/')

Given a templates directory, create lists of paths for the templates

Params:
templates_dir

str, required A directory name where templates can be found

Returns

Three objects containing the files names, subfolder list names and the size of the templates directory

autogenfiles.files_helper.prepare_output_path_dir(dir_name: str)

Creates missing directories for output files

Params:
dir_name

str, Required Name of output directory

autogenfiles.files_helper.read_template(file_name: str) str

Reads a template file and returns its content

Params:
file_name

str, Required Template file name

Returns

Template file contents

Configuration module

The module that reads the variables file and return the variables

autogenfiles.configuration.variables_to_substitute(variable_list: str)

Reads variable file

Params:
variable_list

str, Required The variable file to be read and interpreted