Skip to content

Commit 749f787

Browse files
committed
Add cli.py
1 parent d28251c commit 749f787

File tree

3 files changed

+23
-7
lines changed

3 files changed

+23
-7
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
venv
22
*.pyc
3+
test.py
34
*.DS_Store
4-
__pycache__
5+
__pycache__

README.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,15 @@
22
## 簡介
33
使用 Python 開發的台灣股市查詢分析軟體,投資股票需要花費許多時間研究,從選股到進場和出場,在這過程中,你可能會有個困擾,那就是每個網站的資訊都不齊全,財務報表、技術分析、公司新聞十分零散。YYJStock 將股票的重要資訊整合,並且自動化分析,讓投資股票省時簡單!
44
## 來源
5-
GUI 使用 [kivy](https://github.com/kivy/kivy) 模組
6-
使用 [yfinance](https://github.com/ranaroussi/yfinance) 查詢股價
7-
使用 [mplfinance](https://github.com/matplotlib/mplfinance) 生成K線和交易量圖表
8-
使用 [goodinfo](https://goodinfo.tw) 將股票名稱轉換成股票代碼
9-
字型使用「jf open 粉圓」由 [justfont](https://github.com/justfont/open-huninn-font) 設計
10-
圖片素材使用 [flaticon](https://www.flaticon.com)
5+
[kivy](https://github.com/kivy/kivy) GUI 模組
6+
[yfinance](https://github.com/ranaroussi/yfinance) 查詢股價
7+
[mplfinance](https://github.com/matplotlib/mplfinance) 生成K線和交易量圖表
8+
[goodinfo](https://goodinfo.tw) 財報資訊
9+
[justfont](https://github.com/justfont/open-huninn-font) 字型使用「jf open 粉圓」
10+
[flaticon](https://www.flaticon.com) 圖片素材
11+
## 指令
12+
```python3 cli.py -h``` 獲得指令列表
13+
```python3 cli.py 2330 5 10``` 搜尋股票代碼 2330 (台積電),第 5 列的財報資料(漲跌),取得 10 年的資料。
1114
## 速率限制
1215
Yahoo Finance API 每小時 2000 次 / 1 IP (約等於 每秒 2次)
1316
Goodinfo! 台灣股市資訊網 未知

cli.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import argparse
2+
from stock import Get
3+
4+
parser = argparse.ArgumentParser()
5+
parser.add_argument('code', help = '台灣股票代碼')
6+
parser.add_argument('columns', type = int, help = '搜尋第幾列的資料')
7+
parser.add_argument('years', type = int, help = '搜尋多少年度的資料')
8+
9+
args = parser.parse_args()
10+
11+
result = Get().goodinfo_fin(args.code, args.columns, args.years)
12+
print(result)

0 commit comments

Comments
 (0)