Skip to content

Create navigable xlsx reports from pandas dataframes.

License

Notifications You must be signed in to change notification settings

krvkir/drilldown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Drilldown

drilldown writes navigable xlsx reports from pandas dataframes.

Problem

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.

Install

pip install git+https://github.com/krvkir/drilldown.git

Usage

  1. Get the data.
  2. 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.
  3. Create dataframes of the second level, create pages out of them. Set for them the first page as a parent to enable navigation.
  4. Create the renderer, provide it with a filename to save the document, and optionally with styles for table elements.
  5. 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.

Dependencies

  • pandas
  • xlsxwriter to make xlsx book.

About

Create navigable xlsx reports from pandas dataframes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages