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.
Metadata
Release files for stockai 1.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| stockai-1.5.0.tar.gz | 7.0 kB | Without provenance | Details for stockai-1.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| stockai-1.5.0-py3-none-any.whl | Python 3 | none | any | Details for stockai-1.5.0-py3-none-any.whl |
Total release size: 26.3 kB
Release files / stockai-1.5.0.tar.gz
| Download URL | stockai-1.5.0.tar.gz |
|---|---|
| Size | 7.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
bfb7914bbb5c0a825f2d3cdf638870488b408153b7be072074537e78cbbae75e
|
|
BLAKE2b-256 checksum How to use checksums |
c37f611b2e1c58b245c677ce7be4e538aa4991f0f0515f0da670ad7cfdb0aae1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Release files / stockai-1.5.0-py3-none-any.whl
| Download URL | stockai-1.5.0-py3-none-any.whl |
|---|---|
| Size | 19.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
36581236da29e9bfb18a106d26d03ce913e3399a3cf940c0445817e29dc37efe
|
|
BLAKE2b-256 checksum How to use checksums |
df6d337be5734499fde44512b764e5de56194f89f0f3df0dc0d5f58380d12d76
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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
|
Security for stockai 1.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.