台灣上市股票價格擷取(Fetch TWSE stock data)含台灣時間轉換、開休市判斷。
Project description
主要開發擷取台灣股市(TWSE)股價資料,資料來源 證券交易所網站 。
版本資訊
- Authors:
Toomore Chiang
- Version:
0.0.1x of 2012/03/10
- Python Version:
Python 2.6-2.7
Report Issue or get involved
Quick Start
簡單計算
from grs import stock g = stock(2618) # 擷取長榮航股價 print g.MA(5) # 計算五日均價與持續天數 print g.MAV(5) # 計算五日均量與持續天數
擷取 12 個月份資料
g = stock(2618, 12)
輸出 CSV 檔
g.out_putfile('/dev/shm/2618.csv')
其他功能
顯示台灣時間:TWTime
適用於其他時區查詢台灣當地時間。
from grs import TWTime t = TWTime() t.now # 顯示台灣此刻時間 t.localtime # 顯示當地此刻時間
判斷台灣股市是否開市:twseopen
from grs import twseopen from datetime import datetime t = twseopen() t.Dday(datetime.today()) # 判斷今天是否開市,回傳 True or False t.Dday(datetime(2012, 12, 22)) # 判斷 2012/12/22 是否開市
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grs-0.0.1a0310.tar.gz
(9.1 kB
view hashes)
Built Distribution
grs-0.0.1a0310-py2.7.egg
(13.6 kB
view hashes)