Skip to content

Commit

Permalink
gas calls
Browse files Browse the repository at this point in the history
  • Loading branch information
berkorbay committed Oct 3, 2024
1 parent 5fe2771 commit e1e79a1
Show file tree
Hide file tree
Showing 4 changed files with 150 additions and 5 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@

# EPIAS Transparency Platform v2.0 Python client by Robokami Data

🇬🇧 `eptr2` (**EP**IAS **Tr**ansparency **2**.0) package is a thin wrapper around [EPIAS Transparency Platform v2.0](https://seffaflik.epias.com.tr/home) API brought to you by [Robokami](https://robokami.com). It is an unofficial package with Apache License 2.0 (free and permissable use for commercial applications, [see details](https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0)). `eptr2` accesses currently more than 120 services with convenience methods.
🇬🇧 `eptr2` (**EP**IAS **Tr**ansparency **2**.0) package is a thin wrapper around [EPIAS Transparency Platform v2.0](https://seffaflik.epias.com.tr/home) API brought to you by [Robokami](https://robokami.com). It is an unofficial package with Apache License 2.0 (free and permissable use for commercial applications, [see details](https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0)). `eptr2` accesses currently more than 137 services with convenience methods.


🇹🇷 `eptr2` (**EP**İAŞ **Tr**ansparency **2**.0) paketi [Robokami](https://robokami.com) tarafından [EPİAŞ Şeffaflık Platformu 2.0](https://seffaflik.epias.com.tr/home) API'si üzerine geliştirilmiş bir Python paketidir. Apache License 2.0 ile lisanslanmıştır ([ücretsiz ve büyük ölçüde serbest kullanım](https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0)). `eptr2` 120'den fazla veri servisine erişim sağlar.
🇹🇷 `eptr2` (**EP**İAŞ **Tr**ansparency **2**.0) paketi [Robokami](https://robokami.com) tarafından [EPİAŞ Şeffaflık Platformu 2.0](https://seffaflik.epias.com.tr/home) API'si üzerine geliştirilmiş bir Python paketidir. Apache License 2.0 ile lisanslanmıştır ([ücretsiz ve büyük ölçüde serbest kullanım](https://www.tldrlegal.com/license/apache-license-2-0-apache-2-0)). `eptr2` 137'den fazla veri servisine erişim sağlar.


## Installation
Expand Down
18 changes: 17 additions & 1 deletion eptr2/mapping/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,25 @@ def get_required_parameters(key):
"version_end_date",
],
"ra-sum": ["start_date", "end_date"],
"ng-participants": [],
"ng-participant-list": [],
"ng-balancing-notifications": ["start_date", "end_date"],
"ng-balancing-price": ["start_date", "end_date"],
"ng-bast": ["period"],
"ng-blue-code-ops": ["start_date", "end_date"],
"ng-daily-match-qty": ["start_date", "end_date"],
"ng-drp": ["start_date", "end_date"],
"ng-daily-trade-volume": ["start_date", "end_date"],
"ng-code-four-ops": ["start_date", "end_date"],
"ng-gddk": ["start_date", "end_date"],
"ng-green-code-ops": ["start_date", "end_date"],
"ng-grp-match-qty": ["start_date", "end_date"],
"ng-grp-trade-volume": ["start_date", "end_date"],
"ng-imbalance-amount": ["period"],
}

## UPDATE: As a precaution every call should have an input parameter
return d[key]
return d.get(key, [])


def get_optional_parameters(key):
Expand Down Expand Up @@ -229,6 +244,7 @@ def get_optional_parameters(key):
"period_start_date",
"period_end_date",
],
"ng-participants": ["org_id"],
}

return d.get(key, [])
118 changes: 116 additions & 2 deletions eptr2/mapping/path.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
import re


