Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/chriskyfung/pandas_stock_notebook
使用Pandas和Pandas Datareader的查詢香港股票的Jupyter Notebook範例
https://github.com/chriskyfung/pandas_stock_notebook
hkex hong-kong jupyter-notebook pandas pandas-datareader python quandl stock-prices
Last synced: about 1 month ago
JSON representation
使用Pandas和Pandas Datareader的查詢香港股票的Jupyter Notebook範例
- Host: GitHub
- URL: https://github.com/chriskyfung/pandas_stock_notebook
- Owner: chriskyfung
- License: other
- Created: 2021-06-30T13:35:48.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2022-09-02T07:37:25.000Z (over 2 years ago)
- Last Synced: 2024-11-11T05:45:55.445Z (3 months ago)
- Topics: hkex, hong-kong, jupyter-notebook, pandas, pandas-datareader, python, quandl, stock-prices
- Language: Jupyter Notebook
- Homepage: https://medium.com/p/6264c42959d3
- Size: 71.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# pandas stock notebook
  [![CC BY-NC-SA 4.0][cc-by-nc-sa-shield]][cc-by-nc-sa]
使用 Pandas 和 Pandas Datareader 的查詢香港股票的 Jupyter Notebook 範例
👇 **親自試試看** 👨💻
[](https://colab.research.google.com/github/chriskyfung/pandas_stock_notebook/blob/main/pandas_hkstock_datareader.ipynb) [](https://mybinder.org/v2/gh/chriskyfung/pandas_stock_notebook/main/?urlpath=lab)
* * *
## 安裝 Python Packages
```shell
pip install -r requirements.txt
```## 環境變數
請將您的 **Quandl API** 密鑰填寫至開發專案根目錄中的 `.env` 文件。
```shell
QUANDL_API_KEY=
```## 用法
### 從 stocks.py 載入 `stock_profile` 類別
```py
from stocks import stock_profilestocks = stock_profile()
```### 從 JSON 文件讀入股票組合清單及股票名稱索引
```py
stocks.loadJsonProfile('./stocks.json')
```### 從 Quandl 下載某一天的股票組合數據
```py
from datetime import datetickers = ['0001.hk', '0941.hk','1810.hk']
d = date(2021, 9, 15)stocks.cacheFromQuandl(tickers, d)
```## License
This work is licensed under a
[Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License][cc-by-nc-sa].[![CC BY-NC-SA 4.0][cc-by-nc-sa-image]][cc-by-nc-sa]
[cc-by-nc-sa]: http://creativecommons.org/licenses/by-nc-sa/4.0/
[cc-by-nc-sa-image]: https://licensebuttons.net/l/by-nc-sa/4.0/88x31.png
[cc-by-nc-sa-shield]: https://img.shields.io/badge/License-CC%20BY--NC--SA%204.0-lightgrey.svg