C++ Listing Datasets Available from Liberator

Result datasets(const std::map<std::string, Arg> &args);

The datasets function returns a list of all datasets currently available in Liberator. It takes a std::map of key std::string paired with value Arg. In this case, Arg represents a boolean in the following std::variant.

      

using Arg = std::variant<     std::monostate,
                       bool,
                       int64_t,
                       double,
                       std::string,
                       std::vector<std::string>,
                       std::ostream* >;

The “Result” return value represents the following std::variant. The result from the datasets function represents a rapidjson::document.

using Result = std::variant<std::shared_ptr<rapidjson::Document>, Func>;

          

Argument

Description

Type

Example

details

Include details about each dataset

Boolean

{“details”,true}

schema

Include schema of each dataset

Boolean

{“schema",true}

user

The user identifier (as assigned by CloudQuant)

std::string

{“user”,”myUserID”}

token

The user’s assigned token

std::string

{“token”,”mypersonal-private-token”}

entitled

Only retrieve entitled datasets

Boolean

{“entitled”,true}

Example Get Datasets

Liberator liberator;
auto ptr = liberator.datasets({});
auto json = *std::get_if<0>(&ptr);
if(json)
{
      rapidjson::StringBuffer buf;
      rapidjson::Writer<rapidjson::StringBuffer> writer(buf);
      json->Accept(writer);
      std::cout << buf.GetString() << std::endl;
}

Output

{ 'Intraday': ['SSR_Forward_DSI', 'Halt_Production_DSI', 'SSR_Production_DSI', 'News', 'Twitter', 'Stocktwits', 'Halt_Forward_DSI'], 'Monthly': ['Joblink Ticker Mapping', 'VerticalKnowledge Indeed'], 'Tesseract',

...

'Market Data': [ 'daily_bars', 'minute_bars', 'nbbo', 'trades', 'daily_bars_adjusted’]}

 

To retrieve a list of your entitled datasets simply change liberator.datasets({}) to liberator.datasets({ {"entitled",true} }).