finished tests

This commit is contained in:
2021-11-26 21:38:10 +01:00
parent 776c909956
commit 44dee0b762
3 changed files with 44 additions and 43 deletions

View File

@ -8,6 +8,7 @@ FIN_STMT_URL_SUFFIX = {
IS: '',
CF: '/cash-flow'
}
END_DATE = 'End Date'
# All items marked `False` do not need to be scraped
# because they are calculated from other items (e.g. growth or ratios).

View File

@ -4,6 +4,8 @@ from aiohttp.client import ClientSession
from bs4 import BeautifulSoup
from bs4.element import ResultSet, Tag
from . import constants
# The resulting dictionary's keys correspond to the name of the item (row) in the financial statement,
# while its values will always be tuples with a length corresponding to the number of periods (columns)
@ -56,15 +58,15 @@ def extract_all_data(soup: BeautifulSoup) -> ResultDict:
pass
async def _get_financial_statement(statement: str, ticker_symbol: str, yearly: bool = True, quarterly: bool = True,
async def _get_financial_statement(statement: str, ticker_symbol: str, quarterly: bool = False,
session: ClientSession = None) -> ResultDict:
"""
Returns data from the specified financial statement of the specified company.
"""
pass # TODO: Don't allow both yearly and quarterly, instead only have `quarterly` Flag
pass
async def get_balance_sheet(ticker_symbol: str, yearly: bool = True, quarterly: bool = True,
async def get_balance_sheet(ticker_symbol: str, quarterly: bool = False,
session: ClientSession = None) -> ResultDict:
"""
Returns data from the balance sheet of the specified company.
@ -72,7 +74,7 @@ async def get_balance_sheet(ticker_symbol: str, yearly: bool = True, quarterly:
pass
async def get_income_statement(ticker_symbol: str, yearly: bool = True, quarterly: bool = True,
async def get_income_statement(ticker_symbol: str, quarterly: bool = False,
session: ClientSession = None) -> ResultDict:
"""
Returns data from the income statement of the specified company.
@ -80,7 +82,7 @@ async def get_income_statement(ticker_symbol: str, yearly: bool = True, quarterl
pass
async def get_cash_flow_statement(ticker_symbol: str, yearly: bool = True, quarterly: bool = True,
async def get_cash_flow_statement(ticker_symbol: str, quarterly: bool = False,
session: ClientSession = None) -> ResultDict:
"""
Returns data from the cash flow statement of the specified company.
@ -88,7 +90,7 @@ async def get_cash_flow_statement(ticker_symbol: str, yearly: bool = True, quart
pass
async def get_company_financials(ticker_symbol: str, yearly: bool = True, quarterly: bool = True,
async def get_company_financials(ticker_symbol: str, quarterly: bool = False,
session: ClientSession = None) -> ResultDict:
"""
Returns all fundamentals (balance sheet, income statement and cash flow statement) of the specified company.