eptr2 1.3.9.dev2__tar.gz → 1.3.9.dev5__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- eptr2-1.3.9.dev5/PKG-INFO +364 -0
- eptr2-1.3.9.dev5/README.md +330 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/examples/README.md +1 -1
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/pyproject.toml +3 -3
- eptr2-1.3.9.dev5/src/eptr2/__init__.py +41 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/agentic/__init__.py +16 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/agentic/schema.py +30 -1
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/agentic/skills.py +13 -8
- eptr2-1.3.9.dev5/src/eptr2/agentic/validation.py +203 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/assets/eptr2_api_schema.json +32 -4
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/assets/plugin.json +1 -1
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-api-discovery/SKILL.md +33 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-api-discovery/endpoint-categories.md +26 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-consumption-data/SKILL.md +25 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-consumption-data/examples.md +25 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-convenience-wrappers/SKILL.md +37 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-generation-tracking/SKILL.md +30 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-generation-tracking/examples.md +32 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-imbalance-costs/SKILL.md +24 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-imbalance-costs/examples.md +38 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-imbalance-costs/formulas.md +16 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-market-operations/SKILL.md +32 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-market-operations/examples.md +17 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-price-analysis/SKILL.md +27 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-price-analysis/api-reference.md +14 -0
- eptr2-1.3.9.dev5/src/eptr2/assets/skills/eptr2-price-analysis/examples.md +20 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/__init__.py +1 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/general.py +19 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/cli.py +43 -5
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/ancillary.py +2 -1
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/bpm.py +4 -3
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/consumption.py +16 -3
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/dabi_idm.py +13 -12
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/idm_log.py +6 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/ids.py +7 -6
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/mms.py +12 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/periodic_orgs.py +3 -2
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/plant_costs.py +21 -7
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/price_and_cost.py +29 -6
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/production.py +87 -12
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/main.py +257 -12
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mapping/help.py +12 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mapping/parameters.py +1 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mapping/path.py +5 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mcp/README.md +20 -8
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mcp/server.py +203 -47
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/util/costs.py +78 -13
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/util/time.py +2 -2
- eptr2-1.3.9.dev2/PKG-INFO +0 -120
- eptr2-1.3.9.dev2/README.md +0 -86
- eptr2-1.3.9.dev2/src/eptr2/__init__.py +0 -37
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-api-discovery/SKILL.md +0 -203
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-api-discovery/endpoint-categories.md +0 -211
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-consumption-data/SKILL.md +0 -155
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-consumption-data/examples.md +0 -249
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-convenience-wrappers/SKILL.md +0 -318
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-generation-tracking/SKILL.md +0 -177
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-generation-tracking/examples.md +0 -252
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-imbalance-costs/SKILL.md +0 -186
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-imbalance-costs/examples.md +0 -280
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-imbalance-costs/formulas.md +0 -266
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-market-operations/SKILL.md +0 -201
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-market-operations/examples.md +0 -236
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-price-analysis/SKILL.md +0 -123
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-price-analysis/api-reference.md +0 -173
- eptr2-1.3.9.dev2/src/eptr2/assets/skills/eptr2-price-analysis/examples.md +0 -233
- eptr2-1.3.9.dev2/tutorials/README.md +0 -71
- eptr2-1.3.9.dev2/tutorials/pyproject.toml +0 -21
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/LICENSE +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/README.md +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/docs/assets/README.md +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/examples/README.md +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/pyproject.toml +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/src/eptr2/mcp/README.md +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/tutorials/README.md +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.claude/worktrees/wonderful-knuth-6c1f12/tutorials/pyproject.toml +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/.gitignore +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/LICENSE +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/docs/assets/README.md +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/__main__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/agentic/discovery.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/assets/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/assets/mcp.json +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/assets/skills/eptr2-api-discovery/scripts/list_endpoints.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/ancillary.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/bilateral.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/bpm.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/consumption.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/dam.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/dams.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/generation.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/idm.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/imbalance.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/mms.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/ng_general.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/ng_sgp.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/ng_transmission.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/ng_vgp.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/renewables.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/reporting.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/retroactive.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/transmission.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/vep.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/calls/yek_g.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/composite/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mapping/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mapping/checks.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mapping/processing.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/mcp/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/processing/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/processing/postprocess/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/processing/postprocess/items.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/processing/preprocess/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/processing/preprocess/calls.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/processing/preprocess/params.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/util/__init__.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/util/certificate.py +0 -0
- {eptr2-1.3.9.dev2 → eptr2-1.3.9.dev5}/src/eptr2/util/evaluation.py +0 -0
|
@@ -0,0 +1,364 @@
|
|
|
1
|
+
Metadata-Version: 2.5
|
|
2
|
+
Name: eptr2
|
|
3
|
+
Version: 1.3.9.dev5
|
|
4
|
+
Summary: EPIAS Transparency Platform v2.0 Python client by Robokami / Tideseed
|
|
5
|
+
Project-URL: Homepage, https://github.com/Tideseed/eptr2
|
|
6
|
+
Project-URL: Documentation, https://tideseed.github.io/eptr2/
|
|
7
|
+
Project-URL: Repository, https://github.com/Tideseed/eptr2.git
|
|
8
|
+
Project-URL: Issues, https://github.com/Tideseed/eptr2/issues
|
|
9
|
+
Project-URL: Changelog, https://github.com/Tideseed/eptr2/blob/main/CHANGELOG.md
|
|
10
|
+
Author-email: Tideseed <info@tideseed.com>
|
|
11
|
+
License: Apache License 2.0
|
|
12
|
+
License-File: LICENSE
|
|
13
|
+
Requires-Python: >=3.11
|
|
14
|
+
Requires-Dist: pytz>=2024.1
|
|
15
|
+
Requires-Dist: urllib3>=2.7.0
|
|
16
|
+
Provides-Extra: allextras
|
|
17
|
+
Requires-Dist: fastmcp>=3.3.1; extra == 'allextras'
|
|
18
|
+
Requires-Dist: openpyxl>=3.1.5; extra == 'allextras'
|
|
19
|
+
Requires-Dist: pandas>=2.1.3; extra == 'allextras'
|
|
20
|
+
Requires-Dist: xlsxwriter>=3.2.9; extra == 'allextras'
|
|
21
|
+
Provides-Extra: dataframe
|
|
22
|
+
Requires-Dist: pandas>=2.1.3; extra == 'dataframe'
|
|
23
|
+
Provides-Extra: dev
|
|
24
|
+
Requires-Dist: pytest>=9.0.3; extra == 'dev'
|
|
25
|
+
Provides-Extra: docs
|
|
26
|
+
Requires-Dist: mkdocs-autorefs>=0.5.0; extra == 'docs'
|
|
27
|
+
Requires-Dist: mkdocs-material>=9.5.0; extra == 'docs'
|
|
28
|
+
Requires-Dist: mkdocstrings[python]>=0.24.0; extra == 'docs'
|
|
29
|
+
Provides-Extra: mcp
|
|
30
|
+
Requires-Dist: fastmcp>=3.3.1; extra == 'mcp'
|
|
31
|
+
Requires-Dist: pandas>=2.1.3; extra == 'mcp'
|
|
32
|
+
Requires-Dist: xlsxwriter>=3.2.9; extra == 'mcp'
|
|
33
|
+
Description-Content-Type: text/markdown
|
|
34
|
+
|
|
35
|
+
[](https://pypi.org/project/eptr2/)
|
|
36
|
+
[](https://pypi.org/project/eptr2/)
|
|
37
|
+
[](https://pypi.org/project/eptr2/)
|
|
38
|
+
[](https://github.com/Tideseed/eptr2/blob/main/LICENSE)
|
|
39
|
+
[](https://tideseed.github.io/eptr2/)
|
|
40
|
+
[](https://tideseed.github.io/eptr2/ai-integration/mcp-server/)
|
|
41
|
+
|
|
42
|
+
# eptr2
|
|
43
|
+
|
|
44
|
+
`eptr2` (**EP**IAS **Tr**ansparency **2**.0) is a Python client for the [EPIAS Transparency Platform v2.0](https://seffaflik.epias.com.tr/home) API, covering **232 services** of the Turkish electricity and natural gas markets — prices (PTF/SMF), consumption, generation, production plans, market operations and imbalance costs.
|
|
45
|
+
|
|
46
|
+
It is an unofficial package by [Robokami](https://robokami.com) / [Tideseed](https://tideseed.com), Apache License 2.0.
|
|
47
|
+
|
|
48
|
+
📖 **Full documentation: <https://tideseed.github.io/eptr2/>** · 🇹🇷 **[Türkçe bölüm aşağıda](#türkçe)**
|
|
49
|
+
|
|
50
|
+
---
|
|
51
|
+
|
|
52
|
+
## Getting Started
|
|
53
|
+
|
|
54
|
+
**1. Get credentials.** [Register with the EPIAS Transparency Platform](https://kayit.epias.com.tr/epias-transparency-platform-registration-form). Your username is the registration e-mail. The platform has an English version too.
|
|
55
|
+
|
|
56
|
+
**2. Install.**
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
pip install "eptr2[allextras]"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
`[allextras]` adds pandas (DataFrame output) and MCP server support. For a thin client with almost no dependencies, `pip install eptr2` also works. Everything works with `uv pip install` as well.
|
|
63
|
+
|
|
64
|
+
**3. Store your credentials** in a `.env` file next to your script:
|
|
65
|
+
|
|
66
|
+
```
|
|
67
|
+
EPTR_USERNAME=your.email@example.com
|
|
68
|
+
EPTR_PASSWORD=yourpassword
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**4. Make your first call.**
|
|
72
|
+
|
|
73
|
+
```python
|
|
74
|
+
from eptr2 import EPTR2
|
|
75
|
+
|
|
76
|
+
eptr = EPTR2(use_dotenv=True, recycle_tgt=True)
|
|
77
|
+
|
|
78
|
+
# Market Clearing Price (MCP / PTF) for a single day
|
|
79
|
+
df = eptr.call("mcp", start_date="2026-07-01", end_date="2026-07-01")
|
|
80
|
+
print(df)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
`recycle_tgt=True` caches the authentication ticket, so repeated runs do not log in again.
|
|
84
|
+
|
|
85
|
+
You can also pass credentials directly — handy for notebooks:
|
|
86
|
+
|
|
87
|
+
```python
|
|
88
|
+
eptr = EPTR2(username="your.email@example.com", password="yourpassword")
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**5. Or skip Python entirely** and use the command line:
|
|
92
|
+
|
|
93
|
+
```bash
|
|
94
|
+
eptr2 call mcp --start-date 2026-07-01 --end-date 2026-07-01 --format csv
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Usage
|
|
98
|
+
|
|
99
|
+
### One call pattern for all 232 services
|
|
100
|
+
|
|
101
|
+
Every service is reached with the same `call` method and an endpoint key:
|
|
102
|
+
|
|
103
|
+
```python
|
|
104
|
+
eptr.call("mcp", start_date="2026-07-01", end_date="2026-07-01") # PTF
|
|
105
|
+
eptr.call("smp", start_date="2026-07-01", end_date="2026-07-01") # SMF
|
|
106
|
+
eptr.call("rt-cons", start_date="2026-07-01", end_date="2026-07-01") # Real-time consumption
|
|
107
|
+
eptr.call("rt-gen", start_date="2026-07-01", end_date="2026-07-01") # Generation by source
|
|
108
|
+
eptr.call("mcp-smp-imb", start_date="2026-07-01", end_date="2026-07-01") # Imbalance prices
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
Turkish aliases work too: `ptf` → `mcp`, `smf` → `smp`.
|
|
112
|
+
|
|
113
|
+
### Finding the right service
|
|
114
|
+
|
|
115
|
+
You do **not** need credentials to explore the API:
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
eptr2 list # all 232 keys grouped by category
|
|
119
|
+
eptr2 search dengesizlik # keyword search, Turkish or English
|
|
120
|
+
eptr2 describe mcp # parameters, method, path, description
|
|
121
|
+
```
|
|
122
|
+
|
|
123
|
+
```python
|
|
124
|
+
from eptr2.agentic import search_calls, describe_call
|
|
125
|
+
|
|
126
|
+
describe_call("uevm") # required/optional parameters and meaning
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
### Typed convenience wrappers
|
|
130
|
+
|
|
131
|
+
If you prefer autocomplete and type hints over string keys:
|
|
132
|
+
|
|
133
|
+
```python
|
|
134
|
+
from eptr2.calls import get_mcp, get_smp, get_rt_gen
|
|
135
|
+
|
|
136
|
+
df = get_mcp(start_date="2026-07-01", end_date="2026-07-01", eptr=eptr)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
### Composite functions
|
|
140
|
+
|
|
141
|
+
Ready-made combinations of several calls, cleaned and merged:
|
|
142
|
+
|
|
143
|
+
```python
|
|
144
|
+
from eptr2.composite import (
|
|
145
|
+
get_hourly_price_and_cost_data, # MCP + SMP + WAP + imbalance/KUPST costs
|
|
146
|
+
get_hourly_consumption_and_forecast_data,
|
|
147
|
+
get_dabi_idm_data, # day-ahead + bilateral + intraday volumes
|
|
148
|
+
get_bpm_range, # balancing market (YAL/YAT) with SMP
|
|
149
|
+
get_kgup_bulk_range, # bulk production PLANS (by UEVCB id)
|
|
150
|
+
get_rt_gen_bulk_range, # bulk REALIZED generation (by powerplant id)
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
df = get_hourly_price_and_cost_data(
|
|
154
|
+
start_date="2026-07-01", end_date="2026-07-31", eptr=eptr
|
|
155
|
+
)
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
Note the argument order: dates first, the client as the `eptr` keyword.
|
|
159
|
+
|
|
160
|
+
### Imbalance and KÜPST cost calculations
|
|
161
|
+
|
|
162
|
+
Pure functions — no API call, no credentials. The regulation period (pre-2026 / 2026) and the price floor/ceiling are derived from the contract code:
|
|
163
|
+
|
|
164
|
+
```python
|
|
165
|
+
from eptr2.util.costs import calculate_unit_price_and_costs_by_contract
|
|
166
|
+
|
|
167
|
+
calculate_unit_price_and_costs_by_contract(
|
|
168
|
+
contract="PH26070101", # PHYYMMDDhh
|
|
169
|
+
mcp=4000, smp=4000,
|
|
170
|
+
system_direction="Enerji Açığı", # required when MCP == SMP
|
|
171
|
+
)
|
|
172
|
+
```
|
|
173
|
+
|
|
174
|
+
⚠️ When MCP equals SMP the system direction cannot be inferred from prices, and assuming a balanced system **understates the negative imbalance price**. Pass `system_direction` (or `sd_sign`) explicitly; the `systemStatus` field of `mcp-smp-imb` gives it.
|
|
175
|
+
|
|
176
|
+
### Options for unattended / production use
|
|
177
|
+
|
|
178
|
+
```python
|
|
179
|
+
eptr = EPTR2(
|
|
180
|
+
use_dotenv=True,
|
|
181
|
+
recycle_tgt=True,
|
|
182
|
+
strict_params=True, # raise on unknown parameters instead of warning
|
|
183
|
+
connect_timeout=10.0, # seconds (per operation, not a total deadline)
|
|
184
|
+
read_timeout=60.0,
|
|
185
|
+
)
|
|
186
|
+
```
|
|
187
|
+
|
|
188
|
+
`strict_params` matters more than it looks: an unknown parameter is dropped from the request, so a misspelled filter (`ppID` instead of `pp_id`) silently turns a filtered query into an unfiltered one. By default eptr2 warns and names the correct parameter; `strict_params=True` makes it an error.
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
## Using eptr2 with AI Agents
|
|
193
|
+
|
|
194
|
+
`eptr2` ships provider-agnostic tooling — nothing is tied to one model vendor. There are three ways to use it, depending on what your agent is.
|
|
195
|
+
|
|
196
|
+
### 1. Chat assistants — connect the MCP server
|
|
197
|
+
|
|
198
|
+
Gives any [Model Context Protocol](https://modelcontextprotocol.io) client (VS Code agent mode, Claude Desktop/Code, Cursor, …) **18 tools**: prices, consumption, generation, market operations, credential-free discovery, and pure imbalance/KÜPST calculators.
|
|
199
|
+
|
|
200
|
+
```bash
|
|
201
|
+
pip install "eptr2[allextras]"
|
|
202
|
+
eptr2 mcp-config --client vscode # or claude-desktop, claude-code, cursor, generic
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Paste the printed snippet into your client's MCP configuration, fill in your credentials, and ask questions in plain language:
|
|
206
|
+
|
|
207
|
+
> "What was the market clearing price in Turkey yesterday, and how did it compare with SMP?"
|
|
208
|
+
|
|
209
|
+
### 2. Coding agents — let them write eptr2 code for you
|
|
210
|
+
|
|
211
|
+
Point the agent at **[AGENTS.md](AGENTS.md)**, the canonical agent guide (VS Code and Claude Code read it automatically inside this repo). Away from the repo, the agent can learn the whole API on its own, without credentials:
|
|
212
|
+
|
|
213
|
+
```bash
|
|
214
|
+
eptr2 schema --stdout # machine-readable description of all 232 endpoints
|
|
215
|
+
eptr2 describe rt-gen # exact parameters for one endpoint
|
|
216
|
+
eptr2 search üretim # find endpoints by keyword
|
|
217
|
+
```
|
|
218
|
+
|
|
219
|
+
Install the 7 bundled skills (prices, consumption, generation, imbalance costs, market operations, API discovery, typed wrappers) into any SKILL.md-compatible runtime:
|
|
220
|
+
|
|
221
|
+
```bash
|
|
222
|
+
eptr2 install-skills # into ./.agents/skills
|
|
223
|
+
eptr2 install-skills --dest user # into ~/.agents/skills
|
|
224
|
+
eptr2 install-skills --client claude # into ./.claude/skills
|
|
225
|
+
eptr2 install-skills --client claude --dest user # into ~/.claude/skills
|
|
226
|
+
```
|
|
227
|
+
|
|
228
|
+
The skills and MCP server are also packaged together as a portable [Agent Plugin](https://agent-plugins.org): `eptr2 plugin-path`.
|
|
229
|
+
|
|
230
|
+
### 3. Shell-driven agents — use the CLI
|
|
231
|
+
|
|
232
|
+
Data goes to stdout (JSON or CSV), diagnostics to stderr, nonzero exit codes on failure, so output pipes cleanly:
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
eptr2 call mcp --start-date 2026-07-01 --end-date 2026-07-01 --format json | jq '.[0]'
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
📚 Details: [MCP server](https://tideseed.github.io/eptr2/ai-integration/mcp-server/) · [MCP client setup](https://tideseed.github.io/eptr2/ai-integration/mcp-clients/) · [agent skills](https://tideseed.github.io/eptr2/ai-integration/agent-skills/) · [Agent Plugin](https://tideseed.github.io/eptr2/ai-integration/agent-plugin/) · [CLI](https://tideseed.github.io/eptr2/ai-integration/cli/)
|
|
239
|
+
|
|
240
|
+
---
|
|
241
|
+
|
|
242
|
+
## Going Further
|
|
243
|
+
|
|
244
|
+
| Topic | Documentation |
|
|
245
|
+
|-------|---------------|
|
|
246
|
+
| All 232 API calls, categories and parameters | [Available API Calls](https://tideseed.github.io/eptr2/user-guide/api-calls/) |
|
|
247
|
+
| Typed `get_*` wrapper functions (`eptr2.calls`) | [Convenience Wrappers](https://tideseed.github.io/eptr2/user-guide/convenience-wrappers/) |
|
|
248
|
+
| Aliases, bulk calls, DataFrames | [Basic Usage](https://tideseed.github.io/eptr2/user-guide/basic-usage/) · [DataFrames](https://tideseed.github.io/eptr2/user-guide/dataframes/) |
|
|
249
|
+
| Composite functions | [Composite Functions](https://tideseed.github.io/eptr2/user-guide/composite-functions/) |
|
|
250
|
+
| Imbalance / KÜPST cost calculations | [Utilities API](https://tideseed.github.io/eptr2/api/util/) |
|
|
251
|
+
| Turkish market abbreviations (PTF, SMF, KGÜP, …) | [Abbreviations](https://tideseed.github.io/eptr2/reference/abbreviations/) |
|
|
252
|
+
| Release history | [Changelog](https://tideseed.github.io/eptr2/reference/changelog/) |
|
|
253
|
+
|
|
254
|
+
### Development versions
|
|
255
|
+
|
|
256
|
+
```bash
|
|
257
|
+
pip install --pre "eptr2[allextras]" # latest pre-release
|
|
258
|
+
pip install "eptr2[allextras] @ git+https://github.com/Tideseed/eptr2.git" # straight from GitHub
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Pin a released version with `eptr2==1.3.8` if you need to stay off dev builds.
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## Türkçe
|
|
266
|
+
|
|
267
|
+
`eptr2` (**EP**İAŞ **Tr**ansparency **2**.0), [EPİAŞ Şeffaflık Platformu 2.0](https://seffaflik.epias.com.tr/home) API'si üzerine geliştirilmiş bir Python paketidir. Türkiye elektrik ve doğal gaz piyasalarına ait **232 veri servisine** tek bir yapıyla erişim sağlar: PTF/SMF fiyatları, tüketim, üretim, üretim planları (KGÜP/KUDÜP), piyasa işlemleri (GÖP, GİP, DGP, İA) ve dengesizlik maliyetleri.
|
|
268
|
+
|
|
269
|
+
[Robokami](https://robokami.com) / [Tideseed](https://tideseed.com) tarafından geliştirilen resmi olmayan bir pakettir. Apache License 2.0 ile lisanslanmıştır; ticari kullanım dahil geniş ölçüde serbesttir.
|
|
270
|
+
|
|
271
|
+
### Kurulum ve ilk adımlar
|
|
272
|
+
|
|
273
|
+
**1. Kayıt.** [EPİAŞ Şeffaflık Platformu'na kayıt olun](https://kayit.epias.com.tr/epias-transparency-platform-registration-form). Kullanıcı adınız kayıt e-postanızdır.
|
|
274
|
+
|
|
275
|
+
**2. Kurulum.**
|
|
276
|
+
|
|
277
|
+
```bash
|
|
278
|
+
pip install "eptr2[allextras]"
|
|
279
|
+
```
|
|
280
|
+
|
|
281
|
+
`[allextras]` seçeneği pandas (DataFrame çıktısı) ve MCP sunucu desteğini de kurar. Sadece temel istemci için `pip install eptr2` yeterlidir.
|
|
282
|
+
|
|
283
|
+
**3. Kimlik bilgileri.** Betiğinizin yanına bir `.env` dosyası oluşturun:
|
|
284
|
+
|
|
285
|
+
```
|
|
286
|
+
EPTR_USERNAME=eposta@ornek.com
|
|
287
|
+
EPTR_PASSWORD=sifreniz
|
|
288
|
+
```
|
|
289
|
+
|
|
290
|
+
**4. İlk çağrı.**
|
|
291
|
+
|
|
292
|
+
```python
|
|
293
|
+
from eptr2 import EPTR2
|
|
294
|
+
|
|
295
|
+
eptr = EPTR2(use_dotenv=True, recycle_tgt=True)
|
|
296
|
+
|
|
297
|
+
# Piyasa Takas Fiyatı (PTF)
|
|
298
|
+
df = eptr.call("ptf", start_date="2026-07-01", end_date="2026-07-01")
|
|
299
|
+
print(df)
|
|
300
|
+
```
|
|
301
|
+
|
|
302
|
+
`recycle_tgt=True` giriş biletini (TGT) saklar; her çalıştırmada yeniden giriş yapılmaz.
|
|
303
|
+
|
|
304
|
+
### Kullanım
|
|
305
|
+
|
|
306
|
+
Tüm servisler aynı desenle çağrılır. Türkçe kısaltmalar takma ad olarak kullanılabilir (`ptf` → `mcp`, `smf` → `smp`):
|
|
307
|
+
|
|
308
|
+
```python
|
|
309
|
+
eptr.call("ptf", start_date="2026-07-01", end_date="2026-07-01") # Piyasa Takas Fiyatı
|
|
310
|
+
eptr.call("smf", start_date="2026-07-01", end_date="2026-07-01") # Sistem Marjinal Fiyatı
|
|
311
|
+
eptr.call("rt-cons", start_date="2026-07-01", end_date="2026-07-01") # Gerçek zamanlı tüketim
|
|
312
|
+
eptr.call("rt-gen", start_date="2026-07-01", end_date="2026-07-01") # Kaynak bazlı üretim
|
|
313
|
+
eptr.call("mcp-smp-imb", start_date="2026-07-01", end_date="2026-07-01") # Dengesizlik fiyatları
|
|
314
|
+
```
|
|
315
|
+
|
|
316
|
+
Hangi servisin ne olduğunu **kimlik bilgisi gerekmeden** keşfedebilirsiniz:
|
|
317
|
+
|
|
318
|
+
```bash
|
|
319
|
+
eptr2 list # 232 servisin tamamı, kategorilere göre
|
|
320
|
+
eptr2 search dengesizlik # Türkçe veya İngilizce anahtar kelime araması
|
|
321
|
+
eptr2 describe uevm # parametreler, yöntem, açıklama
|
|
322
|
+
```
|
|
323
|
+
|
|
324
|
+
Birden fazla çağrıyı birleştiren hazır fonksiyonlar (composite) da mevcuttur:
|
|
325
|
+
|
|
326
|
+
```python
|
|
327
|
+
from eptr2.composite import get_hourly_price_and_cost_data
|
|
328
|
+
|
|
329
|
+
# PTF, SMF, AOF ve dengesizlik/KÜPST maliyetleri tek tabloda
|
|
330
|
+
df = get_hourly_price_and_cost_data(
|
|
331
|
+
start_date="2026-07-01", end_date="2026-07-31", eptr=eptr
|
|
332
|
+
)
|
|
333
|
+
```
|
|
334
|
+
|
|
335
|
+
### Dengesizlik ve KÜPST maliyetleri
|
|
336
|
+
|
|
337
|
+
API çağrısı gerektirmeyen saf hesaplama fonksiyonlarıdır. Mevzuat dönemi (2026 öncesi / 2026) ve taban-tavan fiyatlar sözleşme kodundan otomatik belirlenir:
|
|
338
|
+
|
|
339
|
+
```python
|
|
340
|
+
from eptr2.util.costs import calculate_unit_price_and_costs_by_contract
|
|
341
|
+
|
|
342
|
+
calculate_unit_price_and_costs_by_contract(
|
|
343
|
+
contract="PH26070101", # PHYYAAGGss formatında saatlik sözleşme
|
|
344
|
+
mcp=4000, smp=4000,
|
|
345
|
+
system_direction="Enerji Açığı", # PTF == SMF ise zorunlu
|
|
346
|
+
)
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
⚠️ **Önemli:** PTF ile SMF eşit olduğunda sistem yönü fiyatlardan anlaşılamaz. Bu durumda sistemin dengede olduğu varsayılırsa **negatif dengesizlik fiyatı olduğundan düşük hesaplanır**. `system_direction` değerini (`Enerji Açığı` / `Enerji Fazlası` / `Dengede`) mutlaka belirtin; bu bilgi `mcp-smp-imb` çağrısındaki `systemStatus` alanından alınabilir.
|
|
350
|
+
|
|
351
|
+
### Yapay zeka ajanlarıyla kullanım
|
|
352
|
+
|
|
353
|
+
`eptr2`, herhangi bir yapay zeka sağlayıcısına bağlı olmayan araçlar sunar:
|
|
354
|
+
|
|
355
|
+
- **MCP sunucusu** — VS Code, Claude, Cursor gibi istemcilere 18 araç kazandırır. Yapılandırma çıktısı için: `eptr2 mcp-config --client vscode`
|
|
356
|
+
- **Ajan becerileri (skills)** — fiyat analizi, tüketim, üretim, dengesizlik maliyetleri, piyasa işlemleri ve API keşfi için 7 hazır beceri: `eptr2 install-skills`
|
|
357
|
+
- **[AGENTS.md](AGENTS.md)** — kod yazan ajanlar için başvuru rehberi
|
|
358
|
+
- **Makine tarafından okunabilir şema** — 232 servisin tamamı parametreleriyle: `eptr2 schema --stdout`
|
|
359
|
+
|
|
360
|
+
Böylece bir yapay zeka asistanına doğrudan "geçen ayın PTF ortalamasını hesapla" ya da "rüzgar santralim için dengesizlik maliyetini çıkar" diyebilir, ajanın sizin için doğru çağrıları yazmasını sağlayabilirsiniz.
|
|
361
|
+
|
|
362
|
+
### Dokümantasyon
|
|
363
|
+
|
|
364
|
+
Ayrıntılı ve güncel dokümantasyon: **<https://tideseed.github.io/eptr2/>**
|