.. _export_interface: **************** Export your Data **************** The **ExportManager** is the last instance of the task execution and combines the components **Exporter** and **Writer**. The Exporter accesses the data of the database and prepares *(e.g., resample the data)* it for the export. The **Writer** writes the prepared data into a specific format *(e.g., netCDF)*. .. figure:: ../../graphics/export_steps.svg :width: 100% Exporter ======== Interface --------- .. autoclass:: IAGOS.apps.workflow.exports.exporter.base.BaseExporter :show-inheritance: :noindex: .. autofunction:: IAGOS.apps.workflow.exports.exporter.base.BaseExporter.run :noindex: Template -------- .. code-block:: python from IAGOS.apps.workflow.exports.exporter.base import BaseExporter class ExampleExporter(BaseExporter): """ Here you can describe the functionality of your exporter! """ NAME = "Example" DESCRIPTION = "Example for demonstrations" def __init__(self): super().__init__() def run(self, task, writer, destination, addition): pass Example & Registration ---------------------- To enable a smooth start, we have prepared a simple example. The *Exporter* prepares a time series and additional information for the export. After it, the writer will write the data into a CSV file. 1. Download the Python module :download:`demo.py <../../media/demo_writer.py>` 2. Move the module to the folder **application/IAGOS/apps/workflow/exports/writers** 3. Open the module **application.IAGOS.apps.workflow.exports.writers.all_writer.py** 4. Import the writer .. code-block:: python from IAGOS.apps.workflow.exports.writers.demo import ICHCSVWriter 5. Add your writer to the dictionary .. code-block:: python WRITERS = { ICHCSVWriter.NAME: ICHCSVWriter } 6. Register it by executing the following command in the project directory .. code:: console make update-data Writer ====== Interface --------- .. autoclass:: IAGOS.apps.workflow.exports.writers.base.BaseWriter :show-inheritance: :noindex: .. autofunction:: IAGOS.apps.workflow.exports.writers.base.BaseWriter.write :noindex: Template -------- .. code-block:: python from IAGOS.apps.workflow.exports.writers.base import BaseWriter class ExampleWriter(BaseWriter): """ Here you can describe the functionality of your writer! """ NAME = "Example" DESCRIPTION = "Example for demonstrations" def __init__(self): super().__init__() def write(self, data, data_info, filename, addition): pass Example & Registration ---------------------- To enable a smooth start, we have prepared simple examples. We have prepared a writer that writes the data into a csv format with additional information. 1. Download the Python module :download:`demo.py <../../media/demo_writer.py>` 2. Move the module to the folder **application/IAGOS/apps/workflow/exports/writers** 3. Open the module **application.IAGOS.apps.workflow.exports.writers.all_writer.py** 4. Import the writer .. code-block:: python from IAGOS.apps.workflow.exports.writers.demo import ICHCSVWriter 5. Add your writer to the dictionary .. code-block:: python WRITERS = { ICHCSVWriter.NAME: ICHCSVWriter } 6. Register it by executing the following command in the project directory .. code:: console make update-data