Skip to main content

sources.helpers.rest_client.detector

single_entity_path

def single_entity_path(path: str) -> bool

[view_source]

Checks if path ends with path param indicating that single object is returned

find_all_lists

def find_all_lists(
dict_: Dict[str, Any],
path: Tuple[str, ...] = (),
result: List[Tuple[Tuple[str, ...], List[Any]]] = None
) -> List[Tuple[Tuple[str, ...], List[Any]]]

[view_source]

Recursively looks for lists in dict_ and returns tuples in format (dictionary keys, list)

find_response_page_data

def find_response_page_data(
response: Union[Dict[str, Any], List[Any], Any]
) -> Tuple[Tuple[str, ...], Any]

[view_source]

Finds a path to response data, assuming that data is a list, returns a tuple(path, data)

single_page_detector

def single_page_detector(
response: Response) -> Tuple[SinglePagePaginator, float]

[view_source]

This is our fallback paginator, also for results that are single entities

PaginatorFactory Objects

class PaginatorFactory()

[view_source]

__init__

def __init__(detectors: List[Callable[[Response], Tuple[BasePaginator,
float]]] = None)

[view_source]

detectors are functions taking Response as input and returning paginator instance and detection score. Score value: 1.0 - perfect detection 0.0 - fallback detection in between - partial detection, several paginator parameters are defaults

This demo works on codespaces. Codespaces is a development environment available for free to anyone with a Github account. You'll be asked to fork the demo repository and from there the README guides you with further steps.
The demo uses the Continue VSCode extension.

Off to codespaces!

DHelp

Ask a question

Welcome to "Codex Central", your next-gen help center, driven by OpenAI's GPT-4 model. It's more than just a forum or a FAQ hub – it's a dynamic knowledge base where coders can find AI-assisted solutions to their pressing problems. With GPT-4's powerful comprehension and predictive abilities, Codex Central provides instantaneous issue resolution, insightful debugging, and personalized guidance. Get your code running smoothly with the unparalleled support at Codex Central - coding help reimagined with AI prowess.