https://github.com/dalenguyen/stockai
Stock prediction with Machine Learning (Ongoing Project)
https://github.com/dalenguyen/stockai
python-package python3 stock stock-analysis stock-prices
Last synced: 6 months ago
JSON representation
Stock prediction with Machine Learning (Ongoing Project)
- Host: GitHub
- URL: https://github.com/dalenguyen/stockai
- Owner: dalenguyen
- License: gpl-3.0
- Created: 2019-03-11T02:10:35.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-05-23T00:51:52.000Z (over 2 years ago)
- Last Synced: 2024-04-25T07:44:31.451Z (over 1 year ago)
- Topics: python-package, python3, stock, stock-analysis, stock-prices
- Language: Python
- Homepage:
- Size: 315 KB
- Stars: 17
- Watchers: 5
- Forks: 7
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: changelog.md
- Contributing: contributing.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# Stock AI
[](https://badge.fury.io/py/stockai)
[](https://travis-ci.org/dalenguyen/stockai)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](https://github.com/dalenguyen/stockai/issues)_
## Install
From PyPI with pip
```sh
pip install stockai
```## Development
Create a virtual environment
```
python3 -m venv venv
source env/bin/activatepip3 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
```python
from stockai import Stock
td = Stock('TD.TO')print(td.get_summary_profile())
print(td.get_price())
print(td.get_currency())
```## Get Historical Prices
```python
### 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.