ghnova.utils
utils
Utility functions for the ghnova package.
Functions
ghnova.utils.get_version_information
ghnova.utils.setup_logger
setup_logger(outdir: str = '.', label: str | None = None, log_level: str | int = 'INFO', print_version: bool = False) -> None
Set up logging output: call at the start of the script to use.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
outdir
|
str
|
Output directory for log file. |
'.'
|
label
|
str | None
|
Label for log file name. If None, no log file is created. |
None
|
log_level
|
str | int
|
Logging level as string or integer. |
'INFO'
|
print_version
|
bool
|
Whether to print version information to the log. |
False
|
Source code in src/ghnova/utils/log.py
ghnova.utils.process_async_response_with_last_modified
async
process_async_response_with_last_modified(response: ClientResponse) -> tuple[dict[str, Any] | list[dict[str, Any]], int, str | None, str | None]
Process an asynchronous HTTP response and extract data, status, ETag, and Last-Modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
ClientResponse
|
The asynchronous HTTP response object. |
required |
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any] | list[dict[str, Any]], int, str | None, str | None]
|
A tuple containing the response data, status code, ETag, and Last-Modified. |
Source code in src/ghnova/utils/response.py
ghnova.utils.process_response_with_last_modified
process_response_with_last_modified(response: Response) -> tuple[dict[str, Any] | list[dict[str, Any]], int, str | None, str | None]
Process an HTTP response and extract data, status, ETag, and Last-Modified.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
response
|
Response
|
The HTTP response object. |
required |
Returns:
| Type | Description |
|---|---|
tuple[dict[str, Any] | list[dict[str, Any]], int, str | None, str | None]
|
A tuple containing the response data, status code, ETag, and Last-Modified. |