### Run Live Tutorial App Source: https://pypi.org/project/eptr2 Start the live tutorial Streamlit app for eptr2. Requires Streamlit to be installed. Provide your username and password. ```python from eptr2.tutorials import run_demo_app run_demo_app(username="YOUR_USERNAME",password="YOUR_PASSWORD") ``` -------------------------------- ### Install eptr2 with uv Source: https://pypi.org/project/eptr2 Install the base eptr2 package using the 'uv' package installer. ```bash uv pip install eptr2 ``` -------------------------------- ### Install eptr2 with uv and extras Source: https://pypi.org/project/eptr2 Install the eptr2 package with extras using the 'uv' package installer. ```bash uv pip install "eptr2[allextras]" ``` -------------------------------- ### Install eptr2 from PyPI Source: https://pypi.org/project/eptr2 Install the base eptr2 package from the Python Package Index. ```bash pip install eptr2 ``` -------------------------------- ### Install eptr2 with all extras Source: https://pypi.org/project/eptr2 Install the eptr2 package including additional features like pandas and streamlit support, as well as MCP server capabilities for AI integration. ```bash pip install "eptr2[allextras]" ``` -------------------------------- ### Example .env file content Source: https://pypi.org/project/eptr2 A sample .env file format for storing EPIAS Transparency Platform credentials. Place this file in the same directory as your script. ```dotenv EPTR_USERNAME=youremail@something.com EPTR_PASSWORD=yourpassword ``` -------------------------------- ### Configure .env for MCP Server Source: https://pypi.org/project/eptr2 Example of a .env file for configuring eptr2 MCP server credentials. ```dotenv EPTR_USERNAME=your.email@example.com EPTR_PASSWORD=yourpassword ``` -------------------------------- ### Run eptr2 MCP Server Source: https://pypi.org/project/eptr2 Start the Model Context Protocol (MCP) server for AI agent integration using the command-line interface. ```bash eptr2-mcp-server ``` -------------------------------- ### Call Service Using Alias Source: https://pypi.org/project/eptr2 Use predefined aliases to call services. 'ptf' is an example alias for 'mcp'. ```python res = eptr.call("ptf", start_date="2024-07-29", end_date="2024-07-29") ``` -------------------------------- ### Run eptr2 MCP Server Programmatically Source: https://pypi.org/project/eptr2 Programmatically start the eptr2 MCP server using asyncio. Supports loading credentials from environment variables and recycling TGT. ```python from eptr2.mcp import run_mcp_server import asyncio asyncio.run(run_mcp_server(use_dotenv=True, recycle_tgt=True)) ``` -------------------------------- ### Get Aliases and Available Calls Source: https://pypi.org/project/eptr2 Retrieve all available aliases, optionally including custom ones, and list available calls, optionally including aliases. ```python eptr.get_aliases(include_custom_aliases = True) ``` ```python eptr.get_available_calls(include_aliases = True) ``` -------------------------------- ### Get Hourly Price and Cost Data Source: https://pypi.org/project/eptr2 Retrieve a dataframe combining MCP, SMP, and optionally WAP, along with associated imbalance and KUPST costs. ```python from eptr2 import EPTR2 from eptr2.composite import get_hourly_price_and_cost_data, get_imbalance_data eptr = EPTR2(username="YOUR_USERNAME",password="YOUR_PASSWORD") df_cost = get_hourly_price_and_cost_data(eptr, start_date="2024-07-29", end_date="2024-07-29") print(df_cost) df_imbalance = get_imbalance_data(eptr, start_date="2024-07-29", end_date="2024-07-29") print(df_imbalance) ``` -------------------------------- ### Get Hourly Consumption and Forecast Data Source: https://pypi.org/project/eptr2 Retrieve a combined dataframe of Load Plan, UECM, and Real Time Consumption data for a specified date range. ```python from eptr2 import EPTR2 from eptr2.composite import get_hourly_consumption_and_forecast_data eptr = EPTR2(username="YOUR_USERNAME",password="YOUR_PASSWORD") df = get_hourly_consumption_and_forecast_data(eptr, start_date="2024-07-29", end_date="2024-07-29") print(df) ``` -------------------------------- ### Get Hourly Production Data Source: https://pypi.org/project/eptr2 Retrieve actual production data (real time, UEVM) for specific production plant IDs or totals if IDs are omitted. Includes verbose logging. ```python from eptr2 import EPTR2 from eptr2.composite import wrapper_hourly_production_plan_and_realized, get_hourly_production_data, get_hourly_production_plan_data eptr = EPTR2(username="YOUR_USERNAME",password="YOUR_PASSWORD") actual_df = get_hourly_production_data( eptr=eptr, start_date="2024-11-01", end_date="2024-11-01", rt_pp_id=641, ## ATATÜRK HES uevm_pp_id=142, ## ATATÜRK HES verbose=True, ) plan_df = get_hourly_production_plan_data( eptr=eptr, start_date="2024-11-01", end_date="2024-11-01", org_id=195, ## EÜAŞ uevcb_id=3525325, ## ATATÜRK HES verbose=True, ) wrap_df = wrapper_hourly_production_plan_and_realized( eptr=eptr, start_date="2024-11-01", end_date="2024-11-01", verbose=True ) ``` -------------------------------- ### Get Intraday Market (IDM) Logs Source: https://pypi.org/project/eptr2 Retrieve Intraday Market (IDM) logs and their details for a specified period. Uses a credentials file for authentication. ```python from eptr2 import EPTR2 from eptr2.composite import idm_log_longer, idm_log_period eptr = EPTR2(credentials_file_path="creds/eptr_credentials.json") idm_log_longer(eptr=eptr, start_date="2023-01-01", end_date="2023-01-31", verbose=True) idm_log_period(eptr=eptr, period="2023-01-01", verbose=True) ``` -------------------------------- ### Get Day Ahead and Bilateral Trade Data Source: https://pypi.org/project/eptr2 Retrieves combined data for day-ahead and bilateral trades within a specified date range. Includes contract symbol information. ```python from eptr2 import EPTR2 from eptr2.composite import get_day_ahead_and_bilateral_matches, get_day_ahead_detail_info eptr = EPTR2(credentials_file_path="creds/eptr_credentials.json") df = get_day_ahead_and_bilateral_matches(eptr=eptr,start_date="2023-01-01", end_date="2023-01-31", verbose=True, include_contract_symbol=True) df2 = get_day_ahead_detail_info( eptr=eptr, start_date="2023-01-01", end_date="2023-01-31", verbose=True ) ``` -------------------------------- ### Get Balancing Power Market Data Source: https://pypi.org/project/eptr2 Fetches data for the Balancing Power Market, supporting both range queries and specific period lookups. Requires specifying the EPTR2 client and date parameters. ```python from eptr2 import EPTR2 from eptr2.composite import get_bpm_period, get_bpm_range eptr = EPTR2(credentials_file_path="creds/eptr_credentials.json") start_date = "2025-05-01" end_date = "2025-05-31" df1 = get_bpm_range( eptr=eptr, start_date=start_date, end_date=end_date, verbose=True ) period = "2025-05-01" # Example period df2 = get_bpm_period( period=period, eptr=eptr, max_lives=2, verbose=True, strict=True ) ``` -------------------------------- ### Run Calculator Tutorial App Source: https://pypi.org/project/eptr2 Launch the calculator tutorial app to estimate imbalance and KÜPST costs. Accepts custom actual and forecast values for any date and hour. ```python from eptr2.tutorials import run_calc_app run_calc_app(username="YOUR_USERNAME",password="YOUR_PASSWORD") ``` -------------------------------- ### Initialize EPTR2 with TGT Wrapper Source: https://pypi.org/project/eptr2 Create an EPTR2 object using the new login method that automatically handles TGT management. The credentials path can be specified. ```python from eptr2 import eptr_w_tgt_wrapper eptr = eptr_w_tgt_wrapper() ``` -------------------------------- ### Calculate Plant Costs Source: https://pypi.org/project/eptr2 Gathers and calculates plant costs, requiring specific plant, organization, and UEVBC IDs along with plant type and data sources for forecasts and actuals. Ensure credentials are set up. ```python from eptr2 import EPTR2 from eptr2.composite import gather_and_calculate_plant_costs eptr = EPTR2(credentials_file_path="creds/eptr_credentials.json") df = gather_and_calculate_plant_costs( eptr=eptr, start_date="2023-01-01", end_date="2023-01-31", pp_id=120, ## BOZCAADA RES org_id=195, ## EÜAŞ uevcb_id=3204384, ## BOZCAADA RES plant_type="wind", verbose=True, forecast_source = "kgup", actual_source = "uevm" ) ``` -------------------------------- ### Create and Use Custom Aliases Source: https://pypi.org/project/eptr2 Define custom aliases for service calls by preparing an alias dictionary and passing it during EPTR2 object initialization. ```python custom_aliases = {"market-clearing-price": "mcp", "system-marginal-price": "smp"} eptr = EPTR2(username="YOUR_USERNAME",password="YOUR_PASSWORD", custom_aliases=custom_aliases) ``` -------------------------------- ### Bulk Function Calls for Daily Operations Source: https://pypi.org/project/eptr2 Performs bulk data retrieval for Daily Production Plan (DPP/KGÜP), Real Time Generation, and UEVBC lists for a specified date. Requires the EPTR2 client and relevant IDs. ```python ### DPP / KGÜP bulk dpp_df = eptr.call("dpp-bulk", date="2025-08-31", uevcb_ids=[3208611, 723724, 335505, 106710, 4094]) ### Real Time Generation bulk rt_gen_df = eptr.call("rt-gen-bulk", date="2025-08-31", pp_ids=[11162, 17889, 605, 5005121, 20764]) ### UEVCB list bulk uevcb_df = eptr.call("uevcb-list-bulk", date="2025-08-31", org_ids=[166, 12297, 648, 19880, 162]) ``` -------------------------------- ### Bulk Function Calls Source: https://pypi.org/project/eptr2 Provides three bulk API endpoints for daily operations: DPP/KGÜP, Real Time Generation, and UEVCB list. These functions allow for efficient retrieval of multiple data points for a given date. ```APIDOC ## Bulk Function Calls ### Description Provides three bulk API endpoints for daily operations: DPP/KGÜP, Real Time Generation, and UEVCB list. These functions allow for efficient retrieval of multiple data points for a given date. ### Endpoints - `dpp-bulk`: Retrieves daily production plan data. - `rt-gen-bulk`: Retrieves real-time generation data. - `uevcb-list-bulk`: Retrieves a list of UEVCB information. ### Parameters - `date` (str): The date for which to retrieve data (YYYY-MM-DD). - `uevcb_ids` (list[int], optional): A list of UEVCEB IDs for filtering. - `pp_ids` (list[int], optional): A list of plant power IDs for filtering. - `org_ids` (list[int], optional): A list of organization IDs for filtering. ### Example Usage ```python # Assuming 'eptr' is an initialized EPTR2 object # DPP / KGÜP bulk dpp_df = eptr.call("dpp-bulk", date="2025-08-31", uevcb_ids=[3208611, 723724, 335505, 106710, 4094]) # Real Time Generation bulk rt_gen_df = eptr.call("rt-gen-bulk", date="2025-08-31", pp_ids=[11162, 17889, 605, 5005121, 20764]) # UEVCB list bulk uevcb_df = eptr.call("uevcb-list-bulk", date="2025-08-31", org_ids=[166, 12297, 648, 19880, 162]) ``` ``` -------------------------------- ### Configure Claude Desktop for eptr2 MCP Server Source: https://pypi.org/project/eptr2 Add this configuration to your Claude Desktop config file to integrate with the eptr2 MCP server. ```json { "mcpServers": { "eptr2": { "command": "eptr2-mcp-server", "env": { "EPTR_USERNAME": "your.email@example.com", "EPTR_PASSWORD": "yourpassword" } } } } ``` -------------------------------- ### Use .env file for credentials and TGT recycling Source: https://pypi.org/project/eptr2 Configure the EPTR2 client to use a .env file for credentials and enable Ticket Granting Ticket (TGT) recycling for automatic TGT management. This avoids manual credential handling and potential throttling from frequent TGT creation. ```python from eptr2 import EPTR2 eptr = EPTR2( use_dotenv=True, ## Default: True recycle_tgt=True, ## Default: False dotenv_path=".env" ## Default: ".env" tgt_path="." ## Default: ".", included as a kwarg ) df = eptr.call("mcp", start_date="2025-08-01",end_date="2025-08-31") ``` -------------------------------- ### Generate eptr2 Credentials File Source: https://pypi.org/project/eptr2 Use this function to create a credentials file for eptr2. The default path is 'creds/eptr_credentials.json', but it can be customized. ```python from eptr2 import generate_eptr2_credentials_file generate_eptr2_credentials_file( username="YOUR_USERNAME", password="YOUR_PASSWORD" ) ``` -------------------------------- ### Day Ahead and Bilateral Trade Data Source: https://pypi.org/project/eptr2 Retrieves day-ahead and bilateral trade data for a specified date range. The `get_day_ahead_detail_info` function provides detailed information, while `get_day_ahead_and_bilateral_matches` offers matched data, with an option to include contract symbols. ```APIDOC ## Day Ahead and Bilateral Trade Data ### Description Retrieves day-ahead and bilateral trade data for a specified date range. The `get_day_ahead_detail_info` function provides detailed information, while `get_day_ahead_and_bilateral_matches` offers matched data, with an option to include contract symbols. ### Functions - `get_day_ahead_and_bilateral_matches(eptr, start_date, end_date, verbose=False, include_contract_symbol=False)` - `get_day_ahead_detail_info(eptr, start_date, end_date, verbose=False)` ### Parameters - `eptr`: An initialized EPTR2 object. - `start_date` (str): The start date for the data retrieval (YYYY-MM-DD). - `end_date` (str): The end date for the data retrieval (YYYY-MM-DD). - `verbose` (bool, optional): If True, prints progress information. Defaults to False. - `include_contract_symbol` (bool, optional): If True, includes contract symbols in the output. Defaults to False. ### Example Usage ```python from eptr2 import EPTR2 from eptr2.composite import get_day_ahead_and_bilateral_matches, get_day_ahead_detail_info eptr = EPTR2(credentials_file_path="creds/eptr_credentials.json") df = get_day_ahead_and_bilateral_matches(eptr=eptr, start_date="2023-01-01", end_date="2023-01-31", verbose=True, include_contract_symbol=True) df2 = get_day_ahead_detail_info(eptr=eptr, start_date="2023-01-01", end_date="2023-01-31", verbose=True) ``` ``` -------------------------------- ### Plant Costs Calculation Source: https://pypi.org/project/eptr2 Gathers and calculates plant costs based on provided parameters including date range, plant ID, organization ID, UEVCEB ID, plant type, and forecast/actual data sources. ```APIDOC ## Plant Costs Calculation ### Description Gathers and calculates plant costs based on provided parameters including date range, plant ID, organization ID, UEVCEB ID, plant type, and forecast/actual data sources. ### Function - `gather_and_calculate_plant_costs(eptr, start_date, end_date, pp_id, org_id, uevcb_id, plant_type, verbose=False, forecast_source=None, actual_source=None)` ### Parameters - `eptr`: An initialized EPTR2 object. - `start_date` (str): The start date for the calculation (YYYY-MM-DD). - `end_date` (str): The end date for the calculation (YYYY-MM-DD). - `pp_id` (int): The plant power ID. - `org_id` (int): The organization ID. - `uevcb_id` (int): The UEVCEB ID. - `plant_type` (str): The type of the plant (e.g., "wind"). - `verbose` (bool, optional): If True, prints progress information. Defaults to False. - `forecast_source` (str, optional): The source for forecast data (e.g., "kgup"). Defaults to None. - `actual_source` (str, optional): The source for actual data (e.g., "uevm"). Defaults to None. ### Example Usage ```python from eptr2 import EPTR2 from eptr2.composite import gather_and_calculate_plant_costs eptr = EPTR2(credentials_file_path="creds/eptr_credentials.json") df = gather_and_calculate_plant_costs( eptr=eptr, start_date="2023-01-01", end_date="2023-01-31", pp_id=120, ## BOZCAADA RES org_id=195, ## EÜAŞ uevcb_id=3204384, ## BOZCAADA RES plant_type="wind", verbose=True, forecast_source = "kgup", actual_source = "uevm" ) ``` ``` -------------------------------- ### Balancing Power Market Data Source: https://pypi.org/project/eptr2 Fetches data from the Balancing Power Market. `get_bpm_range` retrieves data over a date range, while `get_bpm_period` fetches data for a specific period with options for maximum lives and strictness. ```APIDOC ## Balancing Power Market Data ### Description Fetches data from the Balancing Power Market. `get_bpm_range` retrieves data over a date range, while `get_bpm_period` fetches data for a specific period with options for maximum lives and strictness. ### Functions - `get_bpm_range(eptr, start_date, end_date, verbose=False)` - `get_bpm_period(period, eptr, max_lives=None, verbose=False, strict=False)` ### Parameters - `eptr`: An initialized EPTR2 object. - `start_date` (str): The start date for the data retrieval (YYYY-MM-DD). - `end_date` (str): The end date for the data retrieval (YYYY-MM-DD). - `period` (str): The specific period for data retrieval (YYYY-MM-DD). - `max_lives` (int, optional): Maximum number of lives to consider. Defaults to None. - `verbose` (bool, optional): If True, prints progress information. Defaults to False. - `strict` (bool, optional): If True, enforces strict data validation. Defaults to False. ### Example Usage ```python from eptr2 import EPTR2 from eptr2.composite import get_bpm_period, get_bpm_range eptr = EPTR2(credentials_file_path="creds/eptr_credentials.json") start_date = "2025-05-01" end_date = "2025-05-31" df1 = get_bpm_range(eptr=eptr, start_date=start_date, end_date=end_date, verbose=True) period = "2025-05-01" # Example period df2 = get_bpm_period(period=period, eptr=eptr, max_lives=2, verbose=True, strict=True) ``` ``` -------------------------------- ### Call Market Clearing Price (MCP) API Source: https://pypi.org/project/eptr2 Instantiate the EPTR2 client with username and password, then call the 'mcp' service to retrieve Market Clearing Price data for a specific date. ```python from eptr2 import EPTR2 eptr = EPTR2( username="YOUR_USERNAME", password="YOUR_PASSWORD" ) res = eptr.call("mcp", start_date="2024-07-29", end_date="2024-07-29") ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.