HydroSwift ⚡¶
Fast, unified workflows for hydrological data.
HydroSwift is a Python toolkit for integrating, processing, and visualizing hydrological datasets at basin scale. It automates retrieval from India-WRIS and the CWC Flood Forecasting System while preserving reproducible CLI and notebook workflows.
Supported data sources¶
| Source | Variables |
|---|---|
| India-WRIS | Discharge, water level, rainfall, temperature, humidity, solar radiation, sediment, groundwater level, atmospheric pressure |
| CWC FFS | Water level |
How HydroSwift is organised¶
HydroSwift exposes two main interfaces:
- Python API via
import hydroswift - CLI via
hyswift ...orpython -m hydroswift ...
The Python API offers two styles:
- Explicit namespace downloads — use
hydroswift.wris.download(...)orhydroswift.cwc.download(...)when you already know the basin/station values. - Table-driven workflows — discover basins or stations first, then pass those tables into
hydroswift.fetch(...).
Quick start¶
Python¶
import hydroswift
stations = hydroswift.wris.stations(basin="Godavari", variable="discharge")
result = hydroswift.fetch(
stations,
start_date="2024-01-01",
end_date="2024-01-10",
merge=True,
)
CLI¶
Documentation¶
| Guide | Description |
|---|---|
| Python API Guide | Concepts, workflows, and examples |
| CLI Usage Guide | Supported CLI flags and common command patterns |
| API Functions Reference | Signatures, parameters, and return shapes |
| API ↔ CLI Map | Side-by-side notebook, Python, and CLI mapping |
Example notebooks¶
- Python API Examples — full end-to-end workflows
- CLI Examples —
hyswiftcommand demonstrations
Important usage rules¶
Note
- Use
hydroswift.wris.download(...)/hydroswift.cwc.download(...)for explicit values only (no DataFrames). - Use
hydroswift.fetch(table, ...)for tables fromhydroswift.wris.stations(...),hydroswift.cwc.stations(...), etc. - CWC downloads are water-level only.
Output model¶
Downloaded station files are saved under an output directory, then optionally:
- merged into GeoPackages with
merge=Trueorhydroswift.merge_only(...) - plotted with
plot=Trueorhydroswift.plot_only(...)
Post-processing helpers work from existing downloaded files without requiring basin/station arguments again.