Reformat code and bump version
This commit is contained in:
parent
14be2b99c5
commit
5f23f1c04c
4
setup.py
4
setup.py
|
@ -4,7 +4,7 @@ with open("README.md", "r") as fh:
|
|||
long_description = fh.read()
|
||||
setuptools.setup(
|
||||
name="stockquotes",
|
||||
version="2.0.2",
|
||||
version="2.0.3",
|
||||
description="A simple module for retreiving stock data",
|
||||
long_description=long_description,
|
||||
long_description_content_type="text/markdown",
|
||||
|
@ -13,5 +13,5 @@ setuptools.setup(
|
|||
"Programming Language :: Python :: 3",
|
||||
"Operating System :: OS Independent",
|
||||
],
|
||||
python_requires=">=3.5",
|
||||
python_requires=">=3.6",
|
||||
)
|
||||
|
|
|
@ -89,7 +89,13 @@ class Stock:
|
|||
|
||||
change_percent_selector = f'fin-streamer[data-field="regularMarketChangePercent"][data-symbol="{self.symbol}"]'
|
||||
change_percent_element = soup.select_one(change_percent_selector)
|
||||
change_percent_text = ''.join([char for char in change_percent_element.text if char in '-.0123456789'])
|
||||
change_percent_text = "".join(
|
||||
[
|
||||
char
|
||||
for char in change_percent_element.text
|
||||
if char in "-.0123456789"
|
||||
]
|
||||
)
|
||||
self.increase_percent = float(change_percent_text)
|
||||
except AttributeError as error:
|
||||
raise StockDoesNotExistError(ticker) from error
|
||||
|
|
Loading…
Reference in New Issue
Block a user