Climate risk assessment and IFRS S2 compliance platform for Brazilian organizations, utilities and municipalities
Powered by OS-Climate open-source tools + custom AI extraction pipeline.
Week 5-6 Complete β Physical Risk Dashboard is live!
π― What's Working:
- β Backend API: Physical risk assessment for 10 Brazilian municipalities
- β Frontend Dashboard: React + TypeScript with advanced visualizations
- β Data Integration: INPE + Cemaden + INMET + Geographic Heuristics
- β 5 Hazard Types: Flood, Drought, Heat Stress, Landslide, Coastal Inundation
- β 3 Climate Scenarios: RCP 2.6, 4.5, 8.5
- β Temporal Projections: Current β 2030 β 2050
π Dashboard Features:
- StatsOverview (6 key risk metrics)
- RiskChart (temporal evolution line chart)
- ScenarioComparison (RCP scenario bar chart)
- RiskCard grid (individual hazard cards)
π Quick Demo: See Quick Start below to run locally in 5 minutes!
Enable Brazilian organizations to:
- Assess physical climate risks (floods, droughts, heat stress)
- Extract climate data from sustainability reports (AI-powered)
- Comply with Lei 14.904/2024, IFRS S2, and TSB taxonomy
- Report actionable insights for climate adaptation
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β Frontend (React + TypeScript) β
β π Municipal Dashboard β
β π Reports (Planned) β
β β’ Risk visualizations β’ Scenario comparison β’ Charts β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β REST API (FastAPI)
ββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
β Backend (FastAPI + Python) β
β βββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β β Extraction β β Risk Engine β β Compliance β β
β β (Hybrid) β
β β (physrisk) β
β β (Planned) β β
β βββββββββββββββ ββββββββββββββββ ββββββββββββββββ β
β INPE β’ Cemaden β’ INMET β’ IBGE β
ββββββββββββββββββββββββββββ¬βββββββββββββββββββββββββββββββββββ
β
ββββββββββββββββββββββββββββ΄βββββββββββββββββββββββββββββββββββ
β Data Layer (Trino + Iceberg + MinIO) β
β π¦ Documents β
β π Extractions β
β πΊοΈ Geospatial β
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Backend:
- FastAPI (async API framework)
- OS-Climate tools:
osc-transformer-based-extractor(BERT-based KPI extraction)physrisk-lib(physical climate risk modeling)
- OpenAI GPT (hybrid extraction)
- ChromaDB (RAG vector store)
- H3 geospatial indexing
Data Platform:
- Trino (distributed SQL)
- Apache Iceberg (table format)
- MinIO (S3-compatible storage)
- PostgreSQL (metadata)
Frontend:
- React 18 + TypeScript
- Vite (build tool with HMR)
- Axios (HTTP client)
- Recharts (data visualizations)
- Tailwind CSS (utility-first styling)
- Lucide React (icons)
- Python 3.11+
- Node.js 18+
- Docker + Docker Compose
- 8GB RAM minimum
git clone https://github.com/brunoccteixeira/PURPURA.git
cd PURPURA
# Create Python environment
python -m venv .venv
source .venv/bin/activate # or .venv\Scripts\activate on Windows
# Install dependencies
pip install -r requirements.txtcp .env.example .env
# Edit .env with your settings:
# - OPENAI_API_KEY (for LLM extraction)
# - Database credentials
# - Trino connection# Start MinIO, Hive, Trino
docker-compose up -d
# Wait for services to be healthy (~30 seconds)
docker-compose ps
# Create Iceberg tables
python scripts/create_iceberg_tables.pycd backend
uvicorn api.main:app --reload --port 8000
# API docs available at http://localhost:8000/docscd frontend
npm install
npm run dev
# Dashboard at http://localhost:3000
# Features:
# - 10 Brazilian municipalities (SΓ£o Paulo, Rio, Fortaleza, etc.)
# - 5 hazard types (flood, drought, heat stress, landslide, coastal inundation)
# - 3 RCP scenarios (2.6, 4.5, 8.5)
# - Temporal projections (Current β 2030 β 2050)
# - Advanced visualizations (charts, stats, scenario comparison)- CLAUDE.md β Developer guide for AI assistants
- docs/MVP_PLAN.md β 12-week implementation roadmap
- docs/API.md β API reference
- docs/OS_CLIMATE_INTEGRATION.md β OS-Climate tools usage
# Run all tests
pytest
# With coverage
pytest --cov=backend --cov-report=html
# Specific test suite
pytest backend/tests/test_extraction.py# 1. Ingest PDF to chunks
python scripts/ingest_pdf.py data/sample.pdf \
--out data/chunks.jsonl \
--doc-id sample_001
# 2. Extract KPIs (hybrid: transformer + LLM)
python scripts/extract_from_chunks.py data/chunks.jsonl \
--out data/extracted.jsonl \
--method hybrid
# 3. Publish to Trino
python scripts/publish_jsonl_to_trino.py data/chunks.jsonl
python scripts/publish_jsonl_to_trino.py data/extracted.jsonl-- View extracted KPIs
SELECT * FROM lake.ifrs.extract_results LIMIT 10;
-- Search by municipality
SELECT * FROM lake.ifrs.municipal_risks
WHERE ibge_code = '3550308'; -- SΓ£o PauloPΓRPURA leverages these open-source components:
| Component | Purpose | Status |
|---|---|---|
osc-transformer-presteps |
PDF β JSON conversion | β Integrated |
osc-transformer-based-extractor |
BERT KPI extraction | β Integrated |
physrisk-lib |
Climate risk calculations | β Integrated |
physrisk-ui |
Dashboard patterns | β Integrated |
| H3 geospatial indexing | Municipal risk mapping | β Integrated |
| Source | Purpose | Status |
|---|---|---|
| INPE (PCBr API) | Climate projections (temperature, precipitation) | β Integrated |
| Cemaden | Historical hazard frequency (floods, landslides) | β Mock data ready |
| INMET (BDMEP) | Climate normals (1961-2023), station catalog | β Mock data ready |
| IBGE | Municipality codes, population, coordinates | β Integrated |
License Compliance: All OS-Climate code is Apache 2.0 licensed. PΓRPURA maintains attribution and contributes improvements upstream.
- Name: PΓRPURA (purple in Portuguese, symbolizing innovation + sustainability)
- Target: Brazilian mid-market (municipalities 50-500k, regional utilities, SMEs)
- Language: 100% Portuguese (pt-BR)
- Differentiator: Partnership-first approach (Colab, Cemaden, TNC) + tropicalized models
- Data lakehouse infrastructure
- LLM extraction pipeline (OpenAI)
- FastAPI backend scaffold
- Transformer-based extraction integration
- Physical risk engine (physrisk + Brazilian data sources)
- Municipal dashboard UI (React + TypeScript)
- 2 pilot deployments
- TSB taxonomy classifier
- IFRS S2 reporting module
- Enterprise dashboard
- 10-15 customer deployments
- Agro module (AQUASENSE)
- Smart city monitoring (MONITOR)
- PIM-PAM tools (RMPT, CCS, PIA)
- 100+ municipalities, 20+ enterprises
- β 2 pilot customers deployed
- β 10+ documents processed end-to-end
- β <5min extraction time per document
- β >85% pilot user satisfaction
- β 1 Colab partnership MoU signed
We welcome contributions! Please see CONTRIBUTING.md.
Key areas:
- Brazilian climate data sources integration (Cemaden, INPE, ANA)
- IFRS S2 / TSB schema validation
- Portuguese NLP improvements
- Municipal dashboard UX
PΓRPURA Climate OS is licensed under the Apache License 2.0.
This project incorporates components from OS-Climate, also Apache 2.0 licensed.
- OS-Climate β Open-source climate tools foundation
- Cemaden β Brazilian climate monitoring data
- Linux Foundation / FINOS β Governance and community support
- Website: purpura.climate (coming soon)
- GitHub: github.com/brunoccteixeira/PURPURA
- Email: bruno@purpura.climate
Made with π£ in Brazil