nbiatoolkit.utils.parsers
Functions
|
Cleans the given HTML string by removing HTML tags and replacing special characters. |
|
Convert milliseconds to a formatted date string. |
|
Converts the input date to the desired format. |
|
Response will be either JSON or bytes |
Module Contents
- nbiatoolkit.utils.parsers.clean_html(html_string: str) str[source]
Cleans the given HTML string by removing HTML tags and replacing special characters.
- Parameters:
html_string (str) – The input HTML string to be cleaned.
- Returns:
The cleaned text content without HTML tags and special characters.
- Return type:
str
- nbiatoolkit.utils.parsers.convertMillis(millis: int) str[source]
Convert milliseconds to a formatted date string.
- Parameters:
millis (int) – The number of milliseconds to convert.
- Returns:
The formatted date string in the format ‘YYYY-MM-DD’.
- Return type:
str
- Raises:
AssertionError – If the input is not an integer.
- nbiatoolkit.utils.parsers.convertDateFormat(input_date: str | datetime.datetime, format: str = '%Y/%m/%d') str[source]
Converts the input date to the desired format.
- Parameters:
input_date (str) – The date to be converted.
- Returns:
The converted date in the format “YYYY/MM/DD”.
- Return type:
str
- Raises:
ValueError – If the input date has an invalid format.