Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ API Reference
fetchers/czech
fetchers/france
fetchers/germany_berlin
fetchers/italy_toscany
fetchers/japan
fetchers/lithuania
fetchers/norway
Expand All @@ -25,4 +26,4 @@ API Reference
fetchers/spain
fetchers/uk_ea
fetchers/uk_nrfa
fetchers/usa
fetchers/usa
5 changes: 5 additions & 0 deletions docs/fetchers/italy_toscany.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Italy Toscany Fetcher
=====================

.. automodule:: rivretrieve.italy_toscany
:members:
36 changes: 36 additions & 0 deletions examples/test_italy_toscany_fetcher.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import logging

import matplotlib.pyplot as plt

from rivretrieve import ItalyToscanyFetcher, constants

logging.basicConfig(level=logging.INFO)

gauge_id = "TOS02004365"
variables = [
constants.DISCHARGE_DAILY_MEAN,
constants.STAGE_DAILY_MEAN,
]
start_date = "2025-01-01"
end_date = "2025-01-07"

fetcher = ItalyToscanyFetcher()

for variable in variables:
data = fetcher.get_data(gauge_id=gauge_id, variable=variable, start_date=start_date, end_date=end_date)
if data.empty:
print(f"No data found for {gauge_id} ({variable})")
continue

print(data.head())
plt.figure(figsize=(12, 6))
plt.plot(data.index, data[variable], label=f"{gauge_id} - {variable}")
plt.xlabel(constants.TIME_INDEX)
plt.ylabel(variable)
plt.title(f"Italy-Toscany River Data ({gauge_id})")
plt.legend()
plt.grid(True)
plt.tight_layout()
plot_path = f"italy_toscany_{variable}_plot.png"
plt.savefig(plot_path)
print(f"Plot saved to {plot_path}")
1 change: 1 addition & 0 deletions rivretrieve/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .czech import CzechFetcher
from .france import FranceFetcher
from .germany_berlin import GermanyBerlinFetcher
from .italy_toscany import ItalyToscanyFetcher
from .japan import JapanFetcher
from .lithuania import LithuaniaFetcher
from .norway import NorwayFetcher
Expand Down
192 changes: 192 additions & 0 deletions rivretrieve/cached_site_data/italy_toscany_sites.csv

Large diffs are not rendered by default.

Loading
Loading