GUIDES

Keep your interface. Import the same engine that powers Open Sustainability Analyst. Analyze one report for a topic, then feed grounded answers — with evidence and gaps — into the rest of your workflow.

Build your own sustainability tool on the report-analyst library

· 1 min read

Build your own sustainability tool on the report-analyst library

The point

Teams often want their procurement or risk screen — not another Streamlit chrome — while still needing answers that cite the report. Open Sustainability Analyst (OSA) already did both jobs in the codebase; we are documenting and demoing the library path explicitly.

Companion OSA guide: Build with the report-analyst library (local preview: /osa/en/build-with-report-analyst-library).

What you import

from report_analyst.core.library import analyze_report, build_topic_brief

answers = await analyze_report("supplier-report.pdf", "tcfd")
brief = build_topic_brief(answers, topic="TCFD overview")

Each answer carries answer, score, evidence, gaps, and sources. Pass a built-in set id or a path to your own *_questions.yaml.

Demo: one report, one topic, then use the data

examples/grounded_topic_brief/ is a small FastAPI host app (not the OSA Streamlit UI) that:

  1. Accepts one PDF upload in a custom page
  2. Runs a three-question water-risk set via the library
  3. Shows evidence-backed answers
  4. Exposes a structured brief at GET /brief for a second screen or API client

Swap the YAML to change the topic without rewriting the host UI.

When to use Streamlit vs library vs API

NeedPath
Analysts run frameworks out of the boxStreamlit app (Render / Streamlit Cloud guides on OSA)
Your Python product owns the UIreport_analyst.core.library
Separate frontend / microservicesreport_analyst_api/

Repo

climateandtech/report-analyst — README section Standalone tool and library.