babao.inputs package¶
Submodules¶
babao.inputs.inputBase module¶
Base class for any input
-
class
babao.inputs.inputBase.
ABCInput
[source]¶ Bases:
abc.ABC
Base class for any input
Your subclass should at least implement: * fetch : self -> DataFrame * raw_columns : List[str]
And eventually: (if you want self.resample to works) * _resample : self -> DataFrame -> DataFrame * fillMissing : self -> DataFrame -> DataFrame * resampled_columns : List[str]
(cf. specific method doc-string in this class)
-
cache
(fresh_data=None, since=None, till=None)[source]¶ Save some data to cache
If ´fresh_data´ is given, append it to cache, otherwise read in database from ´since´ to ´till´ and cache it
-
fetch
()[source]¶ Return a time-serie DataFrame fetched from the internets
This data will be stored on database for later use (and eventual resampling). Data can be continuous. Index must be nanosecond timestamps.
-
raw_columns
¶ The columns names of your raw data (as fetched and stored in database)
-
resample
(raw_data)[source]¶ Return the DataFrame ´raw_data´ as a continuous time-serie
This is a wrapper around _resample and fillMissing
-
resampled_columns
¶ The columns names of your resampled data (from raw data)
-
babao.inputs.inputManager module¶
Common interface to inputs to call methods on all of them at once
-
babao.inputs.inputManager.
fetchInputs
()[source]¶ Fetch all the INPUTS in a pool thread
The raw data resulting is then wrote to database.
-
babao.inputs.inputManager.
readInputs
(input_list: Optional[List[babao.inputs.inputBase.ABCInput]] = None, since=None)[source]¶ Read all INPUTS from ´since´ and resample them with matching time base
The return is one dataframe containing all concatened columns (so they will be renamed with the input name as prefix
babao.inputs.krakenInputBase module¶
This module define the base class and methods for kraken inputs
-
class
babao.inputs.krakenInputBase.
ABCKrakenInput
[source]¶ Bases:
babao.inputs.inputBase.ABCInput
Base class for any kraken input