GithubHelp home page GithubHelp logo

twse's Introduction

twse

download data from TWSE(臺灣證券交易所)

用Python寫的小程式, 由台灣證券交易所的網站,下載特定的資料。 下載的範圍為自行指定的日期區間。

資料來源

Requirements

  • Python 3

  • dateutil套件

    先安裝python3-pip

    sudo apt install python3-pip
    

    再使用pip3安裝python-dateutil套件

    pip3 install python-dateutil
    pip3 install --upgrade pip
    
  • pandas套件

    sudo pip3 install pandas
    

Code structure

twse
├── all_data
├── FMTQIK
├── MI_5MINS
└── MI_5MINS_INDEX
File/Folder Description
.gitignore gitignore
all_data 整理後的資料
FMTQIK 檔案下載的存取目錄(每日市場成交資訊)
MI_5MINS 檔案下載的存取目錄(每5秒委託成交統計)
MI_5MINS_INDEX 檔案下載的存取目錄(每5秒指數盤後統計TWSE)
screenshots README.md使用的截圖
README.md README
download_csv.py 下載檔案的程式碼
pre_data.py 整理下載的csv資料,並存至 all data

日期設定

start_dt = date(2017, 11, 30)
end_dt = date(2017, 12, 4)

由程式碼中自行輸入所需的資料區間。

檢查檔案下載的存取目錄,若該檔案存在,不會重複下載。

每次下載檔案後會等待1~10秒才繼續進行,避免短時間內大量存取,影響網頁伺服器。

我的開發環境:

  • Ubuntu 16.04.3 LTS
  • Python 3.5.2
  • PyCharm Community Edition 2017.2.4

尚未在其他環境測試,不確定是否能支援。

twse's People

Contributors

olycats avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.