acruzgarcia / OMIEData

Python package to import data from OMIE (Iberian Peninsula's Electricity Market Operator): https://www.omie.es/
https://pypi.org/project/OMIEData/
MIT License
24 stars 7 forks source link

unsupported locale setting when requesting txt file #6

Closed scaiado closed 2 months ago

scaiado commented 1 year ago

When running import datetime as dt import matplotlib.pyplot as plt

from OMIEData.DataImport.omie_marginalprice_importer import OMIEMarginalPriceFileImporter from OMIEData.Enums.all_enums import DataTypeInMarginalPriceFile

dateIni = dt.datetime(2023, 1, 1) dateEnd = dt.datetime(2023, 1, 3)

This can take time, it is downloading the files from the website..

df = OMIEMarginalPriceFileImporter(date_ini=dateIni, date_end=dateEnd).read_to_dataframe(verbose=True) df.sort_values(by='DATE', axis=0, inplace=True) print(df)

I get this error. Already tried to change the locale settings but with no success. any ideas?

Requesting https://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_01_01_2023_01_01_2023.TXT ... There was error processing file: https://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_01_01_2023_01_01_2023.TXT unsupported locale settinghttps://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_01_01_2023_01_01_2023.TXT Requesting https://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_02_01_2023_02_01_2023.TXT ... There was error processing file: https://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_02_01_2023_02_01_2023.TXT unsupported locale settinghttps://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_02_01_2023_02_01_2023.TXT Requesting https://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_03_01_2023_03_01_2023.TXT ... There was error processing file: https://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_03_01_2023_03_01_2023.TXT unsupported locale settinghttps://www.omie.es/sites/default/files/dados/AGNO_2023/MES_01/TXT/INT_PBC_EV_H_1_03_01_2023_03_01_2023.TXT Empty DataFrame Columns: [DATE, CONCEPT, H1, H2, H3, H4, H5, H6, H7, H8, H9, H10, H11, H12, H13, H14, H15, H16, H17, H18, H19, H20, H21, H22, H23, H24, H25] Index: []

acruzgarcia commented 2 months ago

This issue has been solved in the past.

acruzgarcia commented 2 months ago

Solved.