PDF reports
Export analysis results as professional PDF documents.
Two report types
Reveilio ships with two PDF report generators, both accessible as one-line function calls:
Candidate report
A detailed multi-section report for a single candidate. Includes the executive summary, detailed metrics table, strengths and weaknesses, career flags, experience analysis, KPIs, AI reasoning, and relevancy metrics.
Batch ranking report
A summary table showing all candidates ranked by score with their names, scores, recommendations, and years of experience. Ideal for presenting shortlists to hiring managers.
Saving a single candidate report
result = reveilio.analyze_resume("resumes/alice.pdf", jd)
# Save the detailed report as a PDF
path = reveilio.save_report_pdf(result, "reports/alice_evaluation.pdf")
print(f"Report saved to {path}")
Parent directories are created automatically. The function returns the
pathlib.Path of the written file.
What the candidate report contains
- Header: report title, role name, candidate name, overall score, and recommendation.
- Executive Summary: the AI-generated critique (approx. 120 words).
- AI Fit Suggestions: alternative roles the candidate might suit (if available).
- Detailed Metrics: a table with each scoring dimension, its score, and reasoning.
- Key Insights: side-by-side table of strengths (green) and weaknesses (red).
- Career Red Flags: any flagged concerns about the candidate's history.
- Experience Relevance Analysis: deep dive into how work history aligns with the role.
- Key Performance Indicators: quantified achievements from the resume.
- AI Matching Reasoning: step-by-step logic behind the overall score.
- Relevancy Metrics: table with metrics like average tenure, each rated high/medium/low.
Saving a batch ranking report
results = reveilio.analyze_folder("./resumes", jd)
# Save the ranking summary
path = reveilio.save_batch_report_pdf(results, "reports/ranking.pdf")
print(f"Ranking saved to {path}")
What the batch report contains
A single styled table with columns: Rank, Candidate Name, Score, Recommendation, and Years of Experience. The role title is printed at the top. Rows alternate in color for readability.
Exporting reports for all shortlisted candidates
A common pattern: generate individual reports for shortlisted candidates and a batch summary for the full set.
results = reveilio.analyze_folder("./resumes", jd)
# Batch ranking for everyone
reveilio.save_batch_report_pdf(results, "reports/ranking.pdf")
# Individual reports for shortlisted candidates only
shortlist = [r for r in results if r.recommendation == "Shortlist"]
for r in shortlist:
name = r.candidate_data.name.replace(" ", "_")
reveilio.save_report_pdf(r, f"reports/{name}.pdf")
Getting raw PDF bytes (for web responses)
If you are building a web application and need to stream the PDF in an HTTP response rather than write it to disk, use the lower-level generator functions:
from reveilio.reports.pdf import generate_candidate_report, generate_batch_report
# Single candidate: returns io.BytesIO
buf = generate_candidate_report(result.model_dump())
pdf_bytes = buf.getvalue()
# Batch: returns io.BytesIO
buf = generate_batch_report([r.model_dump() for r in results])
pdf_bytes = buf.getvalue()
# Example: FastAPI response
from fastapi.responses import Response
return Response(pdf_bytes, media_type="application/pdf")
Markdown formatting in reports
The LLM sometimes wraps important terms in **double asterisks**
(Markdown bold). The PDF renderer converts these to bold text automatically, so
key skills and achievements appear highlighted in the output.
Customizing the report layout
The report generator is built with ReportLab. To customize colors, fonts, or
sections, copy src/reveilio/reports/pdf.py into your project and modify
it directly. The function signatures remain the same, so you can swap your version
in without changing any calling code.
Continue to Guides.