Reporting#
- class miblab.Report(reportpath, 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.
- Parameters:
reportpath (str) – Path to the folder where the report should be saved.
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.- build(filename='report')[source]#
Create the report.
- Parameters:
(str (filename) – The name of the report. Defaults to ‘report
optional) (str) – The name of the report. Defaults to ‘report
- Raises:
NotImplementedError – If miblab is not installed.