toomore / grs

📈 台灣上市上櫃股票價格擷取(Fetch Taiwan Stock Exchange data)含即時盤、台灣時間轉換、開休市判斷。
http://pypi.python.org/pypi/grs
MIT License
430 stars 164 forks source link

Use current time to update latest stock list info from official sites #17

Open paullo0106 opened 9 years ago

paullo0106 commented 9 years ago

I think it would be more convenient and make more sense to use the current time rather than a hard-coded past time for generating csv files of the latest stock info, that's the main reason I made those changes :p

toomore commented 9 years ago

@paullo0106 這遇到六日或是沒開市日就抓不到資料 XD,不過感謝你的 PR,我這禮拜加入,感謝你。

paullo0106 commented 9 years ago

Oh yeah, I didn't think of weekend issue. Just made some more changes on those two files using urllib3 consistently (previously opened by you in issue #7)

paullo0106 commented 9 years ago

@toomore 針對你提的"六日或是沒開市日"的問題,我剛才加了一些程式碼: base on你原本的TWSEOpen d_day()延伸了一個recent_open_day() function,如果今天沒開市就往前一天去check,直到有開市的那天為止。 (原本在想會不會有infinite loop,但我還沒有試出這樣的日期,看起來d_day()支援的時間區間似乎滿完整的)