### Install OMIEData from local files Source: https://pypi.org/project/OMIEData Commands to install specific distribution files. ```bash python -m pip install OMIEData-VERSION-py3-none-any.whl ``` ```bash python -m pip install OMIEData-VERSION.tar.gz ``` -------------------------------- ### Install OMIEData from GitHub Source: https://pypi.org/project/OMIEData/0.4.0.0 Install the OMIEData package directly from its GitHub repository. ```bash python -m pip install git+https://github.com/acruzgarcia/OMIEData ``` -------------------------------- ### Install OMIEData from local tar.gz file Source: https://pypi.org/project/OMIEData/0.4.0.0 Install OMIEData from a local .tar.gz file. Replace VERSION with the actual version number. ```bash python -m pip install OMIEData-VERSION.tar.gz ``` -------------------------------- ### Install OMIEData using pip Source: https://pypi.org/project/OMIEData/0.4.0.0 Install the latest version of the OMIEData package from PyPI. ```bash python -m pip install OMIEData ``` -------------------------------- ### Install OMIEData from local wheel file Source: https://pypi.org/project/OMIEData/0.4.0.0 Install OMIEData from a local .whl file. Replace VERSION with the actual version number. ```bash python -m pip install OMIEData-VERSION-py3-none-any.whl ``` -------------------------------- ### Import Energy by Technology Data Source: https://pypi.org/project/OMIEData/0.4.0.0 Use OMIEEnergyByTechnologyImporter to download energy data by technology. Ensure to specify the date range and system type. The data is then sorted by date and hour. ```python df = OMIEEnergyByTechnologyImporter(date_ini=dateIni, date_end=dateEnd, system_type=system_type).read_to_dataframe(verbose=True) df.sort_values(by=['DATE', 'HOUR'], axis=0, inplace=True) print(df) ``` -------------------------------- ### Import Energy by Technology Data Source: https://pypi.org/project/OMIEData Use OMIEEnergyByTechnologyImporter to download energy data by technology. Ensure to sort the DataFrame by date and hour for proper analysis. ```python from OMIEData.DataImport.omie_energy_by_technology_importer import OMIEEnergyByTechnologyImporter import datetime as dt dateIni = dt.datetime(2020, 6, 1) dateEnd = dt.datetime(2020, 6, 1) system_type = "Nuclear" # This can take time, it is downloading the files from the website.. df = OMIEEnergyByTechnologyImporter(date_ini=dateIni, date_end=dateEnd, system_type=system_type).read_to_dataframe(verbose=True) df.sort_values(by=['DATE', 'HOUR'], axis=0, inplace=True) print(df) ``` -------------------------------- ### Download Hourly Energy by Technology Source: https://pypi.org/project/OMIEData/0.4.0.0 Imports hourly energy demand data, broken down by technology, for a specified system type (e.g., Spain) within a given date range. ```python import datetime as dt from OMIEData.Enums.all_enums import SystemType from OMIEData.DataImport.omie_energy_by_technology_importer import OMIEEnergyByTechnologyImporter dateIni = dt.datetime(2020, 6, 1) dateEnd = dt.datetime(2020, 7, 30) system_type = SystemType.SPAIN ``` -------------------------------- ### Download Hourly Electricity Prices and Demand Source: https://pypi.org/project/OMIEData/0.4.0.0 Imports hourly electricity prices and demand data for Spain and Portugal within a specified date range. This operation may take time as it downloads files from the website. The resulting DataFrame is sorted by date. ```python 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(2020, 1, 1) dateEnd = dt.datetime(2022, 3, 22) # 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) ``` -------------------------------- ### Sample DataFrame output Source: https://pypi.org/project/OMIEData Representation of the data structure returned by the importer. ```text DATE CONCEPT H1 ... H22 H23 H24 0 2020-01-01 PRICE_SP 41.88 ... 45.60 42.90 37.55 1 2020-01-01 PRICE_PT 41.88 ... 45.60 42.90 37.55 2 2020-01-01 ENER_IB 18132.30 ... 22492.60 21800.90 19946.30 3 2020-01-01 ENER_IB_BILLAT 26488.50 ... 32611.70 31523.70 29088.30 4 2020-01-02 PRICE_SP 35.40 ... 42.00 38.60 33.39 ... ... ... ... ... ... ... 3241 2022-03-21 PRICE_PT 218.69 ... 261.44 240.29 228.88 3245 2022-03-22 PRICE_PT 223.00 ... 256.00 242.18 212.99 3246 2022-03-22 ENER_IB 20652.20 ... 27113.50 24167.60 21841.50 3244 2022-03-22 PRICE_SP 223.00 ... 256.00 242.18 212.99 3247 2022-03-22 ENER_IB_BILLAT 29840.30 ... 38281.20 34781.90 31872.50 [3248 rows x 26 columns] ``` -------------------------------- ### Filter and Plot Electricity Prices Source: https://pypi.org/project/OMIEData/0.4.0.0 Filters the previously downloaded DataFrame to include only prices in Spain and then plots the 'H12' and 'H23' hourly prices against the date. ```python # Just prices in spain str_price_spain = str(DataTypeInMarginalPriceFile.PRICE_SPAIN) dfPrices = df[df.CONCEPT == str_price_spain] # Plotting plt.figure() plt.plot(dfPrices.DATE, dfPrices.H12, label='H12') plt.plot(dfPrices.DATE, dfPrices.H23, label='H23') plt.legend() plt.show() ``` -------------------------------- ### Import Supply/Demand Curves Data Source: https://pypi.org/project/OMIEData/0.4.0.0 Utilize OMIESupplyDemandCurvesImporter to fetch supply and demand curve data. Requires specifying the date range and hour. The resulting DataFrame is sorted by date and hour. ```python import datetime as dt from OMIEData.DataImport.omie_supply_demand_curve_importer import OMIESupplyDemandCurvesImporter dateIni = dt.datetime(2020, 6, 1) dateEnd = dt.datetime(2020, 6, 1) hour = 1 # This can take time, it is downloading the files from the website.. df = OMIESupplyDemandCurvesImporter(date_ini=dateIni, date_end=dateEnd, hour=hour).read_to_dataframe(verbose=True) df.sort_values(by=['DATE', 'HOUR'], axis=0, inplace=True) print(df) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.