Source code for pynance.opt.retrieve

.. Copyright (c) 2015-2016 Marshall Farrier

Options - remote retrieval (:mod:`pynance.opt.retrieve`)

.. currentmodule:: pynance.opt.retrieve

from __future__ import absolute_import

import pandas_datareader as pdr

from .core import Options

[docs]def get(equity): """ Retrieve all current options chains for given equity. .. versionchanged:: 0.5.0 Eliminate special exception handling. Parameters ------------- equity : str Equity for which to retrieve options data. Returns ------------- optdata : :class:`~pynance.opt.core.Options` All options data for given equity currently available from Yahoo! Finance. Examples ------------- Basic usage:: >>> fopt = pn.opt.get('f') To show useful information (expiration dates, stock price, quote time) when retrieving options data, you can chain the call to :func:`get` with :meth:``:: >>> fopt = pn.opt.get('f').info() Expirations: ... Stock: 15.93 Quote time: 2015-03-07 16:00 """ _optmeta =, 'yahoo') _optdata = _optmeta.get_all_data() return Options(_optdata)