Good Practice Tables (gptables)

Actions build status PyPI release

gptables produces .xlsx files from your pandas dataframes in either python or R (using reticulate). You define the mapping from your data to elements of the table and gptables does the rest.

Table element mapping:

Cells A1 to A6 contain the title, subtitles, instructions, legend, source and scope. These parameters are mapped individually. The next row contains the column headings. Within the same row but on a new line are the units. The table note references are within the same row on a new line under the units. In columns 1, 2 and 3 of the next row down are index levels 1, 2 and 3. In the next columns are the data. Column headings, indices and data are supplied as a pandas DataFrame. Units and table note references are mapped individually.

gptables uses the official guidance on good practice spreadsheets. It advocates a strong adherence to the guidance by restricting the range of possible operations. The default formatting theme gptheme accommodates many use cases. However, the Theme Class allows development of custom themes, where alternative formatting is required.

gptables is developed and maintained by the Analysis Function. It can be installed from PyPI or GitHub. The source code is maintained on GitHub. Users may also be interested in a11ytables, an R native equivalent to gptables, and csvcubed, a package for turning data and metadata into machine-readable CSV-W files.

5 Simple Steps

  1. You map your data to the elements of a GPTable.

  2. You can define the format of each element with a custom Theme, or simply use the default - gptheme.

  3. Optionally design a Cover to provide information that relates to all of the tables in your Workbook.

  4. Optionally upload a notes_table with information about any notes.

  5. You write_workbook() to win.