Get stock info from Yahoo! Finance
Project description
Stock AI
Python module to get stock data from Yahoo! Finance
This is an ongoing project. If you have any requests or contributions, please create a ticket
Install
From PyPI with pip
pip install stockai
Development
Create a virtual environment
python3 -m venv venv
source env/bin/activate
pip3 install -r requirements.txt
For MacOS, you may need to use this command in order to install ciso8601
ARCHFLAGS="-arch x86_64" pip install ciso8601
Running Tests
python -m unittest tests/*
Running Jupyter Notebook
pip install jupyter
jupyter notebook
Usage examples
from stockai import Stock
td = Stock('TD.TO')
print(td.get_summary_profile())
print(td.get_price())
print(td.get_currency())
Get Historical Prices
### The date format should be yyyy-mm-dd
td.get_historical_prices('2019-01-01', '2019-01-05')
### The result is a dictionary with ['volumn', 'low', 'open', 'hight', 'close', 'date', 'adjclose']
{
'volume':[
3930300,
5407700,
5103400
],
'low':[
67.12000274658203,
67.12000274658203,
67.66999816894531
],
'open':[
67.51000213623047,
68.11000061035156,
68.0
],
'high':[
68.43000030517578,
68.11000061035156,
68.1500015258789
],
'close':[
68.25,
67.30000305175781,
67.9800033569336
],
'date':[
1546439400,
1546525800,
1546612200
],
'adjclose':[
67.57575225830078,
66.63513946533203,
67.30841827392578
]
}
Disclaimer
This project is for learning purpose. This is not intended to be investment advice for trading purposes.
- USE AT YOUR OWN RISK.
- DO NOT LEVERAGE THIS IN ATTEMPT TO DISRUPT ORDERLY MARKET FUNCTIONS.
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
stockai-1.5.0.tar.gz
(7.0 kB
view details)
Built Distribution
stockai-1.5.0-py3-none-any.whl
(19.3 kB
view details)
File details
Details for the file stockai-1.5.0.tar.gz
.
File metadata
- Download URL: stockai-1.5.0.tar.gz
- Upload date:
- Size: 7.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfb7914bbb5c0a825f2d3cdf638870488b408153b7be072074537e78cbbae75e |
|
MD5 | e1f726877723deca7d9d95d8e38d73e2 |
|
BLAKE2b-256 | c37f611b2e1c58b245c677ce7be4e538aa4991f0f0515f0da670ad7cfdb0aae1 |
File details
Details for the file stockai-1.5.0-py3-none-any.whl
.
File metadata
- Download URL: stockai-1.5.0-py3-none-any.whl
- Upload date:
- Size: 19.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.3.0 pkginfo/1.7.0 requests/2.25.1 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.58.0 CPython/3.8.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36581236da29e9bfb18a106d26d03ce913e3399a3cf940c0445817e29dc37efe |
|
MD5 | 689b028c3c56db5bced5c946a72b4cc5 |
|
BLAKE2b-256 | df6d337be5734499fde44512b764e5de56194f89f0f3df0dc0d5f58380d12d76 |