Commit 356bf50
committed
Add stock data source parameter
Add `force_data_source` parameter to Stock.__init__ allowing
manual selection of data source ('twse' or 'tpex'), this also
implied that we will not check if the stock ID exist in the database
or not.
For example, the TPEX has some warrants:
上櫃認購(售)權證,70000U,譜瑞群益39售07
上櫃認購(售)權證,70001U,宣德國票3A售01
which does not exist in the latest codes.
Perhaps someone would like to know their history price,
if they update the codes, twstock will block them down.
But, in this commit, you can explicit passing which data source
you want, and implicitly bypass the stock ID check:
# Skip stock ID validation (use with caution)
stock = twstock.Stock('731120', force_data_source="twse")1 parent 744fb6c commit 356bf50
1 file changed
+25
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
160 | 160 | | |
161 | 161 | | |
162 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
163 | 169 | | |
164 | | - | |
165 | | - | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
166 | 186 | | |
167 | 187 | | |
168 | 188 | | |
| |||
172 | 192 | | |
173 | 193 | | |
174 | 194 | | |
175 | | - | |
176 | | - | |
177 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
178 | 198 | | |
179 | 199 | | |
180 | 200 | | |
| |||
0 commit comments