A local-hosted backend service that bridges Sumo data into ResInsight (and other local clients) over a small FastAPI HTTP API.
The FastAPI application under ri_cloud_api/primary/:
- Route definitions (HTTP endpoints) under
primary/routers—explore,timeseries,surfaces,polygons,gridsandparameters - Application setup and configuration
- Serves as the entry point for the backend
The Pydantic models defining the request/response contracts live alongside each
router in primary/routers/<area>/schemas.py.
Reusable packages used across the application, located under libs/. Each is its own
uv workspace member with its
own pyproject.toml:
-
ri_cloud_services(libs/services/src/ri_cloud_services) — the service layer, responsible for:- Accessing data from Sumo via
fmu-sumo(seesumo_access/) - Assembling and transforming data
- Isolating business logic from the API layer
- Accessing data from Sumo via
-
ri_cloud_core_utils(libs/core_utils/src/ri_cloud_core_utils) — general-purpose utilities:- Lightweight helpers with minimal external dependencies
- Does not depend on framework or service-layer code
Dependency direction:
ri_cloud_api → ri_cloud_services → ri_cloud_core_utils
Dependencies are managed with uv and defined in
pyproject.toml. From the repository root:
# 1. Install uv (see https://docs.astral.sh/uv/getting-started/installation/)
# 2. Install the project and its dependencies (creates .venv automatically)
uv syncThe first uv sync generates uv.lock; commit that file.
Start the API with uvicorn from the repository root:
uv run uvicorn ri_cloud_api.primary.main:app --host 0.0.0.0 --port 8000 --reloadInteractive API documentation is then available at:
- Swagger UI: http://localhost:8000/docs
- ReDoc: http://localhost:8000/redoc
RI_CLOUD_API_SUMO_ENV- Sumo environment to connect to (defaults toprod).