Skip to main content

Report generator for html reports

Project description

numerous Report Generator

A python package focused on enabling you to create beautiful and powerful html reports with great ease. You can use the reports to document your work and showcase your data, even generating these automitically with your analysis code already implemented in python.

This package exposes a simple library to create a report, adding your sections, figures and tables or even just directly html divs with your own custom html code.

When you have added your content to the report you can save it to a stand-alone html file you can share with anyone.

We have provided you with a first template that you can modify to your needs. Soon we will publish a guide on how to change basic things in it - for instance the logo file.

Installation

The package numerous report generator can be installed with:

pip install numerous-html-report-generator

Post installation

If plotly is used for image generation, it uses the Kaleido backend to provide the figure -> bitmap conversion. Kaleido in turn relies on Google chrome being installed on the system. Therefore, the following command needs to be run after installation:

kaleido_get_chrome

Quick start

Here is a simple example to get you started once you have installed the package:

from pathlib import Path
import os
from numerous.html_report_generator import Report, Section, GoFigure, DataFrameTable
import pandas as pd

# Define output folder and html file
folder = Path('./output')
filename = 'my_first_report'
file = folder.joinpath(filename+'.html')

#Remove previous report file if exists
if os.path.exists(file):
    os.remove(file)

# Create report
report = Report(target_folder=folder, filename=filename)

# Add info for the header and title page
report.add_header_info(header='My Organization',
                       title='My First Report',
                       sub_title='but not the last',
                       sub_sub_title='at all',
                       footer_title='My first footer',
                       footer_content='This is the end!'
                       )

#Add a section
section = Section(section_title="Section 1")

#create a figure
figure = GoFigure({
        "data": [{"type": "bar",
                  "x": [1, 2, 3],
                  "y": [1, 3, 2]}],
        "layout": {"title": {"text": "A Figure Specified By Python Dictionary"}}
    }, caption="Test figure", notes=["Please notice x", "Please notice y"])

#create a table
table = DataFrameTable(pd.DataFrame({
    'a': [1, 2, 3],
    'b': [4, 5, 6]
}), caption="This is a test table")

#Add the figure and table to the section
section.add_content({
    'figure': figure,
    'table': table
})

#Add the section to the report
report.add_blocks({
    'section': section
})

# Save the report - creates the html output file
report.save()

Contributing:

Please see CONTRIBUTING.md for details on how to contribute.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

numerous_html_report_generator-1.7.2.tar.gz (13.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

numerous_html_report_generator-1.7.2-py3-none-any.whl (18.0 kB view details)

Uploaded Python 3

File details

Details for the file numerous_html_report_generator-1.7.2.tar.gz.

File metadata

File hashes

Hashes for numerous_html_report_generator-1.7.2.tar.gz
Algorithm Hash digest
SHA256 661622ef591e1dcc519c03ce6d278564bc3089e87a9d19cb77eadaf73d336d73
MD5 16c10ed099245fdb8ef32f38a7bd1ffb
BLAKE2b-256 e4a1c6dee1e06232ab731b8fa280f8b1acc50911245b6f4dbba5a1a1856747cc

See more details on using hashes here.

File details

Details for the file numerous_html_report_generator-1.7.2-py3-none-any.whl.

File metadata

File hashes

Hashes for numerous_html_report_generator-1.7.2-py3-none-any.whl
Algorithm Hash digest
SHA256 de462f57a0836bbcc04d23a3ce51b3b2efc6604ad0dd081df9586713ea8208eb
MD5 3fe159f6a9cdfa3f6d85a2eae6c181ee
BLAKE2b-256 1d389a738273f8cf845b9421ad6dfc89e9245879d6289edf2513721e75c6f3bb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page