This profiler provides access to ecosystem-level risk assessment based on the 2018 National Biodiversity Assessment (NBA) data from SANBI. It analyses, ecosystem level threat status, habitat transformation risk, and biodiversity vulnerability across South African biomes.
# SANBI Ecosystem Risk Profiler
A Streamlit web application for ecosystem-level risk assessment based on the **2018 National Biodiversity Assessment (NBA)** data from the South African National Biodiversity Institute (SANBI). It analyses ecosystem threat status, habitat transformation risk, and biodiversity vulnerability across South Africa's 10 biomes.
---
## Features
- **Overview Dashboard** — national-level risk summary with threat level metrics (CR/EN/VU/NT/LC) and biome-wide charts
- **Biome Explorer** — interactive three-level filtering (Biome → Bioregion → Ecosystem) with trend analysis and comparison against national averages
- **Risk Categories** — deep dive into four risk factors: habitat transformation, biodiversity threat status, vegetation vulnerability, and protection gaps
---
## Tech Stack
| Layer | Technology |
|---|---|
| Web framework | Streamlit ≥ 1.28 |
| Visualisation | Plotly, Altair, Folium, Matplotlib, Seaborn |
| Database | PostgreSQL + PostGIS |
| ORM / DB adapter | SQLAlchemy ≥ 2.0, psycopg2 |
| Geospatial | GeoPandas ≥ 0.14, Shapely ≥ 2.0 |
| Data | pandas ≥ 2.1, NumPy, SciPy |
| Config | python-dotenv, Pydantic ≥ 2.0 |
| Runtime | Python 3.12, Docker |
---
## Prerequisites
- Python 3.12+
- PostgreSQL with PostGIS extension (NBA 2018 data loaded)
- Docker & Docker Compose (for containerised setup)
---
## Local Setup (without Docker)
```bash
# 1. Clone the repository
git clone
github.com
cd sanbi-ecosystem-risk-atlas
# 2. Create and activate a virtual environment
python -m venv venv
source venv/bin/activate # Windows: venv\Scripts\activate
# 3. Install dependencies
pip install -r requirements.txt
# 4. Configure environment variables
cp .env.example .env
# Edit .env with your database credentials (see Environment Variables below)
# 5. (Optional) Test the database connection
python scripts/test_database.py
# 6. Run the app
streamlit run main.py
```
App will be available …