twitchAPI.helper¶
Helper functions
- twitchAPI.helper.extract_uuid_str_from_url(url: str) → Optional[str]¶
Extracts a UUID string from a URL
- twitchAPI.helper.build_url(url: str, params: dict, remove_none=False, split_lists=False, enum_value=True) → str¶
Build a valid url string
- Parameters
url – base URL
params – dictionary of URL parameter
remove_none (bool) – if set all params that have a None value get removed
Default:False
split_lists (bool) – if set all params that are a list will be split over multiple url parameter with the same name
Default:False
enum_value (bool) – if true, automatically get value string from Enum values
Default:True
- Returns
URL
- Return type
- async twitchAPI.helper.get_json(request: aiohttp.web_request.Request) → Optional[Union[list, dict]]¶
Tries to retrieve the json object from the body
- Parameters
request – the request
- Returns
the object in the body or None
- twitchAPI.helper.make_fields_datetime(data: Union[dict, list], fields: List[str])¶
Itterates over dict or list recursivly to replace string fields with datetime
- twitchAPI.helper.build_scope(scopes: List[twitchAPI.types.AuthScope]) → str¶
Builds a valid scope string from list