"""Generate Latex tables in a .sty file from CSV files. The paths to the CSVfiles to create tables from and their metadata is given as a YAML configurationfile.Example:: latextablenamehere: type: slack slack_col: 0 path: ../config/table-name.csv caption: Some Caption placement: t! size: small single_column: true percent_column_names: ['Proportion']"""fromzensols.utilimportAPIError
[docs]classDataDescriptionError(APIError):"""Thrown for any application level error. """pass
[docs]classLatexTableError(DataDescriptionError):"""Thrown for any application level error related to creating tables. """
[docs]def__init__(self,reason:str,table:str=None):iftableisnotNone:reason=f'{reason} for table {table}'super().__init__(reason)self.table=table