Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/cgoldberg/ystockquote
Fetch stock quote data from Yahoo Finance
https://github.com/cgoldberg/ystockquote
equities market market-data python python3 quotes stock stock-data stock-market yahoo-finance yahoo-finance-api
Last synced: about 7 hours ago
JSON representation
Fetch stock quote data from Yahoo Finance
- Host: GitHub
- URL: https://github.com/cgoldberg/ystockquote
- Owner: cgoldberg
- Created: 2013-03-24T20:48:52.000Z (over 11 years ago)
- Default Branch: master
- Last Pushed: 2017-10-01T19:42:18.000Z (about 7 years ago)
- Last Synced: 2024-11-03T06:32:55.336Z (6 days ago)
- Topics: equities, market, market-data, python, python3, quotes, stock, stock-data, stock-market, yahoo-finance, yahoo-finance-api
- Language: Python
- Homepage:
- Size: 46.9 KB
- Stars: 534
- Watchers: 63
- Forks: 181
- Open Issues: 34
-
Metadata Files:
- Readme: README.rst
Awesome Lists containing this project
- awesome-fintech - ystockquote - Retrieve stock quote data from Yahoo Finance (Python module). (Libraries / Python)
- awesome-quant - ystockquote - Retrieve stock quote data from Yahoo Finance. (Python / Data Sources)
- awesome-quant - ystockquote - Retrieve stock quote data from Yahoo Finance. (Python / Data Sources)
README
ystockquote
===========**Python module - fetch stock quote data from Yahoo Finance**
.. image:: https://travis-ci.org/cgoldberg/ystockquote.svg?branch=master
:target: https://travis-ci.org/cgoldberg/ystockquote----
* Created by: Corey Goldberg (2007,2008,2013, 2016)
* License: GNU LGPLv2+
* `Dev Home `_
* `PyPI `_----
~~~~~~~~~~~~
Requirements
~~~~~~~~~~~~Python 2.7 or Python 3.3+
~~~~~~~
Install
~~~~~~~`ytockquote` can be installed from `PyPI `_ with `pip `_::
$ pip install ystockquote
You can also clone the development repo to install (requires `git `_)::
$ git clone git://github.com/cgoldberg/ystockquote.git
$ cd ystockquote
$ python setup.py installTo run unit tests::
$ tox
~~~~~~~~~~~~~
Example Usage
~~~~~~~~~~~~~.. code:: python
>>> import ystockquote
>>> print(ystockquote.get_price_book('GOOGL'))
'51.18'
>>> print(ystockquote.get_bid_realtime('GOOGL'))
'904.77'
>>>.. code:: python
>>> import ystockquote
>>> from pprint import pprint
>>> pprint(ystockquote.get_historical_prices('GOOGL', '2013-01-03', '2013-01-08'))
{'2013-01-03': {'Adj Close': '723.67',
'Close': '723.67',
'High': '731.93',
'Low': '720.72',
'Open': '724.93',
'Volume': '2318200'},
'2013-01-04': {'Adj Close': '737.97',
'Close': '737.97',
'High': '741.47',
'Low': '727.68',
'Open': '729.34',
'Volume': '2763500'},
'2013-01-07': {'Adj Close': '734.75',
'Close': '734.75',
'High': '739.38',
'Low': '730.58',
'Open': '735.45',
'Volume': '1655700'},
'2013-01-08': {'Adj Close': '733.30',
'Close': '733.30',
'High': '736.30',
'Low': '724.43',
'Open': '735.54',
'Volume': '1676100'}}
>>>