Downloaders

Utilities to get data in bulk

calcbench.downloaders.iterate_and_save_pandas(arguments, f, file_name)

Apply arguments to a function that returns a DataFrame and save to a file.

Usage:

>>> %pip install calcbench-api-client[Pandas,Backoff,tqdm]
>>> from calcbench.downloaders import iterate_and_save_pandas
>>> import calcbench as cb
>>> tickers = cb.tickers(entire_universe=True)
>>> iterate_and_save_pandas(
>>>    tickers,
>>>    lambda ticker: cb.point_in_time(
>>>        all_face=True,
>>>        all_footnotes=False,
>>>        company_identifiers=[ticker],
>>>        all_history=True,
>>>        include_preliminary=True,
>>>        include_xbrl=True,
>>>    ),
>>>    "fact_points.csv",
>>> )