1. Support Center
  2. Liberator Python User's Guide & Recipes

Liberator Query parameters (FAQ-p9)

Summary of different Liberator Query combinations

Here we will list the main parameters you will want to pass to Liberator and the results you can expect when you drop any of those main parameters..

  • name - name of the dataset (use liberator.datasets(entitled = True)to get a list of all datasets available to you). You MUST provided this parameter.
  • symbols - single symbol/key, or a list of symbols/keys ie [‘AAPL’,’GOOG’,’MSFT’] in Python. If you do not pass this parameter or pass None you will receive ALL symbols/keys.
  • back_to = start date of your data
  • as_of = end date of your data. See “What are Point In Time datasets” above.
  • fields = for a large dataset you can use fields to list just the columns you require. There will always be some default columns that will be returned for each dataset but this can significantly reduce download times if you have a limited connection. Defaults to ALL. See “What if I don’t want all the columns?”
  • stats = set to ‘Total’ and rather than your query result, you will receive a count per symbol for the query submitted. Defaults to None.

All main parameters passed…

df = liberator.get_dataframe(liberator.query( name = 'daily_bars', as_of ='2024-07-24', back_to = '2024-07-16', symbols = ['AAPL','GOOGL']))

 

This has all 4 main parameters and returns exactly what you would expect.

faq-p9-i1

Drop ‘symbols’

df = liberator.get_dataframe(liberator.query( name = 'daily_bars', as_of ='2024-07-24', back_to = '2024-07-16'))

Here we have dropped symbols and so will get ALL symbols (defaults to None which means ALL symbols).

faq-p9-i2

Drop ‘as_of’

df = liberator.get_dataframe(liberator.query( name = 'daily_bars', back_to = '2024-07-22'))

Dropping as_of defaults it to NOW so this will return ALL symbols from NOW back to the back_to date.

faq-p9-i3

Drop ’back_to’

df = liberator.get_dataframe(liberator.query( name = 'daily_bars', as_of = '2023-12-25'))

 

Dropping back_to means the query will look for the most recent data per symbol requested, as we have no symbols it defaults to None so we get the most recent values for all symbols as of Dec 25th 2023. Note that the query will only look back so far, this amount will depend upon the density of the dataset. A quotes and trades query may look back a few hours for each symbol, a daily dataset may look back a week or a month.

faq-p9-i4

Drop ALL except dataset name

df = liberator.get_dataframe(liberator.query( name = 'daily_bars'))

 

There is only one REQUIRED parameter and that is the name of the dataset, obviously! If you pass only the name of the dataset you will get ALL symbols (because symbols will default to None), Because you dropped as_of it will default to NOW and with no back_to liberator will return the latest data point. 

So you will get the absolute latest data point for each symbol in the dataset!

faq-p9-i5