JuliaDataReaders / DataReaders.jl

A Julia library to get remote data via Requests.jl and get DataFrame (from DataFrames.jl) or TimeArray (from TimeSeries.jl)
MIT License
10 stars 7 forks source link

Register DataReader(s) #7

Closed femtotrader closed 7 years ago

femtotrader commented 8 years ago
    function DataReader(s_source::ASCIIString; retry_count=3, pause=0.1, timeout=30)
        s_source = lowercase(s_source)
        if s_source in ["google", "google-daily"] then
            DataReaderGoogleDaily(retry_count, pause, timeout)
        elseif s_source == "google-quotes" then
            DataReaderGoogleQuotes(retry_count, pause, timeout)
        elseif s_source in ["yahoo", "yahoo-daily"] then
            DataReaderYahooDaily(retry_count, pause, timeout)
        else
            error("'$s_source' is not an allowed data source")
        end
    end

is quite uggly...

a function to register (in an OrderedDict) might be better.

DataSource function will simply be a lookup table

Moreover it will be possible to give a list of available data sources