Functions¶
src.utils.hexapi.hexproof_request_wrapper(logr: Any = None) -> Callable
¶
Wrapper for a Hexproof.io request function to handle retries, rate limits, and a final exception catch.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
logr
|
Any
|
Logger object to output any exception messages. |
None
|
Returns:
| Type | Description |
|---|---|
Callable
|
Wrapped function. |
Source code in src\utils\hexapi.py
src.utils.hexapi.get_api_key(key: str) -> str
¶
Get an API key from https://api.hexproof.io.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
key
|
str
|
Name of the API key. |
required |
Returns:
| Type | Description |
|---|---|
str
|
API key string. |
Source code in src\utils\hexapi.py
src.utils.hexapi.get_metadata() -> dict[str, Hexproof.Meta]
¶
Return a manifest of all resource metadata.
Returns:
| Type | Description |
|---|---|
dict[str, Meta]
|
dict[str, Hexproof.Meta]: A dictionary containing every resource metadata, with resource name as key. |
Source code in src\utils\hexapi.py
src.utils.hexapi.get_sets() -> dict
¶
Retrieve the current 'Set' data manifest from https://api.hexproof.io.
Returns:
| Type | Description |
|---|---|
dict
|
Data loaded from the 'Set' data manifest. |
Source code in src\utils\hexapi.py
src.utils.hexapi.process_data_sets(data: dict) -> dict[str, HexproofSet]
¶
Process bulk 'Set' data retrieved from the Hexproof API into a smaller dataset.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
dict
|
Raw data pulled from the |
required |
Returns:
| Type | Description |
|---|---|
dict[str, HexproofSet]
|
Dictionary of smaller 'HexproofSet' data entries. |
Source code in src\utils\hexapi.py
src.utils.hexapi.update_hexproof_cache() -> tuple[bool, Optional[str]]
¶
Check for a hexproof.io data update.
Returns:
| Name | Type | Description |
|---|---|---|
tuple |
tuple[bool, str | None]
|
A tuple containing the boolean success state of the update, and a string message explaining the error if one occurred. |
Source code in src\utils\hexapi.py
src.utils.hexapi.get_set_data(code: str) -> dict
¶
src.utils.hexapi.get_watermark_svg_from_set(code: str) -> Optional[Path]
¶
Look for a watermark SVG in the 'Set' symbol catalog.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
code
|
str
|
Set code to look for. |
required |
Returns:
| Type | Description |
|---|---|
Path | None
|
Path to a watermark SVG file if found, otherwise None. |
Source code in src\utils\hexapi.py
src.utils.hexapi.get_watermark_svg(wm: str) -> Optional[Path]
¶
Look for a watermark SVG in the watermark symbol catalog. If not found, look for a 'set' watermark.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
wm
|
str
|
Watermark name to look for. |
required |
Returns:
| Type | Description |
|---|---|
Path | None
|
Path to a watermark SVG file if found, otherwise None. |