Abstract Collection providers

To implement a collection provider, users need to provide the implementation of the interface listed below:

  • get_data

Class constructor

The collection_providers configuration provides a parameters dictionary with the key inital_params to supply necessary info when initialising the collection provider. Users can reference the full example here.

"initial_params":
                   {"host": "127.0.0.1",
                    "user": "user",
                    "password": "password",
                    "port": 9000,
                    "database": "DevelopmentTesting"}

Parameters for get_data

The pydggsapi creates collection provider objects at the beginning, and data sources that share the same provider will use the same object instance. Thus, in addition to the standard parameters of the interface get_data, pydggsapi will pass in a parameters dictionary getdata_params defined in the collections setting. The extra parameters provide flexibility for the get_data interface if needed.

"getdata_params":
                 { "table": "testing_suitability_IGEO7",
                   "zoneId_cols": {"9":"res_9_id", "8":"res_8_id", "7":"res_7_id", "6":"res_6_id", "5":"res_5_id"},
                   "data_cols" : ["modelled_fuel_stations","modelled_seashore","modelled_solar_wind"]
                 }

Implementations