Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions polygon/rest/models/contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ class OptionsContract:
"OptionsContract contains data for a specified ticker symbol."
additional_underlyings: Optional[List[Underlying]] = None
cfi: Optional[str] = None
contract_type: Optional[str] = None
correction: Optional[str] = None
exercise_style: Optional[str] = None
expiration_date: Optional[str] = None
Expand All @@ -35,6 +36,7 @@ def from_dict(d):
if "additional_underlyings" not in d
else [Underlying.from_dict(u) for u in d["additional_underlyings"]],
cfi=d.get("cfi", None),
contract_type=d.get("contract_type", None),
correction=d.get("correction", None),
exercise_style=d.get("exercise_style", None),
expiration_date=d.get("expiration_date", None),
Expand Down
21 changes: 21 additions & 0 deletions test_rest/test_contracts.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ def test_get_options_contract(self):
expected = OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2024-01-19",
Expand All @@ -26,6 +27,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -39,6 +41,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -52,6 +55,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -65,6 +69,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -78,6 +83,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -91,6 +97,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -104,6 +111,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -117,6 +125,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -130,6 +139,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -143,6 +153,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -156,6 +167,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -169,6 +181,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -182,6 +195,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -195,6 +209,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -208,6 +223,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -221,6 +237,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -234,6 +251,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -247,6 +265,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -260,6 +279,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand All @@ -273,6 +293,7 @@ def test_list_options_contracts(self):
OptionsContract(
additional_underlyings=None,
cfi="OCASPS",
contract_type="call",
correction=None,
exercise_style="american",
expiration_date="2022-05-20",
Expand Down