zipline_polygon_bundle 0.1.6__py3-none-any.whl → 0.1.7__py3-none-any.whl
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.
- zipline_polygon_bundle/adjustments.py +14 -10
- {zipline_polygon_bundle-0.1.6.dist-info → zipline_polygon_bundle-0.1.7.dist-info}/METADATA +1 -1
- {zipline_polygon_bundle-0.1.6.dist-info → zipline_polygon_bundle-0.1.7.dist-info}/RECORD +5 -5
- {zipline_polygon_bundle-0.1.6.dist-info → zipline_polygon_bundle-0.1.7.dist-info}/LICENSE +0 -0
- {zipline_polygon_bundle-0.1.6.dist-info → zipline_polygon_bundle-0.1.7.dist-info}/WHEEL +0 -0
@@ -64,8 +64,9 @@ def load_splits(
|
|
64
64
|
splits["split_from"] = splits["split_from"].astype(float)
|
65
65
|
splits["split_to"] = splits["split_to"].astype(float)
|
66
66
|
splits["ratio"] = splits["split_from"] / splits["split_to"]
|
67
|
-
|
68
|
-
|
67
|
+
# Only return columns Zipline wants.
|
68
|
+
# Polygon may add more columns in the future (as they did with `id`).
|
69
|
+
return splits[["sid", "effective_date", "ratio"]]
|
69
70
|
|
70
71
|
|
71
72
|
def load_polygon_dividends(
|
@@ -87,7 +88,9 @@ def load_polygon_dividends(
|
|
87
88
|
dividends = pd.DataFrame(dividends)
|
88
89
|
os.makedirs(os.path.dirname(dividends_path), exist_ok=True)
|
89
90
|
dividends.to_parquet(dividends_path)
|
90
|
-
print(
|
91
|
+
print(
|
92
|
+
f"Wrote {len(dividends)=} from Polygon list_dividends to {dividends_path=}"
|
93
|
+
)
|
91
94
|
# if len(dividends) < 10000:
|
92
95
|
# logging.error(f"Only got {len(dividends)=} from Polygon list_dividends.")
|
93
96
|
# We will always load from the file to avoid any chance of weird errors.
|
@@ -116,9 +119,9 @@ def load_chunked_polygon_dividends(
|
|
116
119
|
next_end_date = first_of_next_month - datetime.timedelta(days=1)
|
117
120
|
if next_end_date > last_end_date:
|
118
121
|
next_end_date = last_end_date
|
119
|
-
dividends_list.append(
|
120
|
-
config, next_start_end, next_end_date
|
121
|
-
)
|
122
|
+
dividends_list.append(
|
123
|
+
load_polygon_dividends(config, next_start_end, next_end_date)
|
124
|
+
)
|
122
125
|
next_start_end = next_end_date + datetime.timedelta(days=1)
|
123
126
|
return pd.concat(dividends_list)
|
124
127
|
|
@@ -145,7 +148,8 @@ def load_dividends(
|
|
145
148
|
},
|
146
149
|
inplace=True,
|
147
150
|
)
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
151
|
+
# Only return columns Zipline wants.
|
152
|
+
# Polygon may add more columns in the future (as they did with `id`).
|
153
|
+
return dividends[
|
154
|
+
["sid", "ex_date", "declared_date", "record_date", "pay_date", "amount"]
|
155
|
+
]
|
@@ -1,5 +1,5 @@
|
|
1
1
|
zipline_polygon_bundle/__init__.py,sha256=kFkI4ZEej7yeuSig2r59AWLGzqSVh0dON4wdreCeizA,595
|
2
|
-
zipline_polygon_bundle/adjustments.py,sha256=
|
2
|
+
zipline_polygon_bundle/adjustments.py,sha256=k8Ykc4zv49Z8m1veFnJNeoPcw1FMN2dAxqV6xWmUfLw,6814
|
3
3
|
zipline_polygon_bundle/bundle.py,sha256=De1IHUjAxoZRaE6fVXY4qa6E7t43q_ELXAmcnJOtJEc,19260
|
4
4
|
zipline_polygon_bundle/concat_all_aggs.py,sha256=vv0MDxbSJjgZzstUP1K084FRy3W7w6Tt7FymghwcfMU,9021
|
5
5
|
zipline_polygon_bundle/concat_all_aggs_partitioned.py,sha256=b-yvwlQMyv2JO8KeeNUFD0EL0giNxWkS9ukDczgIJ20,6349
|
@@ -8,7 +8,7 @@ zipline_polygon_bundle/polygon_file_reader.py,sha256=a-MTMc_FnecmB2Q1o_LE03IeqDY
|
|
8
8
|
zipline_polygon_bundle/process_all_aggs.py,sha256=QLgH2HpS27JvkMqG1dsG-D0FIUDdXw1IR_UaMIJfdeA,3075
|
9
9
|
zipline_polygon_bundle/split_aggs_by_ticker.py,sha256=HI_3nuN6E_VCq7LfOj4Dib_qm8wYME-jdXXX4rt-9YI,2150
|
10
10
|
zipline_polygon_bundle/tickers_and_names.py,sha256=VVtI2FD_Gr0YOpCXhUlU0Agg1_-Ul1XW374kVwjMJck,16506
|
11
|
-
zipline_polygon_bundle-0.1.
|
12
|
-
zipline_polygon_bundle-0.1.
|
13
|
-
zipline_polygon_bundle-0.1.
|
14
|
-
zipline_polygon_bundle-0.1.
|
11
|
+
zipline_polygon_bundle-0.1.7.dist-info/LICENSE,sha256=hIahDEOTzuHCU5J2nd07LWwkLW7Hko4UFO__ffsvB-8,34523
|
12
|
+
zipline_polygon_bundle-0.1.7.dist-info/METADATA,sha256=4XfjLKiVXX30yq2xGI-4kuA2b8fzB5J-8AXRzt65HkQ,46667
|
13
|
+
zipline_polygon_bundle-0.1.7.dist-info/WHEEL,sha256=XbeZDeTWKc1w7CSIyre5aMDU_-PohRwTQceYnisIYYY,88
|
14
|
+
zipline_polygon_bundle-0.1.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|