Skip to main content

retrieve stock quote data from Yahoo Finance

Project description

Python module - retrieve stock quote data from Yahoo Finance


Requirements

  • Python 2.7/3.2+

Install

ytockquote can be installed from PyPI with pip:

$ pip install ystockquote

You can also clone the development repo (requires git) to install and run unit-tests:

$ git clone git://github.com/cgoldberg/ystockquote.git
$ cd ystockquote
$ python setup.py install
$ python -m unittest discover

Example Usage

>>> import ystockquote
>>> ystockquote.get_price('GOOG')
'810.31'
>>> import ystockquote
>>> import pprint
>>> pprint.pprint(ystockquote.get_historical_prices('GOOG', '2013-01-03', '2013-01-08'))
[['Date', 'Open', 'High', 'Low', 'Close', 'Volume', 'Adj Close'],
 ['2013-01-08', '735.54', '736.30', '724.43', '733.30', '1676100', '733.30'],
 ['2013-01-07', '735.45', '739.38', '730.58', '734.75', '1655700', '734.75'],
 ['2013-01-04', '729.34', '741.47', '727.68', '737.97', '2763500', '737.97'],
 ['2013-01-03', '724.93', '731.93', '720.72', '723.67', '2318200', '723.67']]
>>>
>>> import ystockquote
>>> import pprint
>>> pprint.pprint(ystockquote.get_all('GOOG'))
{'avg_daily_volume': '2311630',
 'book_value': '217.332',
 'change': '0.00',
 'dividend_per_share': '0.00',
 'dividend_yield': 'N/A',
 'earnings_per_share': '32.214',
 'ebitda': '16.278B',
 'fifty_day_moving_avg': '802.107',
 'fifty_two_week_high': '844.00',
 'fifty_two_week_low': '556.52',
 'market_cap': '267.1B',
 'price': '810.31',
 'price_book_ratio': '3.73',
 'price_earnings_growth_ratio': '1.26',
 'price_earnings_ratio': '25.15',
 'price_sales_ratio': '5.32',
 'short_ratio': '1.90',
 'stock_exchange': '"NasdaqNM"',
 'two_hundred_day_moving_avg': '733.759',
 'volume': '3772'}
>>>

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

ystockquote-0.2.2.tar.gz (3.9 kB view details)

Uploaded Source

File details

Details for the file ystockquote-0.2.2.tar.gz.

File metadata

  • Download URL: ystockquote-0.2.2.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for ystockquote-0.2.2.tar.gz
Algorithm Hash digest
SHA256 ae33402a94552177fa6fff090337ebcb33dc457e0aa71c05a89eb5c5c58953cc
MD5 3ee8b6b5cff7eb52e56c4e833bd929e6
BLAKE2b-256 fa6a267dc227ecd676bc62c4e3aafa44a2993acffb6c68ffb51d36e85b07ee0c

See more details on using hashes here.

Supported by

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