Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

'*' suffix of the date is not handled #37

Closed
ianlini opened this issue Mar 24, 2018 · 0 comments · Fixed by #38
Closed

'*' suffix of the date is not handled #37

ianlini opened this issue Mar 24, 2018 · 0 comments · Fixed by #38

Comments

@ianlini
Copy link
Contributor

ianlini commented Mar 24, 2018

symbol: 00694B
date: 106/06/08
eror message:

...
  File ".../python3.6/site-packages/twstock/stock.py", line 152, in fetch
    self.raw_data = [self.fetcher.fetch(year, month, self.sid)]
  File ".../python3.6/site-packages/twstock/stock.py", line 108, in fetch
    data['data'] = self.purify(data)
  File ".../python3.6/site-packages/twstock/stock.py", line 128, in purify
    return [self._make_datatuple(d) for d in original_data['aaData']]
  File ".../python3.6/site-packages/twstock/stock.py", line 128, in <listcomp>
    return [self._make_datatuple(d) for d in original_data['aaData']]
  File ".../python3.6/site-packages/twstock/stock.py", line 116, in _make_datatuple
    data[0] = datetime.datetime.strptime(self._convert_date(data[0]), '%Y/%m/%d')
  File "/usr/local/lib/python3.6/_strptime.py", line 565, in _strptime_datetime
    tt, fraction = _strptime(data_string, format)
  File "/usr/local/lib/python3.6/_strptime.py", line 365, in _strptime
    data_string[found.end():])
ValueError: unconverted data remains: *

The reason why there is :

「*」表示該日為該股票上櫃掛牌首日,其掛牌首日之漲跌係以當日收盤價減承銷價計算而得。

We should ignore this suffix.

mlouielu pushed a commit that referenced this issue Mar 26, 2018
* Ignore * suffix in date from TPEX

* Add unit test for *
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant