:py:mod:`mloq.writer` ===================== .. py:module:: mloq.writer .. autoapi-nested-parse:: The writer module defines the Writer class, which is in charge of creating the files and directories specified in the CMDRecord. Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: mloq.writer.Writer .. py:class:: Writer(path, record, overwrite = False) Write all the files specified on the provided CMDRecord. This class fills in rendered templates according to the provided configuration and generates the resulting file on the specified folder. Attributes of this class: path: Path string describing the destination folder where the file will be created. ledger: Instance of the Ledger class. It contains a dictionary summarizing the files that will by generated by mloq. record: Instance of the CMDRecord class. It keeps track of all files and directories that will be created from the user's configuration. overwrite: Boolean value. If True, existing files will be rewritten by mloq application. .. py:method:: path() :property: Path string describing the location where the files will be generated. .. py:method:: ledger() :property: Keep track of the generated files. .. py:method:: record() :property: Register the files and directories generated by the mloq application. .. py:method:: create_directories() Create the folders registered inside the attribute 'record.directories'. .. py:method:: write_templates() Generate the files recorded in the attribute 'record.files' on the specified path. .. py:method:: dump_ledger() Write the summary of the generated files. This method collects the elements stored in ledger to create a markdown document that summarizes all the files generated by the MLOQ application. .. py:method:: write_template(file, path, config) Create new file containing the rendered template configuration. :param file: File object representing the jinja template that will be rendered. :param path: Target folder where the generated files will be written. :param config: DictConfig containing the selected project configuration. :returns: None. .. py:method:: run() Generate all files and directories registered inside the record instance.