Code Monkey home page Code Monkey logo

ystockquote's Introduction

ystockquote

Python module - fetch stock quote data from Yahoo Finance

https://travis-ci.org/cgoldberg/ystockquote.svg?branch=master
  • 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 install

To run unit tests:

$ tox

Example Usage

>>> import ystockquote
>>> print(ystockquote.get_price_book('GOOGL'))
'51.18'
>>> print(ystockquote.get_bid_realtime('GOOGL'))
'904.77'
>>>
>>> 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'}}
>>>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.