this is the best package for reports
Project description
REPORTITY
Description
Reportity is an easy to use library for displaying figures/dataframes and text. Reportity generates an interactive html report on the fly and execute it at the end of the run.
Example
For the full example code look at the examples folder
The following code display dataframe and figure -
report = reportity.Reportity(
title='Reportity Example',
)
report.print_header(
text='Description',
level=1,
)
report.print_paragraph(
text='This is an example of Reportity'
)
report.print_header(
text='Data',
level=2,
)
report.print_paragraph(
text='The data'
)
report.print_dataframe(
dataframe=dataframe,
max_rows=5,
)
report.print_header(
text='Figures',
level=2,
)
report.print_figure(
figure=fig,
)
report.show()
Installation
pip install reportity
possible Problems
- If tinker is not installed - apt-get install python3-tk
Limitations
- Some complicated figures created with matplotlib might not be rendered to Javascript or will get messed up. In this case you can use the _print_figure method with the parameter as_image=True. This will show the figure as an image and not an interactive Javascript figure
report.print_figure(
figure=fig,
as_image=True,
)
Usage
Create reportity object with a title
report = reportity.Reportity(
title='Repority Title',
)
Add header and give it a level
report.print_header(
text='Header name with level 1',
level=1,
)
Add paragraph
report.print_paragraph(
text='This is paragraph text'
)
Add dataframe, you can choose maximum rows to display
report.print_dataframe(
dataframe=dataframe,
max_rows=5,
)
Add figure, If as_image=True than the figure will be an image and not interactive figure, use it when a matplot figure is not displaying correctly
report.print_figure(
figure=fig,
as_image=False,
)
report.print_2_figures(
figure_left=fig_left,
figure_right=fig_right,
)
Save report as html
report.save_as_html(
path='destination_folder/report.html',
)
Sharing Reports
if you want to share the report with someone that dose not have plotly install in her computer you need to create the report with the following flag:
report = reportity.Reportity(
title='Reportity Example',
include_plotly_js=True,
)
This will include some js needed for the plots to stay interactive. If you add it the report size will be a bit bigger so make sure you don't add it always
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.