Skip to content

Commit b510b68

Browse files
Update snapshot min to support n and t (#447)
* Update snapshot min to support n and t
1 parent 9d32924 commit b510b68

File tree

5 files changed

+20
-4
lines changed

5 files changed

+20
-4
lines changed

polygon/rest/models/snapshot.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ class MinuteSnapshot:
1616
volume: Optional[float] = None
1717
vwap: Optional[float] = None
1818
otc: Optional[bool] = None
19+
timestamp: Optional[int] = None
20+
transactions: Optional[int] = None
1921

2022
@staticmethod
2123
def from_dict(d):
@@ -28,6 +30,8 @@ def from_dict(d):
2830
d.get("v", None),
2931
d.get("vw", None),
3032
d.get("otc", None),
33+
d.get("t", None),
34+
d.get("n", None),
3135
)
3236

3337

test_rest/mocks/v2/snapshot/locale/us/markets/stocks/gainers.json

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,9 @@
3535
"l": 6.42,
3636
"o": 6.49,
3737
"v": 2671,
38-
"vw": 6.4604
38+
"vw": 6.4604,
39+
"t": 1684428600000,
40+
"n": 5
3941
},
4042
"prevDay": {
4143
"c": 0.29,
@@ -81,7 +83,9 @@
8183
"l": 4.2107,
8284
"o": 4.2107,
8385
"v": 1012,
84-
"vw": 4.2107
86+
"vw": 4.2107,
87+
"t": 1684428600000,
88+
"n": 5
8589
},
8690
"prevDay": {
8791
"c": 0.1953,

test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/AAPL.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,9 @@
3232
"l": 160.3,
3333
"o": 160.71,
3434
"v": 197226,
35-
"vw": 160.5259
35+
"vw": 160.5259,
36+
"t": 1684428600000,
37+
"n": 5
3638
},
3739
"prevDay": {
3840
"c": 163.64,

test_rest/mocks/v2/snapshot/locale/us/markets/stocks/tickers/index.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,9 @@
3636
"l": 20.506,
3737
"o": 20.506,
3838
"v": 5000,
39-
"vw": 20.5105
39+
"vw": 20.5105,
40+
"t": 1684428600000,
41+
"n": 5
4042
},
4143
"prevDay": {
4244
"c": 20.63,

test_rest/test_snapshots.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,8 @@ def test_get_snapshot_all(self):
186186
close=20.506,
187187
volume=5000,
188188
vwap=20.5105,
189+
timestamp=1684428600000,
190+
transactions=5,
189191
),
190192
prev_day=Agg(
191193
open=20.79,
@@ -257,6 +259,8 @@ def test_get_snapshot_ticker(self):
257259
close=160.3,
258260
volume=197226,
259261
vwap=160.5259,
262+
timestamp=1684428600000,
263+
transactions=5,
260264
),
261265
prev_day=Agg(
262266
open=159.25,

0 commit comments

Comments
 (0)