Skip to content

Commit

Permalink
DOCS: Reformat documentation, repair/suppress Sphinx errors (#87)
Browse files Browse the repository at this point in the history
* DOC: Repair docs formatting
  • Loading branch information
addisonlynch authored Nov 12, 2018
1 parent e2e3908 commit eb5780b
Show file tree
Hide file tree
Showing 26 changed files with 251 additions and 248 deletions.
32 changes: 15 additions & 17 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
iexfinance
===============
==========

.. image:: https://travis-ci.org/addisonlynch/iexfinance.svg?branch=master
:target: https://travis-ci.org/addisonlynch/iexfinance
Expand All @@ -18,7 +18,9 @@ Python module to retrieve stock data from the
`Investors Exchange (IEX) <https://iextrading.com/>`__
`Developer API <https://iextrading.com/developer/>`__
platform. iexfinance provides real-time financial data from the various IEX
endpoints, as well as historical time-series data.
endpoints, including:



This data includes stock quotes, fundamentals, actions, and information. In
addition, support for IEX market data and statistics is provided.
Expand Down Expand Up @@ -60,14 +62,7 @@ endpoints are the `Stocks <https://iextrading.com/developer/docs/#stocks>`__
endpoints, which allow access to various information regarding equities,
including quotes, historical prices, dividends, and much more.

All top-level functions (such as ``Stock`` and ``get_historical_data``), allow
for `Request Parameters
<https://addisonlynch.github.io/usage.html#parameters>`__, which
include ``retry_count``, ``pause``, and ``session``. These parameters are
entirely optional. The first two deal with how unsuccessful requests are
handled, and the third allows for the passing of a cached ``requests-cache``
session (see `caching
<https://addisonlynch.github.io/iexfinance/caching.html>`__).
All top-level functions (such as ``Stock`` and ``get_historical_data``)

Stock Endpoints
^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -101,9 +96,7 @@ Pandas DataFrame and JSON (dict) output formatting are selected with the
df.head()
The resulting DataFrame will indexed by date, with a column for each OHLC
datapoint:

.. image:: /docs/source/images/dfdailyaapl.JPG
datapoint.

It's really simple to plot this data, using `matplotlib <https://matplotlib.org/>`__:

Expand All @@ -114,10 +107,6 @@ It's really simple to plot this data, using `matplotlib <https://matplotlib.org/
df.plot()
plt.show()
.. image:: /docs/source/images/plotdailyaapl.jpg

IEX Reference Data
^^^^^^^^^^^^^^^^^^

Expand Down Expand Up @@ -168,6 +157,15 @@ a given ticker.
get_stats_intraday()
Debugging \& Caching
--------------------

All functions (including ``Stock`` and ``get_historical_data``) allow
for `Request Parameters <https://addisonlynch.github.io/usage.html#parameters>`__, which
include ``retry_count``, ``pause``, and ``session``. These parameters are
entirely optional. The first two deal with how unsuccessful requests are
handled, and the third allows for the passing of a cached ``requests-cache``
session (see `caching <https://addisonlynch.github.io/iexfinance/caching.html>`__).

Contact
-------
Expand Down
10 changes: 5 additions & 5 deletions docs/source/about.rst
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
.. _about:

*****

About
*****
=====


IEX API Issues
==============
--------------

For issues the provider's API endpoints, see the IEX API `Github <https://github.com/iexg/IEX-API>`__. Further, the `IEX Status <https://twitter.com/iexstatus>`__ twitter account provides
updates about issues and service interruptions.


Filling a Void
==============
--------------

It seemed for a number of years that the primary sources of free US
equities data for Python developers were the Yahoo Finance and Google
Expand All @@ -37,4 +37,4 @@ endpoints we can access this data in a similar way as past.
iexfinance, a wrapper for this service, is written in a similar fashion
as both Lukasz Banasiak's Yahoo Finance wrapper and Hongtao Cai's Google
Finance wrapper, allowing for lookup of both individual symbols as well
as batch requests.
as batch requests.
9 changes: 4 additions & 5 deletions docs/source/caching.rst
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
.. _caching:

***************
Caching Queries
***************
===============

In some cases it is sensible to cache queries to avoid overloading the
IEX servers. ``iexfinance`` supports the caching of queries through
``requests_cache_``.

Tutorial
========
--------

Install ``requests-cache`` using pip:

Expand All @@ -25,11 +24,11 @@ top-level function you are using:
import datetime
from iexfinance import Stock
import requests_cache
expiry = datetime.timedelta(days=3)
session = requests_cache.CachedSession(cache_name='cache',
backend='sqlite', expire_after=expiry)
f = Stock("AAPL", session=session)
f.get_price()
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
html_static_path = []

# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
Expand Down
15 changes: 8 additions & 7 deletions docs/source/historical.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

.. currentmodule:: iexfinance

***************

Historical Data
***************
===============

Historical time series data is available through the top-level
``get_historical_data`` method, which sources the
Expand All @@ -15,14 +15,15 @@ Historical time series data is available through the top-level
Data can be retrieved from up to 5 years before the current date.

Usage
=====
-----

If no date parameters are passed, the start date will default to 2015/1/1
and the end date will default to the current date.

.. ipython:: python
:okwarning:
from iexfinance import get_historical_data
from iexfinance.stocks import get_historical_data
from datetime import datetime
start = datetime(2017, 2, 9)
Expand All @@ -32,15 +33,15 @@ and the end date will default to the current date.
f.loc["2017-02-09"]
Plotting
========
--------

With Pandas output formatting, we are able to plot historical price
movements using matplotlib.

.. ipython:: python
from iexfinance import get_historical_data
from iexfinance.stocks import get_historical_data
from datetime import datetime
import matplotlib.pyplot as plt
start = datetime(2017, 2, 9)
Expand All @@ -51,4 +52,4 @@ movements using matplotlib.
plt.title('Time series chart for AAPL')
plt.show()
.. image:: images/plotdailyaapl.jpg
.. image:: images/plotdailyaapl.jpg
11 changes: 6 additions & 5 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@

.. _index.documentation:

**************************************

Welcome to iexfinance's documentation!
**************************************
======================================

Contents
========
--------

.. toctree::
:maxdepth: 2
Expand All @@ -31,8 +31,9 @@ Contents
whatsnew.rst
about.rst
tutorial.rst
modules.rst

Modules
=======
-------

* `Modules <modules.html>`__
* `Modules <modules.html>`__
7 changes: 3 additions & 4 deletions docs/source/install.rst
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
.. _install:


*******
Install
*******
=======

Dependencies
============
------------

iexfinance relies on:

Expand All @@ -16,7 +15,7 @@ iexfinance relies on:
For testing requirements, see `testing <testing.html>`__.

Installation
============
------------

Latest stable release via pip (recommended):

Expand Down
22 changes: 11 additions & 11 deletions docs/source/market.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,8 @@
.. currentmodule:: iexfinance


***************
IEX Market Data
***************
===============

The following functions retrieve data from the `IEX Market Data <https://iextrading.com/developer/docs/#iex-market-data>`__ endpoints.

Expand All @@ -20,7 +19,7 @@ The following functions retrieve data from the `IEX Market Data <https://iextrad


TOPS
====
----

`TOPS <https://iextrading.com/developer/docs/#tops>`__ is IEX's
aggregated best quoted bid and offer position in near real time.
Expand All @@ -31,7 +30,7 @@ Access is available through the top-level function ``get_market_tops()``:
.. autofunction:: get_market_tops

Usage
-----
~~~~~

.. ipython:: python
Expand All @@ -46,7 +45,7 @@ Usage


Last
====
----

`Last <https://iextrading.com/developer/docs/#last>`__ is IEX
real-time trade data from the IEX book. This endpoint allows retrieval
Expand All @@ -57,7 +56,7 @@ Access is available through the top-level function ``get_market_last()``:
.. autofunction:: get_market_last

Usage
-----
~~~~~

.. ipython:: python
Expand All @@ -73,20 +72,21 @@ Usage


DEEP
====
----

`DEEP <https://iextrading.com/developer/docs/#DEEP>`__ is IEX's aggregated real-time depth of book quotes. DEEP also provides last trade price and size information.

Access is available through the top-level function ``get_market_deep()``:

.. autofunction:: get_market_deep[:3]
.. autofunction:: get_market_deep

.. note:: Per IEX, DEEP only accepts one symbol at this time.

Usage
-----
~~~~~

.. ipython:: python
:okexcept:
from iexfinance import get_market_deep
Expand All @@ -97,7 +97,7 @@ Usage


Book
====
----

`Book <https://iextrading.com/developer/docs/#Book>`__ shows IEX's bids and asks
for given symbols.
Expand All @@ -108,7 +108,7 @@ Access is available through the top-level function ``get_market_book()``:


Usage
-----
~~~~~

.. ipython:: python
Expand Down
6 changes: 3 additions & 3 deletions docs/source/modules.rst
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ iexfinance\.stats module
:undoc-members:
:show-inheritance:

iexfinance\.stock module
------------------------
iexfinance\.stocks module
-------------------------

.. automodule:: iexfinance.stock
.. automodule:: iexfinance.stocks
:members:
:undoc-members:
:show-inheritance:
Expand Down
Loading

0 comments on commit eb5780b

Please sign in to comment.