Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CLN: Prepare for 0.7.0 release #573

Merged
merged 3 commits into from
Sep 11, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ include = */pandas_datareader/*
omit =
*/_version.py
*/yahoo/*
*/edgar.py
*/google/options.py
*/google/quotes.py
*/tests/google/test_options.py
*/tests/test_edgar.py


[report]
# Regexes for lines to exclude from consideration
Expand All @@ -26,9 +25,7 @@ include = */pandas_datareader/*
omit =
*/_version.py
*/yahoo/*
*/edgar.py
*/google/options.py
*/google/quotes.py
*/tests/google/test_options.py
*/tests/test_edgar.py
ignore_errors = True
16 changes: 8 additions & 8 deletions docs/source/remote_data.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Currently the following sources are supported:
- :ref:`Tiingo<remote_data.tiingo>`
- :ref:`IEX<remote_data.iex>`
- :ref:`Robinhood<remote_data.robinhood>`
- :ref:`AlphaVantage<remote_data.alphavantage>`
- :ref:`Alpha Vantage<remote_data.alphavantage>`
- :ref:`Enigma<remote_data.enigma>`
- :ref:`Quandl<remote_data.quandl>`
- :ref:`St.Louis FED (FRED)<remote_data.fred>`
Expand Down Expand Up @@ -112,17 +112,17 @@ year relative to today.

.. _remote_data.alphavantage

AlphaVantage
============
Alpha Vantage
=============

`AlphaVantage <https://www.alphavantage.co/documentation>`__ provides realtime
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ provides realtime
equities and forex data. Free registration is required to get an API key.

Historical Time Series Data
^^^^^^^^^^^^^^^^^^^^^^^^^^^

Through the
`AlphaVantage <https://www.alphavantage.co/documentation>`__ Time Series
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ Time Series
endpoints, it is possible to obtain historical equities data for individual
symbols. The following endpoints are available:

Expand Down Expand Up @@ -152,7 +152,7 @@ provided.
Quotes
^^^^^^

`AlphaVantage <https://www.alphavantage.co/documentation>`__ Batch Stock Quotes
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ Batch Stock Quotes
endpoint allows the retrieval of realtime stock quotes for up to 100 symbols at
once. These quotes are accessible through the top-level function
``get_quote_av``.
Expand All @@ -171,7 +171,7 @@ once. These quotes are accessible through the top-level function
Forex
^^^^^

`AlphaVantage <https://www.alphavantage.co/documentation>`__ provides realtime
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ provides realtime
currency exchange rates (for physical and digital currencies).

To request the exchange rate of physical or digital currencies, simply format
Expand Down Expand Up @@ -199,7 +199,7 @@ Multiple pairs are are allowable:
Sector Performance
^^^^^^^^^^^^^^^^^^

`AlphaVantage <https://www.alphavantage.co/documentation>`__ provides sector
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ provides sector
performances through the top-level function ``get_sector_performance_av``.

.. ipython:: python
Expand Down
12 changes: 5 additions & 7 deletions docs/source/whatsnew/v0.7.0.txt
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ v0.7.0 (Xxxxxxx YY, 20ZZ)
Highlights include:

- Immediate deprecation of Google finance and Morningstar for historical price data, as these API endpoints are no longer supported by their respective providers. Alternate methods are welcome via pull requests, as PDR would like to restore these features.
- Removal of EDGAR, which was deprecated in v0.6.0.

.. contents:: What's new in v0.7.0
:local:
Expand All @@ -22,23 +23,23 @@ Enhancements
~~~~~~~~~~~~

- A new data connector for data provided by
`AlphaVantage <https://www.alphavantage.co/documentation>`__ was
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ was
introduced to obtain Foreign Exchange (FX) data.
(:issue:`389`)

- A new data connector for data provided by
`AlphaVantage <https://www.alphavantage.co/documentation>`__ was
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ was
introduced to obtain historical time series data.
(:issue:`389`)

- A new data connector for data provided by
`AlphaVantage <https://www.alphavantage.co/documentation>`__ was
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ was
introduced to obtain sector performance data, accessed through the
top-level function ``get_sector_performance_av``.
(:issue:`389`)

