Good Practice Tables (gptables)¶
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:
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 aftables, an R native equivalent to
gptables, and csvcubed, a package for turning data and metadata into
machine-readable CSV-W files.
5 Simple Steps¶
You map your data to the elements of a
GPTable.You can define the format of each element with a custom
Theme, or simply use the default - gptheme.Optionally design a
Coverto provide information that relates to all of the tables in your Workbook.Optionally upload a
notes_tablewith information about any notes.You
write_workbook()to win.
Note: This package is not intending to create perfectly accessible spreadsheets but will help with the bulk of the work needed. Users of this packages should refer back to the main spreadsheet guidance or the spreadsheet accessibility checklist after using it to make sure nothing has been missed. Please email Analysis.Function@ons.gov.uk if you use the package so we can monitor use and the outputs produced.