miblab.Report#
- class miblab.Report(folder, filename='miblab_report', title='MIBLAB report', subtitle='Subtitle', subject='Subject', author='miblab.org', affiliation='https://miblab.org', contact='Steven Sourbron', institute='University of Sheffield', department='Section of Medical Imaging and Technologies', email='s.sourbron@sheffield.ac.uk')[source]#
Bases:
Document
Generate pdf reports in miblab style.
Example output: metformin report, generated by the function
all_results()
in this module.- Parameters:
folder (str) – Path to the folder where the report should be saved.
filename (str) – Name of the report (without the .pdf extension).
title (str) – The title of the report.
subtitle (str) – The subtitle of the report.
subject (str) – The subject of the report.
author (str) – The author of the report.
affiliation (str) – The affiliation of the author.
contact (str) – The contact person for the report.
institute (str) – The institute of the author.
department (str) – The department of the author.
email (str) – The email of the author.
Example
from miblab import Report # Where to save the report path = 'path/to/report/folder' # Setup the report doc = Report(path, title='My Report', author='Me') # Add a chapter doc.chapter('Chapter 1') # Add a section doc.section('Section 1') # Start a new page doc.clearpage() # Add a subsection doc.subsection('Section 1') # Add a figure doc.figure('figure.png', caption='This is a figure.') # Add a table doc.table('table.csv', caption='This is a table.') # Build the pdf report doc.build(doc)
Note
miblab.Report
inherits from pylatex.Document, so can be used in the same way as a pylatex.Document for full customization options.Attributes
Methods
Create the pdf report.
Add a chapter to the report.
Continue on a new page.
Add a figure to the report.
Add a section to the report.
Add a subsection to the report.
Add a table to the report.
- build()[source]#
Create the pdf report.
- Raises:
NotImplementedError – If miblab is not installed.
- packages = OrderedSet()#