Skip to content

Commit

Permalink
Merge branch 'v0.5rc' of github.com:toomore/grs
Browse files Browse the repository at this point in the history
  • Loading branch information
toomore committed Mar 3, 2014
2 parents 2ccc818 + d89a313 commit 25d96b2
Show file tree
Hide file tree
Showing 17 changed files with 7,645 additions and 129 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ python:
before_install: pip freeze
install:
- pip install -U "pip>=1.4" "setuptools>=0.9" "wheel>=0.21"
- python setup.py sdist bdist_egg bdist_wheel
- python setup.py sdist bdist bdist_egg bdist_wheel
- python setup.py install
script:
- python test_unittest.py
42 changes: 36 additions & 6 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
============================
grs 台灣上市股票價格擷取
============================
===============================
grs 台灣上市上櫃股票價格擷取
===============================

.. image:: https://secure.travis-ci.org/toomore/grs.png?branch=master
:target: http://travis-ci.org/toomore/grs
Expand All @@ -17,14 +17,17 @@ grs 台灣上市股票價格擷取
.. image:: https://pypip.in/license/grs/badge.png
:target: https://pypi.python.org/pypi/grs

主要開發擷取台灣股市(TWSE)股價資料,資料來源 `證券交易所網站 <http://www.twse.com.tw/>`_ 。
主要開發擷取台灣股市(TWSE)股價資料

- 資料來源 `證券交易所網站 <http://www.twse.com.tw/>`_ 。
- 資料來源 `證券櫃檯買賣中心 <http://www.otc.org.tw/>`_ 。

-----------------------------
版本資訊
-----------------------------

:Authors: Toomore Chiang
:Version: 0.4.3 of 2014/01/22
:Version: 0.5.0 of 2014/03/04
:Python Version: Python 2.7, PyPy
:Docs: http://grs-docs.toomore.net/

Expand Down Expand Up @@ -76,6 +79,27 @@ Quick Start

stock.out_putfile('/dev/shm/2618.csv')


擷取上櫃股價資訊

::

from grs import Stock

stock = Stock('8446') # 擷取華研股價
print stock.moving_average(5) # 計算五日均價與持續天數
print stock.moving_average_value(5) # 計算五日均量與持續天數
print stock.moving_average_bias_ratio(5, 10) # 計算五日、十日乖離值與持續天數


如果已確定該代碼為上市或上櫃股票,可以直接指定參數跳過查表動作。

::

stock = Stock('2618', twse=True) # 擷取長榮航股價
stock = Stock('8446', otc=True) # 擷取華研股價


-----------------------------
其他功能
-----------------------------
Expand Down Expand Up @@ -278,10 +302,16 @@ Quick Start
Change Logs
-----------------------------

0.5.0 2014/03/04
====================================

- 新增:上櫃資訊( `櫃台買賣中心 <http://gretai.org.tw>`_ )
- 修正:股票代碼列表回傳(TWSENo)代碼值改為 *string*.

0.4.3 2014/01/22
====================================

- 新增:`grs 文件 <http://grs-docs.toomore.net>`_.
- 新增: `grs 文件 <http://grs-docs.toomore.net>`_.

0.4.2 2014/01/11
====================================
Expand Down
4 changes: 2 additions & 2 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,9 @@
# built documents.
#
# The short X.Y version.
version = '0.4'
version = '0.5'
# The full version, including alpha/beta/rc tags.
release = '0.4.3'
release = '0.5.0'

# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
Expand Down
26 changes: 26 additions & 0 deletions docs/source/fetch_data.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,31 @@
Stock 擷取股票資訊
==========================


擷取股票股價(上市 / 上櫃)
---------------------------
.. autoclass:: grs.Stock
:members:

擷取上市股票股價
---------------------------
.. autoclass:: grs.fetch_data.TWSEFetch
:show-inheritance:
:inherited-members:

擷取上櫃股票股價
---------------------------
.. autoclass:: grs.fetch_data.OTCFetch
:show-inheritance:
:inherited-members:

簡單分析工具
---------------------------
.. autoclass:: grs.fetch_data.SimpleAnalytics
:members:

擷取工具
---------------------------
.. autoclass:: grs.fetch_data.FetchData
:show-inheritance:
:inherited-members:
22 changes: 15 additions & 7 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
Welcome to grs's documentation!
===============================

