[
  {
    "path": ".gitignore",
    "content": "__pycache__\n*.pyc\n*.egg-info\n.eggs\n.coverage\nbuild\ndist\ndocs/build\n\n*.sqlite\n.idea/"
  },
  {
    "path": ".travis.yml",
    "content": "sudo: false\n\nlanguage: python\n\nenv:\n  - PYTHON=2.7 PANDAS=0.22\n  - PYTHON=3.5 PANDAS=0.21\n  - PYTHON=3.6 PANDAS=0.23.0\n  - PYTHON=3.6 PANDAS=0.25.0\n  - PYTHON=3.6 PANDAS=\"MASTER\"\n\nmatrix:\n    allow_failures:\n        - env: PYTHON=3.6 PANDAS=\"MASTER\"\n        - env: PYTHON=2.7 PANDAS=0.22\n\ninstall:\n  # You may want to periodically update this, although the conda update\n  # conda line below will keep everything up-to-date.  We do this\n  # conditionally because it saves us some downloading if the version is\n  # the same.\n  - if [[ \"$PYTHON\" == \"2.7\" ]]; then\n      wget http://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O miniconda.sh;\n    else\n      wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh;\n    fi\n  - bash miniconda.sh -b -p $HOME/miniconda\n  - export PATH=\"$HOME/miniconda/bin:$PATH\"\n  - hash -r\n  - conda config --set always_yes yes --set changeps1 no\n  - conda config --add channels pandas\n  - conda update -q conda\n  # Useful for debugging any issues with conda\n  - conda info -a\n  - conda create -q -n test-environment python=$PYTHON nose coverage setuptools html5lib lxml\n  - source activate test-environment\n  - if [[ \"$PANDAS\" == \"MASTER\" ]]; then\n      conda install bottleneck numpy pytz python-dateutil;\n      PRE_WHEELS=\"https://7933911d6844c6c53a7d-47bd50c35cd79bd838daf386af554a83.ssl.cf2.rackcdn.com\";\n      pip install --pre --upgrade --timeout=60 -f $PRE_WHEELS pandas;\n    else\n      conda install bottleneck numpy pandas=$PANDAS;\n    fi\n\n  - pip install coveralls --quiet\n  - conda list\n  - python setup.py install\n\nscript:\n    - nosetests -v --with-coverage --cover-package=pandas_finance\n\nafter_success:\n  - coveralls\n\n"
  },
  {
    "path": "LICENSE.md",
    "content": "=======\nLicense\n=======\n\npandas is distributed under a 3-clause (\"Simplified\" or \"New\") BSD\nlicense. Parts of NumPy, SciPy, numpydoc, bottleneck, which all have\nBSD-compatible licenses, are included. Their licenses follow the pandas\nlicense.\n\npandas license\n==============\n\nCopyright (c) 2011-2012, Lambda Foundry, Inc. and PyData Development Team\nAll rights reserved.\n\nCopyright (c) 2008-2011 AQR Capital Management, LLC\nAll rights reserved.\n\nRedistribution and use in source and binary forms, with or without\nmodification, are permitted provided that the following conditions are\nmet:\n\n    * Redistributions of source code must retain the above copyright\n       notice, this list of conditions and the following disclaimer.\n\n    * Redistributions in binary form must reproduce the above\n       copyright notice, this list of conditions and the following\n       disclaimer in the documentation and/or other materials provided\n       with the distribution.\n\n    * Neither the name of the copyright holder nor the names of any\n       contributors may be used to endorse or promote products derived\n       from this software without specific prior written permission.\n\nTHIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS\n\"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT\nLIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR\nA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT\nOWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,\nSPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT\nLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\nDATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\nTHEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE\nOF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.\n\nAbout the Copyright Holders\n===========================\n\nAQR Capital Management began pandas development in 2008. Development was\nled by Wes McKinney. AQR released the source under this license in 2009.\nWes is now an employee of Lambda Foundry, and remains the pandas project\nlead.\n\nThe PyData Development Team is the collection of developers of the PyData\nproject. This includes all of the PyData sub-projects, including pandas. The\ncore team that coordinates development on GitHub can be found here:\nhttp://github.com/pydata.\n\nFull credits for pandas contributors can be found in the documentation.\n\nOur Copyright Policy\n====================\n\nPyData uses a shared copyright model. Each contributor maintains copyright\nover their contributions to PyData. However, it is important to note that\nthese contributions are typically only changes to the repositories. Thus,\nthe PyData source code, in its entirety, is not the copyright of any single\nperson or institution. Instead, it is the collective copyright of the\nentire PyData Development Team. If individual contributors want to maintain\na record of what changes/contributions they have specific copyright on,\nthey should indicate their copyright in the commit message of the change\nwhen they commit the change to one of the PyData repositories.\n\nWith this in mind, the following banner should be used in any source code\nfile to indicate the copyright and license terms:\n\n#-----------------------------------------------------------------------------\n# Copyright (c) 2012, PyData Development Team\n# All rights reserved.\n#\n# Distributed under the terms of the BSD Simplified License.\n#\n# The full license is in the LICENSE file, distributed with this software.\n#-----------------------------------------------------------------------------\n\nOther licenses can be found in the LICENSES directory.\n"
  },
  {
    "path": "MANIFEST.in",
    "content": "include README.rst\ninclude LICENSE.md\ninclude pandas_finance/*.py\n\ninclude pandas_finance/tests/*.py\ninclude pandas_finance/tests/data/*\n"
  },
  {
    "path": "README.rst",
    "content": "pandas-finance\n=================\n\nHigh level API for access to and analysis of financial data.\n\n.. image:: https://travis-ci.org/davidastephens/pandas-finance.svg?branch=master\n    :target: https://travis-ci.org/davidastephens/pandas-finance\n\n.. image:: https://coveralls.io/repos/davidastephens/pandas-finance/badge.svg?branch=master\n    :target: https://coveralls.io/r/davidastephens/pandas-finance\n\n.. image:: https://readthedocs.org/projects/pandas-finance/badge/?version=latest\n    :target: http://pandas-finance.readthedocs.org/en/latest/\n\nInstallation\n------------\n\nInstall via pip\n\n.. code-block:: shell\n\n   $ pip install pandas-finance\n\nUsage\n-----\n\n.. code-block:: python\n\n   from pandas_finance import Equity\n   aapl = Equity('AAPL')\n   aapl.annual_dividend\n   aapl.dividend_yield\n   aapl.price\n   aapl.options\n   aapl.hist_vol(30)\n   aapl.rolling_hist_vol(30)\n\nData is automatically cached for 1 hr using requests_cache.\n\nSee the `pandas-finance documentation <http://pandas-finance.readthedocs.org/>`_ for more details.\n"
  },
  {
    "path": "docs/Makefile",
    "content": "# Makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS    =\nSPHINXBUILD   = sphinx-build\nPAPER         =\nBUILDDIR      = build\n\n# User-friendly check for sphinx-build\nifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)\n$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)\nendif\n\n# Internal variables.\nPAPEROPT_a4     = -D latex_paper_size=a4\nPAPEROPT_letter = -D latex_paper_size=letter\nALLSPHINXOPTS   = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source\n# the i18n builder cannot share the environment and doctrees with the others\nI18NSPHINXOPTS  = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source\n\n.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext\n\nhelp:\n\t@echo \"Please use \\`make <target>' where <target> is one of\"\n\t@echo \"  html       to make standalone HTML files\"\n\t@echo \"  dirhtml    to make HTML files named index.html in directories\"\n\t@echo \"  singlehtml to make a single large HTML file\"\n\t@echo \"  pickle     to make pickle files\"\n\t@echo \"  json       to make JSON files\"\n\t@echo \"  htmlhelp   to make HTML files and a HTML help project\"\n\t@echo \"  qthelp     to make HTML files and a qthelp project\"\n\t@echo \"  devhelp    to make HTML files and a Devhelp project\"\n\t@echo \"  epub       to make an epub\"\n\t@echo \"  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter\"\n\t@echo \"  latexpdf   to make LaTeX files and run them through pdflatex\"\n\t@echo \"  latexpdfja to make LaTeX files and run them through platex/dvipdfmx\"\n\t@echo \"  text       to make text files\"\n\t@echo \"  man        to make manual pages\"\n\t@echo \"  texinfo    to make Texinfo files\"\n\t@echo \"  info       to make Texinfo files and run them through makeinfo\"\n\t@echo \"  gettext    to make PO message catalogs\"\n\t@echo \"  changes    to make an overview of all changed/added/deprecated items\"\n\t@echo \"  xml        to make Docutils-native XML files\"\n\t@echo \"  pseudoxml  to make pseudoxml-XML files for display purposes\"\n\t@echo \"  linkcheck  to check all external links for integrity\"\n\t@echo \"  doctest    to run all doctests embedded in the documentation (if enabled)\"\n\nclean:\n\trm -rf $(BUILDDIR)/*\n\nhtml:\n\t$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/html.\"\n\ndirhtml:\n\t$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml\n\t@echo\n\t@echo \"Build finished. The HTML pages are in $(BUILDDIR)/dirhtml.\"\n\nsinglehtml:\n\t$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml\n\t@echo\n\t@echo \"Build finished. The HTML page is in $(BUILDDIR)/singlehtml.\"\n\npickle:\n\t$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle\n\t@echo\n\t@echo \"Build finished; now you can process the pickle files.\"\n\njson:\n\t$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json\n\t@echo\n\t@echo \"Build finished; now you can process the JSON files.\"\n\nhtmlhelp:\n\t$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp\n\t@echo\n\t@echo \"Build finished; now you can run HTML Help Workshop with the\" \\\n\t      \".hhp project file in $(BUILDDIR)/htmlhelp.\"\n\nqthelp:\n\t$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp\n\t@echo\n\t@echo \"Build finished; now you can run \"qcollectiongenerator\" with the\" \\\n\t      \".qhcp project file in $(BUILDDIR)/qthelp, like this:\"\n\t@echo \"# qcollectiongenerator $(BUILDDIR)/qthelp/pandas-finance.qhcp\"\n\t@echo \"To view the help file:\"\n\t@echo \"# assistant -collectionFile $(BUILDDIR)/qthelp/pandas-finance.qhc\"\n\ndevhelp:\n\t$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp\n\t@echo\n\t@echo \"Build finished.\"\n\t@echo \"To view the help file:\"\n\t@echo \"# mkdir -p $$HOME/.local/share/devhelp/pandas-finance\"\n\t@echo \"# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/pandas-finance\"\n\t@echo \"# devhelp\"\n\nepub:\n\t$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub\n\t@echo\n\t@echo \"Build finished. The epub file is in $(BUILDDIR)/epub.\"\n\nlatex:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo\n\t@echo \"Build finished; the LaTeX files are in $(BUILDDIR)/latex.\"\n\t@echo \"Run \\`make' in that directory to run these through (pdf)latex\" \\\n\t      \"(use \\`make latexpdf' here to do that automatically).\"\n\nlatexpdf:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo \"Running LaTeX files through pdflatex...\"\n\t$(MAKE) -C $(BUILDDIR)/latex all-pdf\n\t@echo \"pdflatex finished; the PDF files are in $(BUILDDIR)/latex.\"\n\nlatexpdfja:\n\t$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex\n\t@echo \"Running LaTeX files through platex and dvipdfmx...\"\n\t$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja\n\t@echo \"pdflatex finished; the PDF files are in $(BUILDDIR)/latex.\"\n\ntext:\n\t$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text\n\t@echo\n\t@echo \"Build finished. The text files are in $(BUILDDIR)/text.\"\n\nman:\n\t$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man\n\t@echo\n\t@echo \"Build finished. The manual pages are in $(BUILDDIR)/man.\"\n\ntexinfo:\n\t$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo\n\t@echo\n\t@echo \"Build finished. The Texinfo files are in $(BUILDDIR)/texinfo.\"\n\t@echo \"Run \\`make' in that directory to run these through makeinfo\" \\\n\t      \"(use \\`make info' here to do that automatically).\"\n\ninfo:\n\t$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo\n\t@echo \"Running Texinfo files through makeinfo...\"\n\tmake -C $(BUILDDIR)/texinfo info\n\t@echo \"makeinfo finished; the Info files are in $(BUILDDIR)/texinfo.\"\n\ngettext:\n\t$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale\n\t@echo\n\t@echo \"Build finished. The message catalogs are in $(BUILDDIR)/locale.\"\n\nchanges:\n\t$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes\n\t@echo\n\t@echo \"The overview file is in $(BUILDDIR)/changes.\"\n\nlinkcheck:\n\t$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck\n\t@echo\n\t@echo \"Link check complete; look for any errors in the above output \" \\\n\t      \"or in $(BUILDDIR)/linkcheck/output.txt.\"\n\ndoctest:\n\t$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest\n\t@echo \"Testing of doctests in the sources finished, look at the \" \\\n\t      \"results in $(BUILDDIR)/doctest/output.txt.\"\n\nxml:\n\t$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml\n\t@echo\n\t@echo \"Build finished. The XML files are in $(BUILDDIR)/xml.\"\n\npseudoxml:\n\t$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml\n\t@echo\n\t@echo \"Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml.\"\n"
  },
  {
    "path": "docs/make.bat",
    "content": "@ECHO OFF\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=sphinx-build\r\n)\r\nset BUILDDIR=build\r\nset ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% source\r\nset I18NSPHINXOPTS=%SPHINXOPTS% source\r\nif NOT \"%PAPER%\" == \"\" (\r\n\tset ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS%\r\n\tset I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS%\r\n)\r\n\r\nif \"%1\" == \"\" goto help\r\n\r\nif \"%1\" == \"help\" (\r\n\t:help\r\n\techo.Please use `make ^<target^>` where ^<target^> is one of\r\n\techo.  html       to make standalone HTML files\r\n\techo.  dirhtml    to make HTML files named index.html in directories\r\n\techo.  singlehtml to make a single large HTML file\r\n\techo.  pickle     to make pickle files\r\n\techo.  json       to make JSON files\r\n\techo.  htmlhelp   to make HTML files and a HTML help project\r\n\techo.  qthelp     to make HTML files and a qthelp project\r\n\techo.  devhelp    to make HTML files and a Devhelp project\r\n\techo.  epub       to make an epub\r\n\techo.  latex      to make LaTeX files, you can set PAPER=a4 or PAPER=letter\r\n\techo.  text       to make text files\r\n\techo.  man        to make manual pages\r\n\techo.  texinfo    to make Texinfo files\r\n\techo.  gettext    to make PO message catalogs\r\n\techo.  changes    to make an overview over all changed/added/deprecated items\r\n\techo.  xml        to make Docutils-native XML files\r\n\techo.  pseudoxml  to make pseudoxml-XML files for display purposes\r\n\techo.  linkcheck  to check all external links for integrity\r\n\techo.  doctest    to run all doctests embedded in the documentation if enabled\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"clean\" (\r\n\tfor /d %%i in (%BUILDDIR%\\*) do rmdir /q /s %%i\r\n\tdel /q /s %BUILDDIR%\\*\r\n\tgoto end\r\n)\r\n\r\n\r\n%SPHINXBUILD% 2> nul\r\nif errorlevel 9009 (\r\n\techo.\r\n\techo.The 'sphinx-build' command was not found. Make sure you have Sphinx\r\n\techo.installed, then set the SPHINXBUILD environment variable to point\r\n\techo.to the full path of the 'sphinx-build' executable. Alternatively you\r\n\techo.may add the Sphinx directory to PATH.\r\n\techo.\r\n\techo.If you don't have Sphinx installed, grab it from\r\n\techo.http://sphinx-doc.org/\r\n\texit /b 1\r\n)\r\n\r\nif \"%1\" == \"html\" (\r\n\t%SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The HTML pages are in %BUILDDIR%/html.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"dirhtml\" (\r\n\t%SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"singlehtml\" (\r\n\t%SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"pickle\" (\r\n\t%SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can process the pickle files.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"json\" (\r\n\t%SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can process the JSON files.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"htmlhelp\" (\r\n\t%SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can run HTML Help Workshop with the ^\r\n.hhp project file in %BUILDDIR%/htmlhelp.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"qthelp\" (\r\n\t%SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; now you can run \"qcollectiongenerator\" with the ^\r\n.qhcp project file in %BUILDDIR%/qthelp, like this:\r\n\techo.^> qcollectiongenerator %BUILDDIR%\\qthelp\\pandas-finance.qhcp\r\n\techo.To view the help file:\r\n\techo.^> assistant -collectionFile %BUILDDIR%\\qthelp\\pandas-finance.ghc\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"devhelp\" (\r\n\t%SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"epub\" (\r\n\t%SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The epub file is in %BUILDDIR%/epub.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"latex\" (\r\n\t%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished; the LaTeX files are in %BUILDDIR%/latex.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"latexpdf\" (\r\n\t%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex\r\n\tcd %BUILDDIR%/latex\r\n\tmake all-pdf\r\n\tcd %BUILDDIR%/..\r\n\techo.\r\n\techo.Build finished; the PDF files are in %BUILDDIR%/latex.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"latexpdfja\" (\r\n\t%SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex\r\n\tcd %BUILDDIR%/latex\r\n\tmake all-pdf-ja\r\n\tcd %BUILDDIR%/..\r\n\techo.\r\n\techo.Build finished; the PDF files are in %BUILDDIR%/latex.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"text\" (\r\n\t%SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The text files are in %BUILDDIR%/text.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"man\" (\r\n\t%SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The manual pages are in %BUILDDIR%/man.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"texinfo\" (\r\n\t%SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"gettext\" (\r\n\t%SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The message catalogs are in %BUILDDIR%/locale.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"changes\" (\r\n\t%SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.The overview file is in %BUILDDIR%/changes.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"linkcheck\" (\r\n\t%SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Link check complete; look for any errors in the above output ^\r\nor in %BUILDDIR%/linkcheck/output.txt.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"doctest\" (\r\n\t%SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Testing of doctests in the sources finished, look at the ^\r\nresults in %BUILDDIR%/doctest/output.txt.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"xml\" (\r\n\t%SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The XML files are in %BUILDDIR%/xml.\r\n\tgoto end\r\n)\r\n\r\nif \"%1\" == \"pseudoxml\" (\r\n\t%SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml\r\n\tif errorlevel 1 exit /b 1\r\n\techo.\r\n\techo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml.\r\n\tgoto end\r\n)\r\n\r\n:end\r\n"
  },
  {
    "path": "docs/source/conf.py",
    "content": "# -*- coding: utf-8 -*-\n#\n# pandas-finance documentation build configuration file, created by\n# sphinx-quickstart on Sun Nov 22 14:31:26 2015.\n#\n# This file is execfile()d with the current directory set to its\n# containing dir.\n#\n# Note that not all possible configuration values are present in this\n# autogenerated file.\n#\n# All configuration values have a default; values that are commented out\n# serve to show the default.\n\nimport sys\nimport os\n\n# If extensions (or modules to document with autodoc) are in another directory,\n# add these directories to sys.path here. If the directory is relative to the\n# documentation root, use os.path.abspath to make it absolute, like shown here.\n#sys.path.insert(0, os.path.abspath('.'))\n\n# -- General configuration ------------------------------------------------\n\n# If your documentation needs a minimal Sphinx version, state it here.\n#needs_sphinx = '1.0'\n\n# Add any Sphinx extension module names here, as strings. They can be\n# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom\n# ones.\nextensions = [\n    'sphinx.ext.autodoc',\n    'sphinx.ext.doctest',\n    'sphinx.ext.viewcode',\n]\n\n# Add any paths that contain templates here, relative to this directory.\ntemplates_path = ['_templates']\n\n# The suffix of source filenames.\nsource_suffix = '.rst'\n\n# The encoding of source files.\n#source_encoding = 'utf-8-sig'\n\n# The master toctree document.\nmaster_doc = 'index'\n\n# General information about the project.\nproject = u'pandas-finance'\ncopyright = u'2015, David Stephens'\n\n# The version info for the project you're documenting, acts as replacement for\n# |version| and |release|, also used in various other places throughout the\n# built documents.\n#\n# The short X.Y version.\nversion = '0.1.0'\n# The full version, including alpha/beta/rc tags.\nrelease = '0.1.0'\n\n# The language for content autogenerated by Sphinx. Refer to documentation\n# for a list of supported languages.\n#language = None\n\n# There are two options for replacing |today|: either, you set today to some\n# non-false value, then it is used:\n#today = ''\n# Else, today_fmt is used as the format for a strftime call.\n#today_fmt = '%B %d, %Y'\n\n# List of patterns, relative to source directory, that match files and\n# directories to ignore when looking for source files.\nexclude_patterns = []\n\n# The reST default role (used for this markup: `text`) to use for all\n# documents.\n#default_role = None\n\n# If true, '()' will be appended to :func: etc. cross-reference text.\n#add_function_parentheses = True\n\n# If true, the current module name will be prepended to all description\n# unit titles (such as .. function::).\n#add_module_names = True\n\n# If true, sectionauthor and moduleauthor directives will be shown in the\n# output. They are ignored by default.\n#show_authors = False\n\n# The name of the Pygments (syntax highlighting) style to use.\npygments_style = 'sphinx'\n\n# A list of ignored prefixes for module index sorting.\n#modindex_common_prefix = []\n\n# If true, keep warnings as \"system message\" paragraphs in the built documents.\n#keep_warnings = False\n\n\n# -- Options for HTML output ----------------------------------------------\n\n# The theme to use for HTML and HTML Help pages.  See the documentation for\n# a list of builtin themes.\nhtml_theme = 'default'\n\n# Theme options are theme-specific and customize the look and feel of a theme\n# further.  For a list of options available for each theme, see the\n# documentation.\n#html_theme_options = {}\n\n# Add any paths that contain custom themes here, relative to this directory.\n#html_theme_path = []\n\n# The name for this set of Sphinx documents.  If None, it defaults to\n# \"<project> v<release> documentation\".\n#html_title = None\n\n# A shorter title for the navigation bar.  Default is the same as html_title.\n#html_short_title = None\n\n# The name of an image file (relative to this directory) to place at the top\n# of the sidebar.\n#html_logo = None\n\n# The name of an image file (within the static path) to use as favicon of the\n# docs.  This file should be a Windows icon file (.ico) being 16x16 or 32x32\n# pixels large.\n#html_favicon = None\n\n# Add any paths that contain custom static files (such as style sheets) here,\n# relative to this directory. They are copied after the builtin static files,\n# so a file named \"default.css\" will overwrite the builtin \"default.css\".\nhtml_static_path = ['_static']\n\n# Add any extra paths that contain custom files (such as robots.txt or\n# .htaccess) here, relative to this directory. These files are copied\n# directly to the root of the documentation.\n#html_extra_path = []\n\n# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,\n# using the given strftime format.\n#html_last_updated_fmt = '%b %d, %Y'\n\n# If true, SmartyPants will be used to convert quotes and dashes to\n# typographically correct entities.\n#html_use_smartypants = True\n\n# Custom sidebar templates, maps document names to template names.\n#html_sidebars = {}\n\n# Additional templates that should be rendered to pages, maps page names to\n# template names.\n#html_additional_pages = {}\n\n# If false, no module index is generated.\n#html_domain_indices = True\n\n# If false, no index is generated.\n#html_use_index = True\n\n# If true, the index is split into individual pages for each letter.\n#html_split_index = False\n\n# If true, links to the reST sources are added to the pages.\n#html_show_sourcelink = True\n\n# If true, \"Created using Sphinx\" is shown in the HTML footer. Default is True.\n#html_show_sphinx = True\n\n# If true, \"(C) Copyright ...\" is shown in the HTML footer. Default is True.\n#html_show_copyright = True\n\n# If true, an OpenSearch description file will be output, and all pages will\n# contain a <link> tag referring to it.  The value of this option must be the\n# base URL from which the finished HTML is served.\n#html_use_opensearch = ''\n\n# This is the file name suffix for HTML files (e.g. \".xhtml\").\n#html_file_suffix = None\n\n# Output file base name for HTML help builder.\nhtmlhelp_basename = 'pandas-financedoc'\n\n\n# -- Options for LaTeX output ---------------------------------------------\n\nlatex_elements = {\n# The paper size ('letterpaper' or 'a4paper').\n#'papersize': 'letterpaper',\n\n# The font size ('10pt', '11pt' or '12pt').\n#'pointsize': '10pt',\n\n# Additional stuff for the LaTeX preamble.\n#'preamble': '',\n}\n\n# Grouping the document tree into LaTeX files. List of tuples\n# (source start file, target name, title,\n#  author, documentclass [howto, manual, or own class]).\nlatex_documents = [\n  ('index', 'pandas-finance.tex', u'pandas-finance Documentation',\n   u'David Stephens', 'manual'),\n]\n\n# The name of an image file (relative to this directory) to place at the top of\n# the title page.\n#latex_logo = None\n\n# For \"manual\" documents, if this is true, then toplevel headings are parts,\n# not chapters.\n#latex_use_parts = False\n\n# If true, show page references after internal links.\n#latex_show_pagerefs = False\n\n# If true, show URL addresses after external links.\n#latex_show_urls = False\n\n# Documents to append as an appendix to all manuals.\n#latex_appendices = []\n\n# If false, no module index is generated.\n#latex_domain_indices = True\n\n\n# -- Options for manual page output ---------------------------------------\n\n# One entry per manual page. List of tuples\n# (source start file, name, description, authors, manual section).\nman_pages = [\n    ('index', 'pandas-finance', u'pandas-finance Documentation',\n     [u'David Stephens'], 1)\n]\n\n# If true, show URL addresses after external links.\n#man_show_urls = False\n\n\n# -- Options for Texinfo output -------------------------------------------\n\n# Grouping the document tree into Texinfo files. List of tuples\n# (source start file, target name, title, author,\n#  dir menu entry, description, category)\ntexinfo_documents = [\n  ('index', 'pandas-finance', u'pandas-finance Documentation',\n   u'David Stephens', 'pandas-finance', 'One line description of project.',\n   'Miscellaneous'),\n]\n\n# Documents to append as an appendix to all manuals.\n#texinfo_appendices = []\n\n# If false, no module index is generated.\n#texinfo_domain_indices = True\n\n# How to display URL addresses: 'footnote', 'no', or 'inline'.\n#texinfo_show_urls = 'footnote'\n\n# If true, do not generate a @detailmenu in the \"Top\" node's menu.\n#texinfo_no_detailmenu = False\n"
  },
  {
    "path": "docs/source/index.rst",
    "content": ".. pandas-finance documentation master file, created by\n   sphinx-quickstart on Sun Nov 22 14:31:26 2015.\n   You can adapt this file completely to your liking, but it should at least\n   contain the root `toctree` directive.\n\nWelcome to pandas-finance's documentation!\n==========================================\n\nContents:\n\n.. toctree::\n   :maxdepth: 2\n\n\n\nIndices and tables\n==================\n\n* :ref:`genindex`\n* :ref:`modindex`\n* :ref:`search`\n\n"
  },
  {
    "path": "pandas_finance/__init__.py",
    "content": "__version__ = version = '0.1.3'\n\nfrom .api import Equity, Option, OptionChain\n"
  },
  {
    "path": "pandas_finance/api.py",
    "content": "import datetime\nimport math\nimport json\n\nimport pandas as pd\nfrom pandas import DataFrame, Series\nfrom pandas_datareader.yahoo.quotes import YahooQuotesReader\nimport yfinance as yf\n\nimport pandas_datareader.data as pdr\nimport requests_cache\nimport empyrical\n\nTRADING_DAYS = 252\nCACHE_HRS = 1\nSTART_DATE = datetime.date(1990, 1, 1)\nQUERY_STRING = \"https://query1.finance.yahoo.com/v10/finance/quoteSummary/{ticker}?lang=en-US&region=US&modules={modules}&corsDomain=finance.yahoo.com\"\nHEADERS = {\n    \"Connection\": \"keep-alive\",\n    \"Expires\": str(-1),\n    \"Upgrade-Insecure-Requests\": str(1),\n    # Google Chrome:\n    \"User-Agent\": (\n        \"Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 \"\n        \"(KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36\"\n    ),\n}\n_DEFAULT_PARAMS = {\n    \"lang\": \"en-US\",\n    \"corsDomain\": \"finance.yahoo.com\",\n    \".tsrc\": \"finance\",\n}\n\n\nclass FixedYahooQuotesReader(YahooQuotesReader):\n    def __init__(self, *args, crumb=None, **kwargs):\n        super(FixedYahooQuotesReader, self).__init__(*args, **kwargs)\n        self.crumb = crumb\n    def params(self, symbol):\n        params = super().params(symbol)\n        params.update({\"crumb\": self.crumb})\n        return params\n    def _read_lines(self, out):\n        data = json.loads(out.read())[\"quoteResponse\"][\"result\"][0]\n        idx = data.pop('symbol')\n        data[\"price\"] = data[\"regularMarketPrice\"]\n        return Series(data)\n\n\nclass Equity(object):\n    def __init__(self, ticker, session=None):\n        self.ticker = ticker\n        self.yf_ticker = yf.Ticker(self.ticker)\n\n        if session:\n            self._session = session\n        else:\n            self._session = self._get_session()\n            with self._session.cache_disabled():\n                self.crumb = self._session.get(\n                    'https://query1.finance.yahoo.com/v1/test/getcrumb').text\n\n    def _get_session(self):\n        session = requests_cache.CachedSession(\n            cache_name=\"pf-cache\",\n            backend=\"sqlite\",\n            expire_after=datetime.timedelta(hours=CACHE_HRS),\n        )\n        session.headers.update(HEADERS)\n        with session.cache_disabled():\n            session.get('https://fc.yahoo.com')\n        return session\n\n    @property\n    def options(self):\n        return OptionChain(self)\n\n    @property\n    def close(self):\n        \"\"\"Returns pandas series of closing price\"\"\"\n        return self.trading_data[\"Close\"]\n\n    @property\n    def adj_close(self):\n        \"\"\"Returns pandas series of closing price\"\"\"\n        return self.trading_data[\"Adj Close\"]\n\n    @property\n    def returns(self):\n        return self.adj_close.pct_change()\n\n    @property\n    def trading_data(self):\n        return self.yf_ticker.history(start=START_DATE)\n\n    @property\n    def actions(self):\n        return pdr.get_data_yahoo_actions(\n            self.ticker, session=self._session, start=START_DATE\n        )\n\n    @property\n    def dividends(self):\n        dividends = self.yf_ticker.get_dividends()\n        dividends.name = \"Dividends\"\n        return dividends\n\n    @property\n    def splits(self):\n        splits = self.yf_ticker.get_splits()\n        splits.name = \"Splits\"\n        return splits\n\n    @property\n    def annual_dividend(self):\n        if \"forwardAnnualDividendRate\" in self.quotes.index:\n            return self.quotes[\"forwardAnnualDividendRate\"]\n        elif \"trailingAnnualDividendRate\" in self.quotes.index:\n            return self.quotes[\"trailingAnnualDividendRate\"]\n        else:\n            return 0\n\n    @property\n    def dividend_yield(self):\n        return self.annual_dividend / self.price\n\n    @property\n    def price(self):\n        return self.quotes[\"price\"]\n\n    @property\n    def closed(self):\n        \"Market is closed or open\"\n        return self.quotes[\"marketState\"].lower() == \"closed\"\n\n    @property\n    def currency(self):\n        return self.quotes[\"currency\"]\n\n    @property\n    def market_cap(self):\n        return float(self.quotes[\"marketCap\"])\n\n    @property\n    def shares_os(self):\n        return int(self.quotes[\"sharesOutstanding\"])\n\n    def hist_vol(self, days, end_date=None):\n        days = int(days)\n        if end_date:\n            data = self.returns[:end_date]\n        else:\n            data = self.returns\n        data = data.iloc[-days:]\n        return data.std() * math.sqrt(TRADING_DAYS)\n\n    def rolling_hist_vol(self, days, end_date=None):\n        days = int(days)\n        if end_date:\n            data = self.returns[:end_date]\n        else:\n            data = self.returns\n        return data.rolling(days).std() * math.sqrt(TRADING_DAYS)\n\n    @property\n    def profile(self):\n        response = self._session.get(\n            QUERY_STRING.format(ticker=self.ticker, modules=\"assetProfile\")\n        ).json()\n        asset_profile = response[\"quoteSummary\"][\"result\"][0][\"assetProfile\"]\n        del asset_profile[\"companyOfficers\"]\n        profile = pd.DataFrame.from_dict(asset_profile, orient=\"index\")[0]\n        profile.name = \"\"\n        profile.index = [name.capitalize() for name in profile.index]\n        rename = {\"Fulltimeemployees\": \"Full Time Employees\"}\n        profile.rename(index=rename, inplace=True)\n\n        return profile\n\n    @property\n    def quotes(self):\n        return FixedYahooQuotesReader(self.ticker, session=self._session, crumb=self.crumb).read()\n\n    @property\n    def quote(self):\n        return self.quotes\n\n    @property\n    def sector(self):\n        return self.profile[\"Sector\"]\n\n    @property\n    def industry(self):\n        return self.profile[\"Industry\"]\n\n    @property\n    def employees(self):\n        return self.profile[\"Full Time Employees\"]\n\n    @property\n    def name(self):\n        return self.quotes[\"longName\"]\n\n    def alpha_beta(self, index, start=None, end=None):\n        index_rets = Equity(index).returns\n        rets = self.returns\n        data = pd.DataFrame()\n        data[\"Index\"] = index_rets\n        data[\"Rets\"] = rets\n        data = data.fillna(0)\n\n        if start:\n            data = data[start:]\n        if end:\n            data = data[start:end]\n\n        return empyrical.alpha_beta(data[\"Rets\"], data[\"Index\"])\n\n    def beta(self, index, start=None, end=None):\n        alpha, beta = self.alpha_beta(index, start, end)\n        return beta\n\n    def alpha(self, index, start=None, end=None):\n        alpha, beta = self.alpha_beta(index, start, end)\n        return alpha\n\n    def vwap(self, end_date=None, days=30):\n        days = int(days)\n        if end_date:\n            data = self.trading_data[:end_date]\n        else:\n            data = self.trading_data\n        data = data.iloc[-days:]\n        return (data[\"Close\"] * data[\"Volume\"]).sum() / data[\"Volume\"].sum()\n\n    def hist_vol_by_days(self, end_date=None, min_days=10, max_days=600):\n        \"Returns the historical vol for a range of trading days ending on end_date.\"\n        min_days = int(min_days)\n        max_days = int(max_days)\n        if end_date:\n            returns = self.returns[:end_date]\n        else:\n            returns = self.returns\n\n        output = {}\n        for i in range(min_days, max_days):\n            output[i] = returns[-i:].std() * math.sqrt(TRADING_DAYS)\n\n        return pd.Series(output)\n\n\nclass Option(object):\n    def __init__(self):\n        pass\n\n\nclass OptionChain(object):\n    def __init__(self, underlying):\n        self.underlying = underlying\n        self._session = self.underlying._session\n        self._pdr = pdr.Options(self.underlying.ticker, \"yahoo\", session=self._session)\n\n    @property\n    def all_data(self):\n        return self._pdr.get_all_data()\n\n    @property\n    def calls(self):\n        data = self.all_data\n        mask = data.index.get_level_values(\"Type\") == \"calls\"\n        return data[mask]\n\n    @property\n    def puts(self):\n        data = self.all_data\n        mask = data.index.get_level_values(\"Type\") == \"puts\"\n        return data[mask]\n\n    @property\n    def near_puts(self):\n        return self._pdr._chop_data(self.puts, 5, self.underlying.price)\n\n    @property\n    def near_calls(self):\n        return self._pdr._chop_data(self.calls, 5, self.underlying.price)\n\n    def __getattr__(self, key):\n        if hasattr(self._pdr, key):\n            return getattr(self._pdr, key)\n\n    def __dir__(self):\n        return sorted(set((dir(type(self)) + list(self.__dict__) + dir(self._pdr))))\n"
  },
  {
    "path": "pandas_finance/tests/__init__.py",
    "content": ""
  },
  {
    "path": "pandas_finance/tests/nosy.cfg",
    "content": "#sample config file section for nosy\n\n# Including this file in the paths to check allows you to change\n# nose's behaviour on the fly.\n\n[nosy]\n# Paths to check for changed files; changes cause nose to be run\nbase_path = ./\nglob_patterns = *.py\nexclude_patterns = *_flymake.*\nextra_paths = nosy.cfg\n# Command line options to pass to nose\noptions =\n# Command line arguments to pass to nose; e.g. part of test suite to run\ntests = \n"
  },
  {
    "path": "pandas_finance/tests/test_api.py",
    "content": "import datetime\nimport unittest\n\nimport pandas as pd\n\nfrom pandas_finance import Equity, OptionChain\n\n\nclass TestEquity(unittest.TestCase):\n    @classmethod\n    def setUpClass(cls):\n        cls.aapl = Equity(\"AAPL\")\n        cls.date = datetime.date(2013, 1, 25)\n        cls.tsla = Equity(\"TSLA\")\n\n    def test_equity_price(self):\n        self.assertAlmostEqual(self.aapl.close[self.date], 62.84, 2)\n\n    def test_historical_vol(self):\n        vol = self.aapl.hist_vol(30, end_date=self.date)\n        self.assertAlmostEqual(vol, 0.484, 3)\n\n    @unittest.skip(\"Yahoo options api broken\")\n    def test_options(self):\n        self.assertIsInstance(self.aapl.options, OptionChain)\n\n    def test_annual_dividend(self):\n        self.assertEqual(self.aapl.annual_dividend, 3.00)\n        self.assertEqual(self.tsla.annual_dividend, 0)\n\n    def test_dividends(self):\n        self.assertEqual(self.aapl.dividends[datetime.date(2015, 11, 5)], 0.52)\n\n    def test_splits(self):\n        self.assertAlmostEqual(self.aapl.splits[datetime.date(2014, 6, 9)], 0.142857, 5)\n\n    def test_dividends_no_data(self):\n        self.assertEqual(len(self.tsla.dividends), 0)\n\n    def test_price(self):\n        self.assertIsInstance(self.aapl.price, float)\n\n    def test_sector(self):\n        self.assertEqual(self.aapl.sector, \"Technology\")\n\n    def test_employees(self):\n        self.assertGreaterEqual(self.aapl.employees, 100000)\n\n    def test_industry(self):\n        self.assertEqual(self.aapl.industry, \"Consumer Electronics\")\n\n    def test_name(self):\n        self.assertEqual(self.aapl.name, \"Apple Inc.\")\n\n    def test_quotes(self):\n        self.assertIsInstance(self.aapl.quotes[\"price\"], float)\n\n    def test_quote(self):\n        self.assertIsInstance(self.aapl.quote[\"price\"], float)\n\n    def test_shares_os(self):\n        self.assertIsInstance(self.aapl.shares_os, int)\n\n    def test_market_cap(self):\n        self.assertIsInstance(self.aapl.market_cap, float)\n\n    def test_closed(self):\n        self.assertIsInstance(self.aapl.closed, bool)\n\n    def test_currency(self):\n        self.assertEqual(self.aapl.currency, \"USD\")\n\n    def test_rolling_hist_vol(self):\n        self.assertIsInstance(self.aapl.rolling_hist_vol(20), pd.Series)\n        self.assertAlmostEqual(self.aapl.rolling_hist_vol(20)[self.date], 0.562, 3)\n\n    def test_hist_vol_by_days(self):\n        self.assertIsInstance(self.aapl.hist_vol_by_days(), pd.Series)\n        self.assertAlmostEqual(self.aapl.hist_vol_by_days(self.date)[20], 0.562, 3)\n\n\nclass TestOptionChain(unittest.TestCase):\n    @classmethod\n    @unittest.skip(\"Skip option tests due to broken yahoo api\")\n    def setUpClass(cls):\n        cls.aapl = Equity(\"AAPL\")\n        cls.options = OptionChain(cls.aapl)\n\n    def test_options(self):\n        self.assertIsInstance(self.options.all_data, pd.DataFrame)\n\n    def test_calls(self):\n        self.assertIsInstance(self.options.calls, pd.DataFrame)\n        self.assertTrue(\n            (self.options.calls.index.get_level_values(\"Type\") == \"calls\").all()\n        )\n\n    def test_puts(self):\n        self.assertIsInstance(self.options.puts, pd.DataFrame)\n        self.assertTrue(\n            (self.options.puts.index.get_level_values(\"Type\") == \"puts\").all()\n        )\n\n    def test_near_calls(self):\n        self.assertIsInstance(self.options.near_calls, pd.DataFrame)\n        self.assertTrue(\n            (self.options.near_calls.index.get_level_values(\"Type\") == \"calls\").all()\n        )\n\n    def test_near_puts(self):\n        self.assertIsInstance(self.options.near_puts, pd.DataFrame)\n        self.assertTrue(\n            (self.options.near_puts.index.get_level_values(\"Type\") == \"puts\").all()\n        )\n\n\nclass TestOption(unittest.TestCase):\n    @classmethod\n    @unittest.skip(\"Skip option tests due to broken yahoo api\")\n    def setUpClass(cls):\n        cls.aapl = Equity(\"AAPL\")\n        cls.options = OptionChain(cls.aapl)\n\n    def test_options(self):\n        self.options.all_data\n"
  },
  {
    "path": "requirements.txt",
    "content": "pandas\nrequests-cache\npandas-datareader>=0.7.0\nempyrical\nyfinance\n\n"
  },
  {
    "path": "setup.cfg",
    "content": "[bdist_wheel]\nuniversal = 1"
  },
  {
    "path": "setup.py",
    "content": "#!/usr/bin/env python\n# -*- coding: utf-8 -*-\n\nfrom ast import parse\nimport os\nfrom setuptools import setup, find_packages\n\n\nNAME = 'pandas-finance'\n\n\ndef version():\n    \"\"\"Return version string.\"\"\"\n    with open(os.path.join(os.path.abspath(os.path.dirname(__file__)),\n                           'pandas_finance',\n                           '__init__.py')) as input_file:\n        for line in input_file:\n            if line.startswith('__version__'):\n                return parse(line).body[0].value.s\n\n\ndef readme():\n    with open('README.rst') as f:\n        return f.read()\n\ninstall_requires = []\nwith open(\"./requirements.txt\") as f:\n    install_requires = f.read().splitlines()\n\nsetup(\n    name=NAME,\n    version=version(),\n    description=\"High level API for access to and analysis of financial data.\",\n    long_description=readme(),\n    license='BSD License',\n    author='David Stephens',\n    author_email='david@davidstephens.io',\n    url='https://github.com/davidastephens/pandas-finance',\n    classifiers=[\n        'Development Status :: 1 - Planning',\n        'Environment :: Console',\n        'Intended Audience :: Science/Research',\n        'Operating System :: OS Independent',\n        'Programming Language :: Cython',\n        'Programming Language :: Python',\n        'Programming Language :: Python :: 2',\n        'Programming Language :: Python :: 2.7',\n        'Programming Language :: Python :: 3',\n        'Programming Language :: Python :: 3.2',\n        'Programming Language :: Python :: 3.3',\n        'Programming Language :: Python :: 3.4',\n        'Programming Language :: Python :: 3.5',\n        'Programming Language :: Python :: 3.6',\n        'Topic :: Scientific/Engineering',\n    ],\n    keywords='data',\n    install_requires=install_requires,\n    packages=find_packages(exclude=['contrib', 'docs', 'tests*']),\n    test_suite='tests',\n    zip_safe=False,\n)\n"
  },
  {
    "path": "tox.ini",
    "content": "[tox]\nenvlist=py{26,27,32,33,34}\n\n[testenv]\ncommands=\n    nosetests\ndeps=\n    nose\n\n[testenv:py26]\ndeps=\n    unittest2\n    {[testenv]deps}\n"
  }
]