Skip to main content

Get stock info from Yahoo! Finance

Project description

Stock AI

PyPI version Build Status

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/*

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':[
      '2019-01-02',
      '2019-01-03',
      '2019-01-04'
   ],
   'adjclose':[
      67.57575225830078,
      66.63513946533203,
      67.30841827392578
   ]
}

Project details


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.2.0.tar.gz (6.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stockai-1.2.0-py3-none-any.whl (18.6 kB view details)

Uploaded Python 3

File details

Details for the file stockai-1.2.0.tar.gz.

File metadata

  • Download URL: stockai-1.2.0.tar.gz
  • Upload date:
  • Size: 6.1 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

Hashes for stockai-1.2.0.tar.gz
Algorithm Hash digest
SHA256 dc2ad4c05d4c3a45b4b93e473518f035d92b23982f0061a55951593d3a9a2c17
MD5 c0c9f53bf1a4f09bde278ac65cc60487
BLAKE2b-256 21d7acbc316d010a45880c4e9dee10d280ad864a6da81acb734b95eee6c84a8f

See more details on using hashes here.

File details

Details for the file stockai-1.2.0-py3-none-any.whl.

File metadata

  • Download URL: stockai-1.2.0-py3-none-any.whl
  • Upload date:
  • Size: 18.6 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

Hashes for stockai-1.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d4ada0ca52fb7c0ccb3bd9adda483708d24a107ecd246c22bf2b7547cc938958
MD5 c4aef700e9fbafbd92316b651284da4f
BLAKE2b-256 a8605aefd4889273329429550df395a212545e11be8671868389451cb3e788c6

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page