- Introduction
- Features
- Overview
- Getting Started
- Making Requests
- OpenAPI & Client SDKs
- Swift Integration
- Considerations
- Related Projects
- Contributing
- License
flow-forecast is an experimental project aimed at forecasting the flow rate of rivers using historical data. Leveraging Facebook's Prophet library, the API provides valuable insights for kayakers, rafters, and river enthusiasts to plan their trips effectively.
This project is experimental and is subject to change. There is ample room for improvement. Contributions and suggestions are highly encouraged!
- ✅ Flow Rate Forecasting: Predict river flow rates based on historical data.
- ✅ Dockerized API: Simplify deployment with Docker.
- ✅ OpenAPI Documentation: Comprehensive API documentation for easy integration.
Using Prophet, the project analyzes historical river flow data to generate accurate forecasts. The primary goal is to assist outdoor enthusiasts in anticipating river conditions, enhancing safety and planning for their adventures.
Before you begin, ensure you have the following installed:
- Python 3.12: Download Python
- Poetry: A dependency management and packaging tool for Python.
- Node.js: Required for generating client SDKs.
Follow these steps to set up the development environment:
-
Clone the Repository
git clone https://github.com/drewalth/flow-forecast.git cd flow-forecast
-
Install Dependencies
poetry install
-
Run the Application
poetry run start
-
Make a Test Request
curl -X GET "http://127.0.0.1:8000/forecast?site_id=09359500"
Docker simplifies the setup/deployment process. Here's how to build and run the application using Docker:
-
Build the Docker Image
docker build -t flow-forecast .
-
Run the Docker Container
docker run -p 8000:8000 flow-forecast
Alternatively, use Docker Compose:
docker compose up
-
Make a Test Request
curl -X GET "http://127.0.0.1:8000/usgs/forecast?site_id=09359500"
To interact with the API, provide a site_id
as a query parameter. This ID corresponds to a specific USGS monitoring station.
-
Find a Site ID: Search for rivers on the USGS website to obtain the
site_id
. -
Example: The site ID
09359500
corresponds to the Animas River at Tall Timber Resort Above Tacoma, CO.
The API is documented using OpenAPI. Use the provided OpenAPI Specification to generate client SDKs in various languages.
Ensure you have Node.js and npm installed, then run:
npm install
Generate all client SDKs:
make generate_clients
- Data Source: Utilizes publicly available data from USGS.
- Data Limitations: The model currently doesn't account for factors like weather, temperature, snowpack, or dam releases, which can influence river flow rates.
- wh2o-vue: The official JS frontend for American Whitewater.
- aw-ios: The official iOS app for American Whitewater.
- aw-android: The official Android app for American Whitewater.
- FlowKit: A Swift package for working with flow data from USGS, Canadian Hydrometric Data, and other sources.
- GaugeWatcher: An iOS app for tracking river flow rates in North America and New Zealand.
We welcome contributions and suggestions! To get started:
- Fork the Repository
- Create a Feature Branch
git checkout -b feature/YourFeature
- Commit Your Changes
git commit -m "Add your message"
- Push to the Branch
git push origin feature/YourFeature
- Open a Pull Request
Please ensure your code adheres to the project's coding standards and all tests pass. For detailed guidelines, refer to the CONTRIBUTING.md file.
This project is licensed under the MIT License. See the LICENSE file for details.