primary-api-models 0.4.1__tar.gz → 0.4.3__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.
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/PKG-INFO +14 -13
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/README.md +12 -12
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models.egg-info/PKG-INFO +14 -13
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models.egg-info/SOURCES.txt +1 -0
- primary_api_models-0.4.3/primary_api_models.egg-info/requires.txt +1 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/pyproject.toml +5 -2
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/__init__.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/account_report.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/commons.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/detailed_instruments.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/detailed_position.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/enhanced_models.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/enums.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/instrument_details.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/instruments.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/market_data.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/order.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/order_report.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/order_status.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/positions.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/segments.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models.egg-info/dependency_links.txt +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models.egg-info/top_level.txt +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/setup.cfg +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/tests/test_model_dump.py +0 -0
- {primary_api_models-0.4.1 → primary_api_models-0.4.3}/tests/test_models.py +0 -0
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: primary-api-models
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Primary API models
|
|
5
5
|
Author-email: Chi Tudi <chitudi54@gmail.com>
|
|
6
6
|
Requires-Python: >=3.8
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: pydantic==2.13.4
|
|
8
9
|
|
|
9
10
|
# Primary API Models
|
|
10
11
|
Models for Primary API (REST / WS) messages
|
|
@@ -30,7 +31,7 @@ pyRofex.initialize(...)
|
|
|
30
31
|
|
|
31
32
|
# Get all segments
|
|
32
33
|
response = pyRofex.get_segments()
|
|
33
|
-
data = SegmentsResponse.
|
|
34
|
+
data = SegmentsResponse.model_validate(response)
|
|
34
35
|
print(data.segments)
|
|
35
36
|
```
|
|
36
37
|
|
|
@@ -44,7 +45,7 @@ pyRofex.initialize(...)
|
|
|
44
45
|
|
|
45
46
|
# Get available instrument list
|
|
46
47
|
response = pyRofex.get_all_instruments()
|
|
47
|
-
data = AllInstrumentsResponse.
|
|
48
|
+
data = AllInstrumentsResponse.model_validate(response)
|
|
48
49
|
print(data.instruments)
|
|
49
50
|
```
|
|
50
51
|
|
|
@@ -59,7 +60,7 @@ pyRofex.initialize(...)
|
|
|
59
60
|
# Get instrument list by given cfi code or segment:
|
|
60
61
|
response = pyRofex.get_instruments('by_cfi', ...)
|
|
61
62
|
response = pyRofex.get_instruments('by_segments', ...)
|
|
62
|
-
data = InstrumentsByResponse.
|
|
63
|
+
data = InstrumentsByResponse.model_validate(response)
|
|
63
64
|
print(data.instruments)
|
|
64
65
|
```
|
|
65
66
|
|
|
@@ -73,7 +74,7 @@ pyRofex.initialize(...)
|
|
|
73
74
|
|
|
74
75
|
# Get detailed instrument list
|
|
75
76
|
response = pyRofex.get_detailed_instruments()
|
|
76
|
-
data = DetailedInstrumentsResponse.
|
|
77
|
+
data = DetailedInstrumentsResponse.model_validate(response)
|
|
77
78
|
print(data.instruments)
|
|
78
79
|
```
|
|
79
80
|
|
|
@@ -87,7 +88,7 @@ pyRofex.initialize(...)
|
|
|
87
88
|
|
|
88
89
|
# Get instrument details
|
|
89
90
|
response = pyRofex.get_instrument_details(ticker="MERV - XMEV - AAPL - 24hs")
|
|
90
|
-
data = InstrumentDetailsResponse.
|
|
91
|
+
data = InstrumentDetailsResponse.model_validate(response)
|
|
91
92
|
print(data.instrument)
|
|
92
93
|
```
|
|
93
94
|
|
|
@@ -101,12 +102,12 @@ pyRofex.initialize(...)
|
|
|
101
102
|
|
|
102
103
|
# Get all order reports for the configured account
|
|
103
104
|
response = pyRofex.get_all_orders_status()
|
|
104
|
-
data = OrderStatusResponse.
|
|
105
|
+
data = OrderStatusResponse.model_validate(response)
|
|
105
106
|
print(data.orders)
|
|
106
107
|
|
|
107
108
|
# Get order status
|
|
108
109
|
response = pyRofex.get_order_status(...)
|
|
109
|
-
data = OrderStatusResponse.
|
|
110
|
+
data = OrderStatusResponse.model_validate(response)
|
|
110
111
|
print(data.order)
|
|
111
112
|
```
|
|
112
113
|
|
|
@@ -126,7 +127,7 @@ entries = [pyRofex.MarketDataEntry.BIDS,
|
|
|
126
127
|
pyRofex.MarketDataEntry.LAST]
|
|
127
128
|
|
|
128
129
|
response = pyRofex.get_market_data(ticker="MERV - XMEV - AAPL - 24hs", entries=entries)
|
|
129
|
-
data = MarketDataResponse.
|
|
130
|
+
data = MarketDataResponse.model_validate(response)
|
|
130
131
|
|
|
131
132
|
if data.status == StatusResponse.OK:
|
|
132
133
|
md = data.market_data
|
|
@@ -154,7 +155,7 @@ new_order = Order(
|
|
|
154
155
|
)
|
|
155
156
|
|
|
156
157
|
response = pyRofex.send_order(**new_order.model_dump())
|
|
157
|
-
data = OrderConfirmationResponse.
|
|
158
|
+
data = OrderConfirmationResponse.model_validate(response)
|
|
158
159
|
if data.status == StatusResponse.OK:
|
|
159
160
|
print(data.client_id)
|
|
160
161
|
```
|
|
@@ -169,7 +170,7 @@ pyRofex.initialize(...)
|
|
|
169
170
|
|
|
170
171
|
# Get account report
|
|
171
172
|
response = pyRofex.get_account_report(...)
|
|
172
|
-
data = AccountReportResponse.
|
|
173
|
+
data = AccountReportResponse.model_validate(response)
|
|
173
174
|
print(data.account_data)
|
|
174
175
|
```
|
|
175
176
|
|
|
@@ -183,7 +184,7 @@ pyRofex.initialize(...)
|
|
|
183
184
|
|
|
184
185
|
# Get all positions for an account
|
|
185
186
|
response = pyRofex.get_account_report(...)
|
|
186
|
-
data = PositionsResponse.
|
|
187
|
+
data = PositionsResponse.model_validate(response)
|
|
187
188
|
print(data.positions)
|
|
188
189
|
```
|
|
189
190
|
|
|
@@ -197,7 +198,7 @@ pyRofex.initialize(...)
|
|
|
197
198
|
|
|
198
199
|
# Get detailed positions for an account
|
|
199
200
|
response = pyRofex.get_detailed_position(...)
|
|
200
|
-
data = DetailedPositionsResponse.
|
|
201
|
+
data = DetailedPositionsResponse.model_validate(response)
|
|
201
202
|
print(data.detailed_position)
|
|
202
203
|
```
|
|
203
204
|
|
|
@@ -22,7 +22,7 @@ pyRofex.initialize(...)
|
|
|
22
22
|
|
|
23
23
|
# Get all segments
|
|
24
24
|
response = pyRofex.get_segments()
|
|
25
|
-
data = SegmentsResponse.
|
|
25
|
+
data = SegmentsResponse.model_validate(response)
|
|
26
26
|
print(data.segments)
|
|
27
27
|
```
|
|
28
28
|
|
|
@@ -36,7 +36,7 @@ pyRofex.initialize(...)
|
|
|
36
36
|
|
|
37
37
|
# Get available instrument list
|
|
38
38
|
response = pyRofex.get_all_instruments()
|
|
39
|
-
data = AllInstrumentsResponse.
|
|
39
|
+
data = AllInstrumentsResponse.model_validate(response)
|
|
40
40
|
print(data.instruments)
|
|
41
41
|
```
|
|
42
42
|
|
|
@@ -51,7 +51,7 @@ pyRofex.initialize(...)
|
|
|
51
51
|
# Get instrument list by given cfi code or segment:
|
|
52
52
|
response = pyRofex.get_instruments('by_cfi', ...)
|
|
53
53
|
response = pyRofex.get_instruments('by_segments', ...)
|
|
54
|
-
data = InstrumentsByResponse.
|
|
54
|
+
data = InstrumentsByResponse.model_validate(response)
|
|
55
55
|
print(data.instruments)
|
|
56
56
|
```
|
|
57
57
|
|
|
@@ -65,7 +65,7 @@ pyRofex.initialize(...)
|
|
|
65
65
|
|
|
66
66
|
# Get detailed instrument list
|
|
67
67
|
response = pyRofex.get_detailed_instruments()
|
|
68
|
-
data = DetailedInstrumentsResponse.
|
|
68
|
+
data = DetailedInstrumentsResponse.model_validate(response)
|
|
69
69
|
print(data.instruments)
|
|
70
70
|
```
|
|
71
71
|
|
|
@@ -79,7 +79,7 @@ pyRofex.initialize(...)
|
|
|
79
79
|
|
|
80
80
|
# Get instrument details
|
|
81
81
|
response = pyRofex.get_instrument_details(ticker="MERV - XMEV - AAPL - 24hs")
|
|
82
|
-
data = InstrumentDetailsResponse.
|
|
82
|
+
data = InstrumentDetailsResponse.model_validate(response)
|
|
83
83
|
print(data.instrument)
|
|
84
84
|
```
|
|
85
85
|
|
|
@@ -93,12 +93,12 @@ pyRofex.initialize(...)
|
|
|
93
93
|
|
|
94
94
|
# Get all order reports for the configured account
|
|
95
95
|
response = pyRofex.get_all_orders_status()
|
|
96
|
-
data = OrderStatusResponse.
|
|
96
|
+
data = OrderStatusResponse.model_validate(response)
|
|
97
97
|
print(data.orders)
|
|
98
98
|
|
|
99
99
|
# Get order status
|
|
100
100
|
response = pyRofex.get_order_status(...)
|
|
101
|
-
data = OrderStatusResponse.
|
|
101
|
+
data = OrderStatusResponse.model_validate(response)
|
|
102
102
|
print(data.order)
|
|
103
103
|
```
|
|
104
104
|
|
|
@@ -118,7 +118,7 @@ entries = [pyRofex.MarketDataEntry.BIDS,
|
|
|
118
118
|
pyRofex.MarketDataEntry.LAST]
|
|
119
119
|
|
|
120
120
|
response = pyRofex.get_market_data(ticker="MERV - XMEV - AAPL - 24hs", entries=entries)
|
|
121
|
-
data = MarketDataResponse.
|
|
121
|
+
data = MarketDataResponse.model_validate(response)
|
|
122
122
|
|
|
123
123
|
if data.status == StatusResponse.OK:
|
|
124
124
|
md = data.market_data
|
|
@@ -146,7 +146,7 @@ new_order = Order(
|
|
|
146
146
|
)
|
|
147
147
|
|
|
148
148
|
response = pyRofex.send_order(**new_order.model_dump())
|
|
149
|
-
data = OrderConfirmationResponse.
|
|
149
|
+
data = OrderConfirmationResponse.model_validate(response)
|
|
150
150
|
if data.status == StatusResponse.OK:
|
|
151
151
|
print(data.client_id)
|
|
152
152
|
```
|
|
@@ -161,7 +161,7 @@ pyRofex.initialize(...)
|
|
|
161
161
|
|
|
162
162
|
# Get account report
|
|
163
163
|
response = pyRofex.get_account_report(...)
|
|
164
|
-
data = AccountReportResponse.
|
|
164
|
+
data = AccountReportResponse.model_validate(response)
|
|
165
165
|
print(data.account_data)
|
|
166
166
|
```
|
|
167
167
|
|
|
@@ -175,7 +175,7 @@ pyRofex.initialize(...)
|
|
|
175
175
|
|
|
176
176
|
# Get all positions for an account
|
|
177
177
|
response = pyRofex.get_account_report(...)
|
|
178
|
-
data = PositionsResponse.
|
|
178
|
+
data = PositionsResponse.model_validate(response)
|
|
179
179
|
print(data.positions)
|
|
180
180
|
```
|
|
181
181
|
|
|
@@ -189,7 +189,7 @@ pyRofex.initialize(...)
|
|
|
189
189
|
|
|
190
190
|
# Get detailed positions for an account
|
|
191
191
|
response = pyRofex.get_detailed_position(...)
|
|
192
|
-
data = DetailedPositionsResponse.
|
|
192
|
+
data = DetailedPositionsResponse.model_validate(response)
|
|
193
193
|
print(data.detailed_position)
|
|
194
194
|
```
|
|
195
195
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: primary-api-models
|
|
3
|
-
Version: 0.4.
|
|
3
|
+
Version: 0.4.3
|
|
4
4
|
Summary: Primary API models
|
|
5
5
|
Author-email: Chi Tudi <chitudi54@gmail.com>
|
|
6
6
|
Requires-Python: >=3.8
|
|
7
7
|
Description-Content-Type: text/markdown
|
|
8
|
+
Requires-Dist: pydantic==2.13.4
|
|
8
9
|
|
|
9
10
|
# Primary API Models
|
|
10
11
|
Models for Primary API (REST / WS) messages
|
|
@@ -30,7 +31,7 @@ pyRofex.initialize(...)
|
|
|
30
31
|
|
|
31
32
|
# Get all segments
|
|
32
33
|
response = pyRofex.get_segments()
|
|
33
|
-
data = SegmentsResponse.
|
|
34
|
+
data = SegmentsResponse.model_validate(response)
|
|
34
35
|
print(data.segments)
|
|
35
36
|
```
|
|
36
37
|
|
|
@@ -44,7 +45,7 @@ pyRofex.initialize(...)
|
|
|
44
45
|
|
|
45
46
|
# Get available instrument list
|
|
46
47
|
response = pyRofex.get_all_instruments()
|
|
47
|
-
data = AllInstrumentsResponse.
|
|
48
|
+
data = AllInstrumentsResponse.model_validate(response)
|
|
48
49
|
print(data.instruments)
|
|
49
50
|
```
|
|
50
51
|
|
|
@@ -59,7 +60,7 @@ pyRofex.initialize(...)
|
|
|
59
60
|
# Get instrument list by given cfi code or segment:
|
|
60
61
|
response = pyRofex.get_instruments('by_cfi', ...)
|
|
61
62
|
response = pyRofex.get_instruments('by_segments', ...)
|
|
62
|
-
data = InstrumentsByResponse.
|
|
63
|
+
data = InstrumentsByResponse.model_validate(response)
|
|
63
64
|
print(data.instruments)
|
|
64
65
|
```
|
|
65
66
|
|
|
@@ -73,7 +74,7 @@ pyRofex.initialize(...)
|
|
|
73
74
|
|
|
74
75
|
# Get detailed instrument list
|
|
75
76
|
response = pyRofex.get_detailed_instruments()
|
|
76
|
-
data = DetailedInstrumentsResponse.
|
|
77
|
+
data = DetailedInstrumentsResponse.model_validate(response)
|
|
77
78
|
print(data.instruments)
|
|
78
79
|
```
|
|
79
80
|
|
|
@@ -87,7 +88,7 @@ pyRofex.initialize(...)
|
|
|
87
88
|
|
|
88
89
|
# Get instrument details
|
|
89
90
|
response = pyRofex.get_instrument_details(ticker="MERV - XMEV - AAPL - 24hs")
|
|
90
|
-
data = InstrumentDetailsResponse.
|
|
91
|
+
data = InstrumentDetailsResponse.model_validate(response)
|
|
91
92
|
print(data.instrument)
|
|
92
93
|
```
|
|
93
94
|
|
|
@@ -101,12 +102,12 @@ pyRofex.initialize(...)
|
|
|
101
102
|
|
|
102
103
|
# Get all order reports for the configured account
|
|
103
104
|
response = pyRofex.get_all_orders_status()
|
|
104
|
-
data = OrderStatusResponse.
|
|
105
|
+
data = OrderStatusResponse.model_validate(response)
|
|
105
106
|
print(data.orders)
|
|
106
107
|
|
|
107
108
|
# Get order status
|
|
108
109
|
response = pyRofex.get_order_status(...)
|
|
109
|
-
data = OrderStatusResponse.
|
|
110
|
+
data = OrderStatusResponse.model_validate(response)
|
|
110
111
|
print(data.order)
|
|
111
112
|
```
|
|
112
113
|
|
|
@@ -126,7 +127,7 @@ entries = [pyRofex.MarketDataEntry.BIDS,
|
|
|
126
127
|
pyRofex.MarketDataEntry.LAST]
|
|
127
128
|
|
|
128
129
|
response = pyRofex.get_market_data(ticker="MERV - XMEV - AAPL - 24hs", entries=entries)
|
|
129
|
-
data = MarketDataResponse.
|
|
130
|
+
data = MarketDataResponse.model_validate(response)
|
|
130
131
|
|
|
131
132
|
if data.status == StatusResponse.OK:
|
|
132
133
|
md = data.market_data
|
|
@@ -154,7 +155,7 @@ new_order = Order(
|
|
|
154
155
|
)
|
|
155
156
|
|
|
156
157
|
response = pyRofex.send_order(**new_order.model_dump())
|
|
157
|
-
data = OrderConfirmationResponse.
|
|
158
|
+
data = OrderConfirmationResponse.model_validate(response)
|
|
158
159
|
if data.status == StatusResponse.OK:
|
|
159
160
|
print(data.client_id)
|
|
160
161
|
```
|
|
@@ -169,7 +170,7 @@ pyRofex.initialize(...)
|
|
|
169
170
|
|
|
170
171
|
# Get account report
|
|
171
172
|
response = pyRofex.get_account_report(...)
|
|
172
|
-
data = AccountReportResponse.
|
|
173
|
+
data = AccountReportResponse.model_validate(response)
|
|
173
174
|
print(data.account_data)
|
|
174
175
|
```
|
|
175
176
|
|
|
@@ -183,7 +184,7 @@ pyRofex.initialize(...)
|
|
|
183
184
|
|
|
184
185
|
# Get all positions for an account
|
|
185
186
|
response = pyRofex.get_account_report(...)
|
|
186
|
-
data = PositionsResponse.
|
|
187
|
+
data = PositionsResponse.model_validate(response)
|
|
187
188
|
print(data.positions)
|
|
188
189
|
```
|
|
189
190
|
|
|
@@ -197,7 +198,7 @@ pyRofex.initialize(...)
|
|
|
197
198
|
|
|
198
199
|
# Get detailed positions for an account
|
|
199
200
|
response = pyRofex.get_detailed_position(...)
|
|
200
|
-
data = DetailedPositionsResponse.
|
|
201
|
+
data = DetailedPositionsResponse.model_validate(response)
|
|
201
202
|
print(data.detailed_position)
|
|
202
203
|
```
|
|
203
204
|
|
{primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models.egg-info/SOURCES.txt
RENAMED
|
@@ -18,6 +18,7 @@ primary_api_models/segments.py
|
|
|
18
18
|
primary_api_models.egg-info/PKG-INFO
|
|
19
19
|
primary_api_models.egg-info/SOURCES.txt
|
|
20
20
|
primary_api_models.egg-info/dependency_links.txt
|
|
21
|
+
primary_api_models.egg-info/requires.txt
|
|
21
22
|
primary_api_models.egg-info/top_level.txt
|
|
22
23
|
tests/test_model_dump.py
|
|
23
24
|
tests/test_models.py
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
pydantic==2.13.4
|
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
[build-system]
|
|
2
|
-
requires = ["setuptools>=61"
|
|
2
|
+
requires = ["setuptools>=61"]
|
|
3
3
|
build-backend = "setuptools.build_meta"
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "primary-api-models"
|
|
7
|
-
version = "0.4.
|
|
7
|
+
version = "0.4.3"
|
|
8
8
|
description = "Primary API models"
|
|
9
9
|
authors = [
|
|
10
10
|
{ name="Chi Tudi", email="chitudi54@gmail.com" }
|
|
11
11
|
]
|
|
12
12
|
readme = "README.md"
|
|
13
13
|
requires-python = ">=3.8"
|
|
14
|
+
dependencies = [
|
|
15
|
+
"pydantic==2.13.4"
|
|
16
|
+
]
|
|
14
17
|
|
|
15
18
|
[tool.setuptools.packages.find]
|
|
16
19
|
where = ["."]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/detailed_instruments.py
RENAMED
|
File without changes
|
{primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/detailed_position.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models/instrument_details.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{primary_api_models-0.4.1 → primary_api_models-0.4.3}/primary_api_models.egg-info/top_level.txt
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|