A modern Python interface for HEC-RAS Visualization, Information, and Automation
Project description
RIVIA
RAS Interface for Visualization, Information, and Automation
A modern, modular Python library for interacting with HEC-RAS hydraulic modeling software.
Documentation
Full documentation is available at rivia.readthedocs.io.
Overview
rivia provides a clean, Pythonic interface for working with HEC-RAS projects:
- Control HEC-RAS via COM automation — open projects, switch plans, run simulations
- Read and write HEC-RAS text input files (
.prj,.g*,.p*,.f*,.u*) - Access HDF5 results — water surface, velocity, depth, and other outputs
- Export rasters — pixel-perfect RASMapper-equivalent rasters (WSE, depth, velocity, etc.)
- Export terrain — mosaic and modify terrain from HEC-RAS terrain HDF files
Requirements
- Windows — HEC-RAS is Windows-only
- Python 3.10+
- HEC-RAS 5.x or later installed
Installation
pip install rivia
With geospatial extras (required for raster export):
pip install rivia[geo]
Quick Example
from rivia.model import Model
# Open a HEC-RAS project
model = Model("path/to/project.prj")
print(model.version) # e.g. "6.30"
# Switch plans
model.change_plan(title="Base Condition")
model.change_plan(short_id="BC")
model.change_plan(index=0)
# Read HDF results
area = model.hdf.flow_areas["Perimeter 1"]
wse_max = area.max_water_surface
# Export a WSE raster
vrt = model.export_wse(timestep=None, render_mode="sloping")
print(vrt.path)
Package Structure
rivia/
├── com/ # COM interface to run/control HEC-RAS
├── model/ # Model - primary project interface; read/write text input files, read HDF results
├── hdf/ # Read HEC-RAS HDF5 geometry and result files
├── geo/ # Geospatial operations: raster export (geopandas/rasterio)
└── utils/ # Shared helpers
Development
git clone https://github.com/gyanz/rivia.git
cd rivia
pip install -e ".[dev,geo,docs]"
# Run tests
pytest tests/ -x --tb=short
# Lint
ruff check src/
# Type check
mypy src/rivia
# Build docs
sphinx-build -b html docs docs/_build/html
License
Copyright 2025 Gyan Basyal and WEST Consultants, Inc.
Licensed under the Apache License, Version 2.0.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rivia-0.1.0.tar.gz.
File metadata
- Download URL: rivia-0.1.0.tar.gz
- Upload date:
- Size: 343.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d3a900d3026874e88c8147e9426dfa9eda89516b71693af79c0803ca18770f70
|
|
| MD5 |
40e22b3d0d3a87435dea7cd639ae6c35
|
|
| BLAKE2b-256 |
75fb587e4d2cdbd51730ac40cd921db10152b64d068112649dc09ead32fe4881
|
File details
Details for the file rivia-0.1.0-py3-none-any.whl.
File metadata
- Download URL: rivia-0.1.0-py3-none-any.whl
- Upload date:
- Size: 234.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
989c66f710dd04185e89ab0f603e3e269924ff129a33a184e8a32bb74b6b94b9
|
|
| MD5 |
b6e24db67c3f60f21555095ee38c3712
|
|
| BLAKE2b-256 |
6d3526263708189440db2d714f3edc4b72e28a9ad86e4ef2854ac9e9590f4580
|