============================
grs 台灣上市股票價格擷取
============================
=================================
grs 台灣上市上櫃股票價格擷取
=================================

.. image:: https://secure.travis-ci.org/toomore/grs.png?branch=master
:target: http://travis-ci.org/toomore/grs
Expand All @@ -25,13 +25,17 @@ grs 台灣上市股票價格擷取
.. image:: https://pypip.in/license/grs/badge.png
:target: https://pypi.python.org/pypi/grs

主要開發擷取台灣股市(TWSE)股價資料,資料來源 `證券交易所網站 <http://www.twse.com.tw/>`_ 。
主要開發擷取台灣股市(TWSE)股價資料

- 資料來源 `證券交易所網站 <http://www.twse.com.tw/>`_ 。
- 資料來源 `證券櫃檯買賣中心 <http://www.otc.org.tw/>`_ 。


版本資訊
-----------------------------

:Authors: Toomore Chiang
:Version: 0.4.3 of 2014/01/22
:Version: 0.5.0 of 2014/03/04
:Python Version: Python 2.7, PyPy
:Docs: http://grs-docs.toomore.net/

Expand Down Expand Up @@ -66,7 +70,7 @@ Feature
:maxdepth: 2

擷取股票資訊 grs.Stock <fetch_data>
上市股票列表 grs.TWSENo <twseno>
股票列表 grs.TWSENo / grs.OTCNo <twseno>
判斷是否開市 grs.TWSEOpen <twseopen>
時間、倒數處理 grs.TWTime/Countdown <tw_time>
盤中即時資訊擷取 grs.RealtimeStock/RealtimeWeight <realtime>
Expand All @@ -76,8 +80,12 @@ Feature
Change Logs
-----------------------------

* 0.5.0 2014/03/04
- 新增:上櫃資訊( `櫃台買賣中心 <http://gretai.org.tw>`_ )
- 修正:股票代碼列表回傳(TWSENo)代碼值改為 *string*.

* 0.4.3 2014/01/22
- 新增:`grs 文件 <http://grs-docs.toomore.net>`_.
- 新增: `grs 文件 <http://grs-docs.toomore.net>`_.

* 0.4.2 2014/01/11
- 修正:Stock ``stock_no``, RealtimeStock ``no`` 必須為 *string*.
Expand Down
23 changes: 22 additions & 1 deletion docs/source/quick-start.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,29 @@ Quick Start

stock.out_putfile('/dev/shm/2618.csv')

.. seealso:: :doc:`fetch_data`

擷取上櫃股價資訊
-----------------------------

::

from grs import Stock

stock = Stock('8446') # 擷取華研股價
print stock.moving_average(5) # 計算五日均價與持續天數
print stock.moving_average_value(5) # 計算五日均量與持續天數
print stock.moving_average_bias_ratio(5, 10) # 計算五日、十日乖離值與持續天數


如果已確定該代碼為上市或上櫃股票,可以直接指定參數跳過查表動作。

::

stock = Stock('2618', twse=True) # 擷取長榮航股價
stock = Stock('8446', otc=True) # 擷取華研股價


.. seealso:: :doc:`fetch_data`

顯示台灣時間:TWTime
-----------------------------
Expand Down
19 changes: 17 additions & 2 deletions docs/source/twseno.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
TWSENo 上市股票列表
上市 / 上櫃股票代碼列表
=======================

上市股票代碼列表
-----------------------------
.. autoclass:: grs.TWSENo
:members:
:show-inheritance:
:inherited-members:

上櫃股票代碼列表
-----------------------------
.. autoclass:: grs.OTCNo
:show-inheritance:
:inherited-members:

匯入上市上櫃股票列表檔案
-----------------------------
.. autoclass:: grs.twseno.ImportCSV
:show-inheritance:
:inherited-members:
3 changes: 2 additions & 1 deletion grs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
# THE SOFTWARE.

__title__ = 'grs'
__version__ = '0.4.3'
__version__ = '0.5.0'
__author__ = 'Toomore Chiang'
__license__ = 'MIT'
__copyright__ = 'Copyright (C) 2012, 2013, 2014 Toomore Chiang'
Expand All @@ -33,5 +33,6 @@
from .realtime import RealtimeWeight
from .tw_time import Countdown
from .tw_time import TWTime
from .twseno import OTCNo
from .twseno import TWSENo
from .twseopen import TWSEOpen
Loading

0 comments on commit 25d96b2

Please sign in to comment.