def get_path_map(just_call_keys: bool = False):
path_map = {
"call": {
Expand Down Expand Up @@ -719,20 +722,126 @@ def get_path_map(just_call_keys: bool = False):
"prev": "retroactive-adjustment",
"label": "retroactive-adjustment-sum",
},
## Doğal Gaz Piyasa Katılımcıları
"ng-participants": {
"prefix": "data",
"prev": "general-data",
"label": "market-participant",
"root": "natural-gas",
},
## Doğal Gaz Katılımcı Listesi
"ng-participant-list": {
"prefix": "data",
"prev": "general-data",
"label": "participant-list",
"root": "natural-gas",
},
## İlave Dengeleyici Bildirimleri Listeleme Servisi
"ng-balancing-notifications": {
"prefix": "data",
"prev": "sgp",
"label": "additional-notifications",
"root": "natural-gas",
},
## Dengeleme Gazı Fiyatları (DGF) Listeleme Servisi
"ng-balancing-price": {
"prefix": "data",
"prev": "sgp",
"label": "balancing-gas-price",
"root": "natural-gas",
},
## Bakiye Sıfırlama Tutarı (BAST) Listeleme Servisi
"ng-bast": {
"prefix": "data",
"prev": "sgp",
"label": "bast",
"root": "natural-gas",
},
## 2 Kodlu İşlemler Listeleme Servisi
"ng-blue-code-ops": {
"prefix": "data",
"prev": "sgp",
"label": "blue-code-operation",
"root": "natural-gas",
},
## SGP Günlük Eşleşme Miktarı Listeleme Servisi
"ng-daily-match-qty": {
"prefix": "data",
"prev": "sgp",
"label": "daily-matched-quantity",
"root": "natural-gas",
},
## Günlük Referans Fiyatı (GRF) Listeleme Servisi
"ng-drp": {
"prefix": "data",
"prev": "sgp",
"label": "daily-reference-price",
"root": "natural-gas",
},
## SGP Günlük İşlem Hacmi Listeleme Servisi
"ng-daily-trade-volume": {
"prefix": "data",
"prev": "sgp",
"label": "daily-trade-volume",
"root": "natural-gas",
},
## 4 Kodlu İşlemler Listeleme Servisi
"ng-code-four-ops": {
"prefix": "data",
"prev": "sgp",
"label": "four-code-operation",
"root": "natural-gas",
},
## Geriye Dönük Düzeltme Kalemi (GDDK) Tutarı Listeleme Servisi
"ng-gddk": {
"prefix": "data",
"prev": "sgp",
"label": "gddk-amount",
"root": "natural-gas",
},
## 1 Kodlu İşlemler Listeleme Servisi
"ng-green-code-ops": {
"prefix": "data",
"prev": "sgp",
"label": "green-code-operation",
"root": "natural-gas",
},
## GRF Eşleşme Miktarı Listeleme Servisi
"ng-grp-match-qty": {
"prefix": "data",
"prev": "sgp",
"label": "grf-match-quantity",
"root": "natural-gas",
},
## GRF İşlem Hacmi Listeleme Servisi
"ng-grp-trade-volume": {
"prefix": "data",
"prev": "sgp",
"label": "grf-trade-volume",
"root": "natural-gas",
},
## SGP Dengesizlik Tutarı Listeleme Servisi
"ng-imbalance-amount": {
"prefix": "data",
"prev": "sgp",
"label": "imbalance-amount",
"root": "natural-gas",
},
},
## category
"idm": {"prev": "markets"},
"dam": {"prev": "markets"},
"bpm": {"prev": "markets"},
"sgp": {"prev": "markets"},
"bilateral-contracts": {"prev": "markets"},
"general-data": {"prev": "markets"},
"imbalance": {"prev": "markets"},
"retroactive-adjustment": {"prev": "markets"},
"ancillary-services": {"prev": "markets"},
"dams": {"prev": "electricity-service"},
"markets": {"prev": "electricity-service"},
"generation": {"prev": "electricity-service"},
"consumption": {"prev": "electricity-service"},
"ancillary-services": {"prev": "markets"},
"renewables": {"prev": "electricity-service"},
"transmission": {"prev": "electricity-service"},
#### services
Expand Down Expand Up @@ -766,7 +875,11 @@ def get_total_path(key: str, join_path: bool = True):
if d.get("next", None) is not None:
total_path += get_total_path(key=d["next"], join_path=False)

return "/".join(total_path) if join_path else total_path
full_path = "/".join(total_path) if join_path else total_path
root_path = d.get("root", None)
if root_path is not None:
full_path = re.sub("electricity-service", root_path + "-service", full_path)
return full_path
else:
raise Exception("Key not found in path map.")

Expand Down Expand Up @@ -794,6 +907,7 @@ def get_call_method(key):
"ra-organization-list",
"ra-spg-list",
"ra-vspg-list",
"ng-participant-list",
]

if key in get_methods:
Expand Down
15 changes: 15 additions & 0 deletions eptr2/mapping/processing.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,21 @@ def get_postprocess_function(key):
"ra-meter-volumes-period",
"ra-meter-volumes-version",
"ra-sum",
"ng-participants",
"ng-participant-list",
"ng-balancing-notifications",
"ng-balancing-price",
"ng-bast",
"ng-blue-code-ops",
"ng-daily-match-qty",
"ng-drp",
"ng-daily-trade-volume",
"ng-code-four-ops",
"ng-gddk",
"ng-green-code-ops",
"ng-grp-match-qty",
"ng-grp-trade-volume",
"ng-imbalance-amount",
]:
return postprocess_items_to_df

Expand Down

0 comments on commit e1e79a1

Please sign in to comment.