pyhoo.requester.Requester.request

Here are the examples of the python api pyhoo.requester.Requester.request taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

1 Examples 7

0 Source : __init__.py
with MIT License
from prouhard

def get(
    endpoint: Endpoint,
    tickers: Union[str, Iterable[str]],
    max_concurrent_calls: int = 100,
    ignore_errors: bool = False,
    **params: Any,
) -> pd.DataFrame:
    if not _is_iterable(tickers):
        tickers = [cast(str, tickers)]
    endpoint_config = endpoints_config[endpoint]
    endpoint_config.validate(params)
    responses = asyncio.run(
        Requester(
            path=endpoint_config.path,
            tickers=tickers,
            max_concurrent_calls=max_concurrent_calls,
            **endpoint_config.format(params),
        ).request()
    )
    return _convert_to_dataframe(
        responses=responses,
        response_field=endpoint_config.response_field,
        parser=endpoint_config.parser,
        ignore_errors=ignore_errors,
    )


def _is_iterable(obj: Any) -> bool: