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

added eps and eps test #322

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
23 changes: 23 additions & 0 deletions alpha_vantage/fundamentaldata.py
Expand Up @@ -31,6 +31,29 @@ def get_company_overview(self, symbol):
"""
_FUNCTION_KEY = 'OVERVIEW'
return _FUNCTION_KEY, None, None

@av._output_format
@av._call_api_on_func
def get_eps(self, symbol, interval=None):
"""
Returns the Earnings per share (Eps) data for the company, either quarterly
(including analyst estimates and earnings suprise) or annually or both.

Keyword Arguments:
symbol: the symbol for the equity we want to get its data
interval: what kind of eps data to return;
annually [str]: return yearly eps as pandas dataframe
quarterly [str]: return quarterly eps as pandas dataframe
None [None]: return annual and quarterly data as a dict
"""

_FUNCTION_KEY = "EARNINGS"
if interval == "quarterly":
return _FUNCTION_KEY, "quarterlyEarnings", "symbol"
elif interval == "annually":
return _FUNCTION_KEY, "annualEarnings", "symbol"
elif interval is None:
return _FUNCTION_KEY, None, None

@av._output_format
@av._call_api_on_func
Expand Down