Skip to main content

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.

License Python Platform Documentation PyPI

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 Project

# Open a HEC-RAS project
model = Project("path/to/project.prj")
print(model.version)       # e.g. "6.30"

# Switch plans
model.set_plan(title="Base Condition")
model.set_plan(short_id="BC")
model.set_plan(index=0)

# Run model
model.run(hide_window=False)

# Read HDF results
area = model.results.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/
├── controller/  # COM interface to run/control HEC-RAS
├── model/       # Project — 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rivia-0.2.0.tar.gz (395.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

rivia-0.2.0-py3-none-any.whl (287.6 kB view details)

Uploaded Python 3

File details

Details for the file rivia-0.2.0.tar.gz.

File metadata

  • Download URL: rivia-0.2.0.tar.gz
  • Upload date:
  • Size: 395.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for rivia-0.2.0.tar.gz
Algorithm Hash digest
SHA256 27523b82f0c95eea954a23be248ef1eafe540cfcddc88be395fe6bf52af70968
MD5 41ed09bb0de1a7ca5b50d86b3299a793
BLAKE2b-256 e80ee7fb93db7c22dd4af817811752d1f8e6e935e04cc5c1649fdb9693fb9861

See more details on using hashes here.

File details

Details for the file rivia-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: rivia-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 287.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.14

File hashes

Hashes for rivia-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d16c1e3802f3c55afd265f0817fcc85e15e5ad219bee9c0e90afb9d459eb63bc
MD5 c7df7983b3cfd80cbc52cc6ab5a9f633
BLAKE2b-256 d4b3fbad92c31de3771a0e40faa4740eb7e7edeea1746dc67f309598e2a88c11

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page