- A new data connector for data provided by
`AlphaVantage <https://www.alphavantage.co/documentation>`__ was
`Alpha Vantage <https://www.alphavantage.co/documentation>`__ was
introduced to obtain real-time Batch Stock Quotes through the
top-level function ``get_quote_av``.
(:issue:`389`)
Expand All @@ -65,10 +66,7 @@ Bug Fixes

- Added support for passing the API KEY to QuandlReader either directly or by
setting the environmental variable QUANDL_API_KEY (:issue:`485`).
- Handle Morningstar index volume data properly (:issue:`486`).
- Added support for optionally passing a custom base_url to the EnigmaReader (:issue:`499`).
- Fixed Morningstar 'retry' incrementation (:issue:`513`)
- Updated Google Daily Price API to functional url (:issue:`502`)
- Fix Yahoo! price data (:issue:`498`)
- Added back support for Yahoo! price, dividends, and splits data for stocks
and currency pairs (:issue:`487`).
Expand Down
13 changes: 8 additions & 5 deletions pandas_datareader/av/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,16 @@

class AlphaVantage(_BaseReader):
"""
Base class for all AlphaVantage queries
Base class for all Alpha Vantage queries

Notes
-----
See `Alpha Vantage <https://www.alphavantage.co/>`__
"""
_format = 'json'

def __init__(self, symbols=None, start=None, end=None, retry_count=3,
pause=0.001, session=None, api_key=None):
pause=0.1, session=None, api_key=None):
super(AlphaVantage, self).__init__(symbols=symbols, start=start,
end=end, retry_count=retry_count,
pause=pause, session=session)
Expand All @@ -42,12 +46,12 @@ def params(self):

@property
def function(self):
""" AlphaVantage endpoint function"""
""" Alpha Vantage endpoint function"""
raise NotImplementedError

@property
def data_key(self):
""" Key of data returned from AlphaVantage """
""" Key of data returned from Alpha Vantage """
raise NotImplementedError

def _read_lines(self, out):
Expand All @@ -61,6 +65,5 @@ def _read_lines(self, out):
else:
raise RemoteDataError()
df = df[sorted(df.columns)]
# df.sort_index(ascending=True, inplace=True)
df.columns = [id[3:] for id in df.columns]
return df
8 changes: 4 additions & 4 deletions pandas_datareader/av/forex.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

