Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Scientific Reporting in Python

I am working on a scientific python project performing a bunch of computations generating a lot of data.

The problem comes when reports have to be generated from these data, with images embedded (mostly computed with matplotlib). I'd like to use a python module or tool to be able to describe the reports and "build" HTML pages for these reports (or any format supported by a browser).

I was thinking about generating an ipython notebook but I was unable to find if there is a way to do so (except creating the json but I'm doubtful about this approach).

The other way is using Sphinx a bit like the matplotlib but I am not sure how I could really fine-tune the layouts of my various pages.

The last option is to use jinja2 templates (or django-templates or any template engine working) and embed matplotlib code inside.

I know it's vague but was unable to find any kind of reference.

like image 981
LB40 Avatar asked Feb 17 '23 00:02

LB40


1 Answers

nbconvert has been merged into IPython itself, so please do not use the standalone version anymore. It is now fully template base so you can change things from just tweeking the css, fully re-wrote your templates, or just overwrite the current part of templates you want.

Notebook format is a pure json file, is takes ~20 lines to write a program that loop through it and re-run the codecell. That plus command line argument it is not hard to write a notebook, make it a 'template' notebook and run it on multiple dataset without opening a browser.

Some resources :

programatically run nbconvert, and run a notebook headless (first link)

like image 184
Matt Avatar answered Feb 18 '23 13:02

Matt