mdf_reader.reader.read_sections

Module Contents

Functions

extract_fixed_width(section_serie_bf, section_schema)

extract_delimited(section_serie_bf, section_schema)

read_data(section_df, section_schema)

main(sections_df, schema)

Returns a pandas dataframe with a report per row

extract_fixed_width(section_serie_bf, section_schema)[source]
extract_delimited(section_serie_bf, section_schema)[source]
read_data(section_df, section_schema)[source]
main(sections_df, schema)[source]

Returns a pandas dataframe with a report per row and the report sections split along the columns. Each section is a block string and only the sections listed in read_sections parameter are output.

Parameters
  • sections_df (pandas.DataFrame) – Pandas dataframe with a column per report sections. The sections in the columns as a block strings.

  • schema (dict) – Data source data model schema

Returns

  • data (pandas.DataFrame) – Dataframe with the report section elements split along the columns. Multiindex if bla, regular index if ble

  • mask (pandas.DataFrame) – Dataframe with the report section elements split along the columns. Multiindex if bla, regular index if ble

  • dtypes (dict) – Dictionary with pandas data types for each of the output elements