class AVForexReader(AlphaVantage):
"""
Returns DataFrame of the AlphaVantage Foreign Exchange (FX) Exchange Rates
Returns DataFrame of the Alpha Vantage Foreign Exchange (FX) Exchange Rates
data.

.. versionadded:: 0.7.0
Expand All @@ -18,16 +18,16 @@ class AVForexReader(AlphaVantage):
Single currency pair (formatted 'FROM/TO') or list of the same.
retry_count : int, default 3
Number of times to retry query request.
pause : int, default 0.5
pause : int, default 0.1
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.
session : Session, default None
requests.sessions.Session instance to be used
api_key : str, optional
AlphaVantage API key . If not provided the environmental variable
Alpha Vantage API key . If not provided the environmental variable
ALPHAVANTAGE_API_KEY is read. The API key is *required*.
"""
def __init__(self, symbols=None, retry_count=3, pause=0.5, session=None,
def __init__(self, symbols=None, retry_count=3, pause=0.1, session=None,
api_key=None):

super(AVForexReader, self).__init__(symbols=symbols,
Expand Down
6 changes: 3 additions & 3 deletions pandas_datareader/av/quotes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class AVQuotesReader(AlphaVantage):
"""
Returns DataFrame of AlphaVantage Realtime Stock quotes for a symbol or
Returns DataFrame of Alpha Vantage Realtime Stock quotes for a symbol or
list of symbols.

Parameters
Expand All @@ -16,13 +16,13 @@ class AVQuotesReader(AlphaVantage):
DataFrame with index containing stock symbols.
retry_count : int, default 3
Number of times to retry query request.
pause : int, default 0
pause : int, default 0.1
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.
session : Session, default None
requests.sessions.Session instance to be used
"""
def __init__(self, symbols=None, retry_count=3, pause=0.5, session=None,
def __init__(self, symbols=None, retry_count=3, pause=0.1, session=None,
api_key=None):
if isinstance(symbols, str):
syms = [symbols]
Expand Down
6 changes: 3 additions & 3 deletions pandas_datareader/av/sector.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

class AVSectorPerformanceReader(AlphaVantage):
"""
Returns DataFrame of the AlphaVantage Sector Performances SECTOR data.
Returns DataFrame of the Alpha Vantage Sector Performances SECTOR data.

.. versionadded:: 0.7.0

Expand All @@ -16,13 +16,13 @@ class AVSectorPerformanceReader(AlphaVantage):
Single currency pair (formatted 'FROM/TO') or list of the same.
retry_count : int, default 3
Number of times to retry query request.
pause : int, default 0.5
pause : int, default 0.1
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.
session : Session, default None
requests.sessions.Session instance to be used
api_key : str, optional
AlphaVantage API key . If not provided the environmental variable
Alpha Vantage API key . If not provided the environmental variable
ALPHAVANTAGE_API_KEY is read. The API key is *required*.
"""
@property
Expand Down
8 changes: 4 additions & 4 deletions pandas_datareader/av/time_series.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class AVTimeSeriesReader(AlphaVantage):
"""
Returns DataFrame of the AlphaVantage Stock Time Series endpoints
Returns DataFrame of the Alpha Vantage Stock Time Series endpoints

.. versionadded:: 0.7.0

Expand All @@ -20,7 +20,7 @@ class AVTimeSeriesReader(AlphaVantage):
Ending date, timestamp. Same format as starting date.
retry_count : int, default 3
Number of times to retry query request.
pause : int, default 0.5
pause : int, default 0.1
Time, in seconds, to pause between consecutive queries of chunks. If
single value given for symbol, represents the pause between retries.
session : Session, default None
Expand All @@ -39,7 +39,7 @@ class AVTimeSeriesReader(AlphaVantage):
}

def __init__(self, symbols=None, function="TIME_SERIES_DAILY",
start=None, end=None, retry_count=3, pause=0.35,
start=None, end=None, retry_count=3, pause=0.1,
session=None, chunksize=25, api_key=None):
super(AVTimeSeriesReader, self).__init__(symbols=symbols, start=start,
end=end,
Expand All @@ -55,7 +55,7 @@ def function(self):

@property
def output_size(self):
""" Used to limit the size of the AlphaVantage query when
""" Used to limit the size of the Alpha Vantage query when
possible.
"""
delta = datetime.now() - self.start
Expand Down
2 changes: 1 addition & 1 deletion pandas_datareader/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,7 @@ class _DailyBaseReader(_BaseReader):
""" Base class for Google / Yahoo daily reader """

def __init__(self, symbols=None, start=None, end=None, retry_count=3,
pause=0.001, session=None, chunksize=25):
pause=0.1, session=None, chunksize=25):
super(_DailyBaseReader, self).__init__(symbols=symbols,
start=start, end=end,
retry_count=retry_count,
Expand Down
8 changes: 1 addition & 7 deletions pandas_datareader/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
from pandas_datareader.av.sector import AVSectorPerformanceReader
from pandas_datareader.av.time_series import AVTimeSeriesReader
from pandas_datareader.bankofcanada import BankOfCanadaReader
from pandas_datareader.edgar import EdgarIndexReader
from pandas_datareader.enigma import EnigmaReader
from pandas_datareader.eurostat import EurostatReader
from pandas_datareader.exceptions import DEP_ERROR_MSG, \
Expand Down Expand Up @@ -255,7 +254,7 @@ def get_iex_book(*args, **kwargs):


def DataReader(name, data_source=None, start=None, end=None,
retry_count=3, pause=0.001, session=None, access_key=None):
retry_count=3, pause=0.1, session=None, access_key=None):
"""
Imports data from a number of online sources.

Expand Down Expand Up @@ -368,11 +367,6 @@ def DataReader(name, data_source=None, start=None, end=None,
return EurostatReader(symbols=name, start=start, end=end,
retry_count=retry_count, pause=pause,
session=session).read()
elif data_source == "edgar-index":
raise ImmediateDeprecationError(DEP_ERROR_MSG.format('EDGAR'))
return EdgarIndexReader(symbols=name, start=start, end=end,
retry_count=retry_count, pause=pause,
session=session).read()
elif data_source == 'nasdaq':
if name != 'symbols':
raise ValueError("Only the string 'symbols' is supported for "
Expand Down
Loading