-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathMarket.py
More file actions
91 lines (79 loc) · 3.31 KB
/
Copy pathMarket.py
File metadata and controls
91 lines (79 loc) · 3.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
from typing import Optional
from .Base import Base
class Market(Base):
"""Market data parameters for ENTSO-E Transparency Platform queries."""
def __init__(
self,
document_type: str,
period_start: int,
period_end: int,
# Domain parameters - at least one required
in_domain: Optional[str] = None,
out_domain: Optional[str] = None,
domain_mrid: Optional[str] = None,
# Optional parameters based on Postman collection
business_type: Optional[str] = None,
process_type: Optional[str] = None,
contract_market_agreement_type: Optional[str] = None,
auction_type: Optional[str] = None,
auction_category: Optional[str] = None,
classification_sequence_attribute_instance_component_position: Optional[
int
] = None,
# Additional common parameters
offset: int | None = None,
curve_type: Optional[str] = None,
):
"""
Initialize market data parameters for ENTSO-E Transparency Platform.
Args:
document_type: Document type (e.g., A25, A26, A31, A44, A94, A09, B09, B33)
period_start: Start period (YYYYMMDDHHMM format)
period_end: End period (YYYYMMDDHHMM format)
in_domain: Input domain/bidding zone (e.g., 10YBE----------2)
out_domain: Output domain/bidding zone (e.g., 10YGB----------A)
domain_mrid: Domain mRID for specific queries (e.g., 10YDOM-REGION-1V)
business_type: Business type (e.g., A29, A31, A34, A37, A43, B05, B07,
B08, B10, B11)
process_type: Process type (e.g., A44 for flow-based allocations)
contract_market_agreement_type: Contract market agreement type (A01,
A05, A06, A07)
auction_type: Auction type (A01, A02)
auction_category: Auction category (A04)
classification_sequence_attribute_instance_component_position: Position
for classification
offset: Offset for pagination
curve_type: Curve type (default None, can be set to "A01" or "A03" for specific queries)
Raises:
ValidationError: If any input parameter is invalid
"""
# Initialize base parameters
super().__init__(
document_type=document_type,
period_start=period_start,
period_end=period_end,
offset=offset,
curve_type=curve_type,
)
# Add domain parameters
self.add_domain_params(
in_domain=in_domain,
out_domain=out_domain,
domain_mrid=domain_mrid,
)
# Add business parameters
self.add_business_params(
business_type=business_type,
process_type=process_type,
)
# Add market parameters
self.add_market_params(
contract_market_agreement_type=contract_market_agreement_type,
auction_type=auction_type,
auction_category=auction_category,
)
# Add classification parameter if provided
self.add_optional_param(
"classificationSequence_AttributeInstanceComponent.position",
classification_sequence_attribute_instance_component_position,
)