drilldown
writes navigable xlsx reports from pandas dataframes.
Suppose you have a lot of objects to describe (in my case, several hundred public transport routes), and you want to show them on various levels of aggregation. Maybe you also want to describe these objects from different points of view (e.g. number of trips per hour, average speed, punctuality and other metrics).
Also suppose you want complex logic in each table cell (e.g. you have a planned trips schedule and factual schedule computed from GPS tracks, and you need to compare those).
And you don’t want to invest much time in careful creation of a data cube for your data. Rather you need to quickly assemble fairly usable report.
pip install git+https://github.com/krvkir/drilldown.git
- Get the data.
- Create the top-level dataframe with the most aggregated data. Create a page out of it. Give that page a title, describe the details of aggregation in a description.
- Create dataframes of the second level, create pages out of them. Set for them the first page as a parent to enable navigation.
- Create the renderer, provide it with a filename to save the document, and optionally with styles for table elements.
- Add pages to the renderer and render pages to the file.
See notebooks in examples/
folder for the details.
Data and page properties are separated from visual presentation. So it’s possible to write your own renderer, e.g. to produce static website or one-page javascript app based on D3.js
.
pandas
xlsxwriter
to make xlsx book.