11from typing import Optional , List
22from ...modelclass import modelclass
33
4+
45@modelclass
56class MarketExchanges :
67 "Contains exchange market status data."
78 nasdaq : Optional [str ] = None
89 nyse : Optional [str ] = None
910 otc : Optional [str ] = None
1011
12+
1113@modelclass
1214class FuturesAggregate :
1315 """Represents an aggregate for a futures contract."""
16+
1417 close : Optional [float ] = None
1518 dollar_volume : Optional [float ] = None
1619 high : Optional [float ] = None
@@ -25,11 +28,15 @@ class FuturesAggregate:
2528
2629 @staticmethod
2730 def from_dict (d ):
28- return FuturesAggregate (** {k : v for k , v in d .items () if k in FuturesAggregate .__annotations__ })
31+ return FuturesAggregate (
32+ ** {k : v for k , v in d .items () if k in FuturesAggregate .__annotations__ }
33+ )
34+
2935
3036@modelclass
3137class FuturesContract :
3238 """Represents a futures contract."""
39+
3340 active : Optional [bool ] = None
3441 as_of : Optional [str ] = None
3542 days_to_maturity : Optional [int ] = None
@@ -49,22 +56,30 @@ class FuturesContract:
4956
5057 @staticmethod
5158 def from_dict (d ):
52- return FuturesContract (** {k : v for k , v in d .items () if k in FuturesContract .__annotations__ })
59+ return FuturesContract (
60+ ** {k : v for k , v in d .items () if k in FuturesContract .__annotations__ }
61+ )
62+
5363
5464@modelclass
5565class FuturesMarketStatus :
5666 """Represents the market status for a futures product."""
67+
5768 exchange_code : Optional [str ] = None
5869 market_status : Optional [str ] = None
5970 product_code : Optional [str ] = None
6071
6172 @staticmethod
6273 def from_dict (d ):
63- return FuturesMarketStatus (** {k : v for k , v in d .items () if k in FuturesMarketStatus .__annotations__ })
74+ return FuturesMarketStatus (
75+ ** {k : v for k , v in d .items () if k in FuturesMarketStatus .__annotations__ }
76+ )
77+
6478
6579@modelclass
6680class FuturesProduct :
6781 """Represents a futures product."""
82+
6883 as_of : Optional [str ] = None
6984 asset_class : Optional [str ] = None
7085 asset_sub_class : Optional [str ] = None
@@ -86,21 +101,29 @@ class FuturesProduct:
86101
87102 @staticmethod
88103 def from_dict (d ):
89- return FuturesProduct (** {k : v for k , v in d .items () if k in FuturesProduct .__annotations__ })
104+ return FuturesProduct (
105+ ** {k : v for k , v in d .items () if k in FuturesProduct .__annotations__ }
106+ )
107+
90108
91109@modelclass
92110class FuturesScheduleEvent :
93111 """Represents a single event in a futures schedule."""
112+
94113 event : Optional [str ] = None
95114 timestamp : Optional [str ] = None
96115
97116 @staticmethod
98117 def from_dict (d ):
99- return FuturesScheduleEvent (** {k : v for k , v in d .items () if k in FuturesScheduleEvent .__annotations__ })
118+ return FuturesScheduleEvent (
119+ ** {k : v for k , v in d .items () if k in FuturesScheduleEvent .__annotations__ }
120+ )
121+
100122
101123@modelclass
102124class FuturesSchedule :
103125 """Represents a futures trading schedule."""
126+
104127 market_identifier_code : Optional [str ] = None
105128 product_code : Optional [str ] = None
106129 product_name : Optional [str ] = None
@@ -109,7 +132,11 @@ class FuturesSchedule:
109132
110133 @staticmethod
111134 def from_dict (d ):
112- schedule = [FuturesScheduleEvent .from_dict (e ) for e in d .get ("schedule" , [])] if d .get ("schedule" ) else None
135+ schedule = (
136+ [FuturesScheduleEvent .from_dict (e ) for e in d .get ("schedule" , [])]
137+ if d .get ("schedule" )
138+ else None
139+ )
113140 return FuturesSchedule (
114141 market_identifier_code = d .get ("market_identifier_code" ),
115142 product_code = d .get ("product_code" ),
@@ -118,9 +145,11 @@ def from_dict(d):
118145 session_end_date = d .get ("session_end_date" ),
119146 )
120147
148+
121149@modelclass
122150class FuturesQuote :
123151 """Represents a quote for a futures contract."""
152+
124153 ask_price : Optional [float ] = None
125154 ask_size : Optional [float ] = None
126155 ask_timestamp : Optional [int ] = None
@@ -133,11 +162,15 @@ class FuturesQuote:
133162
134163 @staticmethod
135164 def from_dict (d ):
136- return FuturesQuote (** {k : v for k , v in d .items () if k in FuturesQuote .__annotations__ })
165+ return FuturesQuote (
166+ ** {k : v for k , v in d .items () if k in FuturesQuote .__annotations__ }
167+ )
168+
137169
138170@modelclass
139171class FuturesTrade :
140172 """Represents a trade for a futures contract."""
173+
141174 price : Optional [float ] = None
142175 session_start_date : Optional [str ] = None
143176 size : Optional [float ] = None
@@ -146,4 +179,6 @@ class FuturesTrade:
146179
147180 @staticmethod
148181 def from_dict (d ):
149- return FuturesTrade (** {k : v for k , v in d .items () if k in FuturesTrade .__annotations__ })
182+ return FuturesTrade (
183+ ** {k : v for k , v in d .items () if k in FuturesTrade .__annotations__ }
184+ )
0 commit comments