diff --git a/src/statbank/apidata.py b/src/statbank/apidata.py index 37fae5f..79175ff 100644 --- a/src/statbank/apidata.py +++ b/src/statbank/apidata.py @@ -35,6 +35,9 @@ def apidata( Returns: pd.DataFrame: The table-content + + Raises: + ValueError: If the first parameter is not recognized as a statbank ID or a direct url. """ if payload is None: payload_now: QueryWholeType = { @@ -102,6 +105,9 @@ def apidata_query_all(id_or_url: str = "") -> QueryWholeType: Returns: QueryWholeType: The prepared query based on all the codes in the table. + + Raises: + ValueError: If the parameter is not a valid statbank ID or a direct url. """ if len(id_or_url) == STATBANK_TABLE_ID_LENGTH and id_or_url.isdigit(): url = f"https://data.ssb.no/api/v0/no/table/{id_or_url}/" diff --git a/src/statbank/transfer.py b/src/statbank/transfer.py index 477a497..b3907b9 100644 --- a/src/statbank/transfer.py +++ b/src/statbank/transfer.py @@ -136,6 +136,9 @@ def transfer(self, headers: dict[str, str] | None = None) -> None: Args: headers (dict[str, str] | None): Mostly for internal use by the package. Needs to be a finished compiled headers for a request including Authorization. + + Raises: + ValueError: If the transfer is already transferred. """ # In case transfer has already happened, dont transfer again if self.oppdragsnummer: