コード例 #1
0
class EntsoeClient:
    def __init__(self, token):
        self.client = EntsoePandasClient(api_key=token)

    def get_unavailability_production(self, country_code, start_date,
                                      end_date):
        """
        Get unavailability of production units (whatever that is)
        :param country_code: iso code of country
        :param start_date: epoch time of start in ms
        :param end_date: epoch time of end in ms
        :return: pandas dataframe with the requested data
        """
        start_date = pd.Timestamp(start_date, unit="ms", tz="CET")
        end_date = pd.Timestamp(end_date, unit="ms", tz="CET")

        return self.client.query_unavailability_of_production_units(
            country_code.upper(), start=start_date, end=end_date)

    def get_cross_border_flow(self, country_from, country_to, start_date,
                              end_date):
        start_date = pd.Timestamp(start_date, unit="ms", tz="CET")
        end_date = pd.Timestamp(end_date, unit="ms", tz="CET")

        return self.client.query_crossborder_flows(
            country_code_from=country_from.upper(),
            country_code_to=country_to.upper(),
            start=start_date,
            end=end_date)

    def get_forecasted_transfer(self, country_from, country_to, start_date,
                                end_date):
        """
        Net capacity transfer for the day ahead between the 2 countries
        :param country_from:
        :param country_to:
        :param start_date:
        :param end_date:
        :return:
        """
        start_date = pd.Timestamp(start_date, unit="ms", tz="CET")
        end_date = pd.Timestamp(end_date, unit="ms", tz="CET")
        return self.client.query_net_transfer_capacity_dayahead(
            country_code_from=country_from.upper(),
            country_code_to=country_to.upper(),
            start=start_date,
            end=end_date)
コード例 #2
0
ファイル: test.py プロジェクト: quintinnicolas/entsoe-py
           ["10Y1001A1001A70O", "IT-Centre-North BZ"],
           ["10Y1001A1001A71M", "IT-Centre-South BZ"],
           ["10Y1001A1001A72K", "IT-Foggia BZ"],
           ["10Y1001A1001A66F", "IT-GR BZ"],
           ["10Y1001A1001A84D", "IT-MACROZONE NORTH MBA"],
           ["10Y1001A1001A85B", "IT-MACROZONE SOUTH MBA"],
           ["10Y1001A1001A877", "IT-Malta BZ"],
           ["10Y1001A1001A73I", "IT-North BZ"],
           ["10Y1001A1001A80L", "IT-North-AT BZ"],
           ["10Y1001A1001A68B", "IT-North-CH BZ"],
           ["10Y1001A1001A81J", "IT-North-FR BZ"],
           ["10Y1001A1001A67D", "IT-North-SI BZ"],
           ["10Y1001A1001A76C", "IT-Priolo BZ"],
           ["10Y1001A1001A77A", "IT-Rossano BZ"],
           ["10Y1001A1001A74G", "IT-Sardinia BZ"],
           ["10Y1001A1001A75E", "IT-Sicily BZ"],
           ["10Y1001A1001A788", "IT-South BZ"]]
"""

domains = [["10YCZ-CEPS-----N","Czech bidding zone"]]

lst = list()
for bzn in domains:
    s = e.query_unavailability_of_production_units(
        country_code=bzn[0], docstatus=None, start=start, end=end)
    if s is not None:
        lst.append(s)

result = pd.concat(lst)
result.to_csv('result.csv')