Skip to content

Commit c8c3f70

Browse files
authored
Merge pull request #127 from lit26/before-release
Bump v1.1.0
2 parents bad7716 + b15f6bf commit c8c3f70

File tree

6 files changed

+18
-12
lines changed

6 files changed

+18
-12
lines changed

docs/source/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
copyright = '2024, Tianning Li'
1616
author = 'Tianning Li'
1717
# The full version, including alpha/beta/rc tags
18-
release = '1.0.1'
18+
release = '1.1.0'
1919

2020
# -- General configuration ---------------------------------------------------
2121
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

finvizfinance/quote.py

+3-2
Original file line numberDiff line numberDiff line change
@@ -278,7 +278,7 @@ def ticker_news(self):
278278
"""
279279
fullview_news_outer = self.soup.find("table", class_="fullview-news-outer")
280280
rows = fullview_news_outer.find_all("tr")
281-
281+
282282
frame = []
283283
last_date = ""
284284
for row in rows:
@@ -287,6 +287,7 @@ def ticker_news(self):
287287
news_date = cols[0].text
288288
title = cols[1].a.text
289289
link = cols[1].a["href"]
290+
source = cols[1].span.text[1:-1]
290291
news_time = news_date.split()
291292
if len(news_time) == 2:
292293
last_date = news_time[0]
@@ -296,7 +297,7 @@ def ticker_news(self):
296297

297298
news_time = format_datetime(news_time)
298299

299-
info_dict = {"Date": news_time, "Title": title, "Link": link}
300+
info_dict = {"Date": news_time, "Title": title, "Link": link, "Source": source}
300301
frame.append(info_dict)
301302
except AttributeError:
302303
pass

finvizfinance/screener/base.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,10 @@ def _get_table(self, rows, df, num_col_index, table_header, limit=-1):
128128
else:
129129
info_dict[table_header[i]] = number_covert(col.text)
130130
frame.append(info_dict)
131-
return pd.concat([df, pd.DataFrame(frame)], ignore_index=True)
131+
if len(df) == 0:
132+
return pd.DataFrame(frame)
133+
else:
134+
return pd.concat([df, pd.DataFrame(frame)], ignore_index=True)
132135

133136
@staticmethod
134137
def _parse_table_header(soup):

finvizfinance/util.py

+8-7
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def image_scrap(url, ticker, out_dir):
5656
out_dir(str): output directory
5757
"""
5858
try:
59-
r = session.get(url, stream=True, headers=headers, timeout=10)
59+
r = session.get(url, stream=True, headers=headers, timeout=10, proxies= proxy_dict)
6060
r.raise_for_status()
6161
r.raw.decode_content = True
6262
if len(out_dir) != 0:
@@ -136,16 +136,17 @@ def image_scrap_function(url, chart, timeframe, urlonly):
136136

137137

138138
def number_covert(num):
139-
"""covert number(str) to number(float)
139+
"""Convert number(str) to number(float)
140140
141141
Args:
142-
num(str): number of string
142+
num(str): number as a string
143143
Return:
144-
num(float): number of string
144+
num(float or None): number converted to float or None
145145
"""
146-
if num == "-":
146+
if not num or num == "-": # Check if the string is empty or is "-"
147147
return None
148-
elif num[-1] == "%":
148+
num = num.strip() # Remove any surrounding whitespace
149+
if num[-1] == "%":
149150
return float(num[:-1]) / 100
150151
elif num[-1] == "B":
151152
return float(num[:-1]) * 1000000000
@@ -154,7 +155,7 @@ def number_covert(num):
154155
elif num[-1] == "K":
155156
return float(num[:-1]) * 1000
156157
else:
157-
return float("".join(num.split(",")))
158+
return float(num.replace(",", "")) # Remove commas and convert to float
158159

159160

160161
def format_datetime(date_str):

release.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
| Date | Version | Comment |
22
| ---------- | --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
3+
| 2024/10/04 | 1.1.0 | Fix Pandas warning. Fix Insider Transactions error. Add source col to ticker_news(). Add image fetch Proxy. Issue: [#116](https://github.com/lit26/finvizfinance/issues/116) [#118](https://github.com/lit26/finvizfinance/issues/118) [#120](https://github.com/lit26/finvizfinance/issues/120). PR: [#119](https://github.com/lit26/finvizfinance/pull/119) [#121](https://github.com/lit26/finvizfinance/pull/121) [#122](https://github.com/lit26/finvizfinance/pull/122) [#123](https://github.com/lit26/finvizfinance/pull/123).
34
| 2024/07/05 | 1.0.1 | Fix custom screener and group. Issue: [#112](https://github.com/lit26/finvizfinance/issues/112). PR: [#113](https://github.com/lit26/finvizfinance/pull/113) |
45
| 2024/06/17 | 1.0.0 | Optimization and fix coding style. Release 1.0.0. |
56
| 2024/05/05 | 1.0.0rc1 | Miscellaneous upgrade. PR: [#105](https://github.com/lit26/finvizfinance/pull/105) |

setup.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
HERE = pathlib.Path(__file__).parent
55

6-
VERSION = '1.0.1'
6+
VERSION = '1.1.0'
77
PACKAGE_NAME = 'finvizfinance'
88
AUTHOR = 'Tianning Li'
99
AUTHOR_EMAIL = '[email protected]'

0 commit comments

Comments
 (0)