PDF Reports
v0.3.0Typeset PDF reports via LaTeX: sections, code listings, colored boxes, tables and figures. Report.auto() turns a DataFrame into a complete report without writing a single line of layout code.
Requirements
PDF export needs the pdf extra and a LaTeX distribution with pdflatex on the PATH (MiKTeX on Windows, TeX Live elsewhere):
bash
python
pip install 'viewx[pdf]' # pylatex + matplotlib
# plus a LaTeX distribution with pdflatexAutomatic Report
auto_report.py
python
import viewx as vx
df = vx.load_dataset("iris.csv")
vx.Report.auto(df, title="Iris Study").save("reporte.pdf")Report.auto() profiles the DataFrame and generates a typeset document with summary tables and figures.
Manual Report
Sections and subsections are context managers; content is added inside:
manual_report.py
python
import viewx as vx
report = vx.Report(title="Experiment Results", two_column=False)
with report.section("Methodology"):
report.add_text("We evaluated three species over four morphological features.")
with report.section("Results"):
with report.subsection("Summary statistics"):
report.add_table(df.describe())
with report.subsection("Distribution"):
report.add_image("hist.png")
report.add_code("vx.plot(df, kind='histogram', x='sepal_length')")
report.add_box("Key finding", "Setosa separates linearly from the other species.")
report.save("reporte") # appends .pdfAPI Reference
Report
Report(title='Report', two_column=False)
Report.auto
Report.auto(df, title=None) -> Report
Report
section / subsection
with report.section(name) / with report.subsection(name)
add_text / add_table / add_image / add_code / add_box
add_text(text) / add_table(df) / add_image(path) / add_code(code) / add_box(title, text)
save / show
save(name) / show()
LaTeX Packages Used
geometry, tikz, pgfplots, tcolorbox and listings are loaded automatically — make sure your LaTeX distribution includes them (full MiKTeX/TeX Live installs do).