Skip to content

Commit d11b25b

Browse files
authored
Adding class method for metadata download (#37)
* Extend base class for metadata method * Reformat
1 parent 1a183c9 commit d11b25b

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

rivretrieve/base.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,17 @@ def get_gauge_ids() -> pd.DataFrame:
4444
"""
4545
pass
4646

47+
def get_metadata(self) -> pd.DataFrame:
48+
"""Fetches site metadata for the given site.
49+
50+
Returns:
51+
A pandas DataFrame indexed by gauge_id, containing site metadata.
52+
Returns an empty DataFrame if metadata fetching is not supported for this fetcher.
53+
"""
54+
# Default implementation returns an empty DataFrame.
55+
# Subclasses should override this method if metadata is available.
56+
return pd.DataFrame().set_index("gauge_id")
57+
4758
@staticmethod
4859
@abc.abstractmethod
4960
def get_available_variables() -> tuple[str, ...]:

0 commit comments

Comments
 (0)