From 5f23f1c04ce76d246c2c2ef2beb5acde64a1a06d Mon Sep 17 00:00:00 2001 From: Samuel Sloniker Date: Sat, 4 Dec 2021 18:53:48 -0800 Subject: [PATCH] Reformat code and bump version --- setup.py | 4 ++-- stockquotes/__init__.py | 8 +++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/setup.py b/setup.py index 4fd5f9b..db35f5a 100644 --- a/setup.py +++ b/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", ) diff --git a/stockquotes/__init__.py b/stockquotes/__init__.py index 671e67c..0357637 100644 --- a/stockquotes/__init__.py +++ b/stockquotes/__init__.py @@ -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