dpmcore.services.layout_exporter
Export annotated DPM table layouts to Excel workbooks (hierarchical headers, data-point cells, dimensional annotations, and categorisation tooltips).
Note
Requires the export extra: pip install dpmcore[export].
LayoutExporterService
- class dpmcore.services.layout_exporter.service.LayoutExporterService(session)[source]
Bases:
objectExport annotated table layouts to Excel workbooks.
- Parameters:
session (
Session) – An open SQLAlchemy session.
- __init__(session)[source]
Bind the service to an open SQLAlchemy session.
- Parameters:
session (Session)
- Return type:
None
- export_module(module_code, release_code=None, output_path=None, config=None)[source]
Export all tables in a module to a single workbook.
- Parameters:
- Return type:
- Returns:
Path to the written file.
- export_tables(table_codes, release_code=None, output_path=None, config=None)[source]
Export specific tables to a workbook.
- Parameters:
- Return type:
- Returns:
Path to the written file.
Configuration and models
- class dpmcore.services.layout_exporter.models.ExportConfig(annotate=True, add_header_comments=True, add_cell_comments=True, show_code_row=True, show_code_column=True, show_abstract_header_codes=False)[source]
Configuration flags for the export.
- Parameters:
- class dpmcore.services.layout_exporter.models.TableLayout(table_vid, table_code, table_name, rows=<factory>, columns=<factory>, sheets=<factory>, cells=<factory>, max_col_depth=0, max_row_depth=0, dimension_ids=<factory>, is_open_row=False)[source]
Complete processed layout for one DPM table.
- Parameters: