-
-
Notifications
You must be signed in to change notification settings - Fork 86
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #47 from lit26/fix
Update changes in multiple module due to finviz change
- Loading branch information
Showing
23 changed files
with
149 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,5 +5,5 @@ | |
.. moduleauthor:: Tianning Li <[email protected]> | ||
""" | ||
|
||
__version__ = "0.12.2" | ||
__version__ = "0.13.0" | ||
__author__ = "Tianning Li" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,16 +7,20 @@ | |
.. moduleauthor:: Tianning Li <[email protected]> | ||
""" | ||
|
||
SCREENER_TABLE_INDEX = 5 | ||
|
||
|
||
class Crypto: | ||
"""Crypto | ||
Getting information from the finviz crypto page. | ||
Args: | ||
screener_table_index(int): table index of the stock screener. change only if change on finviz side. | ||
""" | ||
|
||
def __init__(self): | ||
def __init__(self, screener_table_index=SCREENER_TABLE_INDEX): | ||
"""initiate module""" | ||
pass | ||
self._screener_table_index = screener_table_index | ||
|
||
def performance(self): | ||
"""Get crypto performance table. | ||
|
@@ -25,7 +29,7 @@ def performance(self): | |
df(pandas.DataFrame): crypto performance table | ||
""" | ||
url = "https://finviz.com/crypto_performance.ashx" | ||
df = scrap_function(url) | ||
df = scrap_function(url, self._screener_table_index) | ||
return df | ||
|
||
def chart(self, crypto, timeframe="D", urlonly=False): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,15 +7,20 @@ | |
.. moduleauthor:: Tianning Li <[email protected]> | ||
""" | ||
|
||
SCREENER_TABLE_INDEX = 5 | ||
|
||
|
||
class Forex: | ||
"""Forex | ||
Getting information from the finviz forex page. | ||
Args: | ||
screener_table_index(int): table index of the stock screener. change only if change on finviz side. | ||
""" | ||
|
||
def __init__(self): | ||
def __init__(self, screener_table_index=SCREENER_TABLE_INDEX): | ||
"""initiate module""" | ||
pass | ||
self._screener_table_index = screener_table_index | ||
|
||
def performance(self, change="percent"): | ||
"""Get forex performance table. | ||
|
@@ -33,7 +38,7 @@ def performance(self, change="percent"): | |
url = "https://finviz.com/forex_performance.ashx?v=1&tv=2&o=-perfdaypct" | ||
else: | ||
raise ValueError("Options of change: percent(default), PIPS") | ||
df = scrap_function(url) | ||
df = scrap_function(url, self._screener_table_index) | ||
return df | ||
|
||
def chart(self, forex, timeframe="D", urlonly=False): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,20 @@ | |
.. moduleauthor:: Tianning Li <[email protected]> | ||
""" | ||
|
||
SCREENER_TABLE_INDEX = 7 | ||
|
||
|
||
class Performance(Overview): | ||
"""Performance inherit from overview module. | ||
Getting information from the finviz group performance page. | ||
Args: | ||
screener_table_index(int): table index of the stock screener. change only if change on finviz side. | ||
""" | ||
|
||
def __init__(self): | ||
def __init__(self, screener_table_index=SCREENER_TABLE_INDEX): | ||
"""initiate module""" | ||
self._screener_table_index = screener_table_index | ||
self.BASE_URL = "https://finviz.com/groups.ashx?{group}&v=140" | ||
self.url = self.BASE_URL.format(group="g=sector") | ||
Overview._load_setting(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,15 +6,20 @@ | |
.. moduleauthor:: Tianning Li <[email protected]> | ||
""" | ||
SCREENER_TABLE_INDEX = 7 | ||
|
||
|
||
class Valuation(Overview): | ||
"""Valuation inherit from overview module. | ||
Getting information from the finviz group valuation page. | ||
Args: | ||
screener_table_index(int): table index of the stock screener. change only if change on finviz side. | ||
""" | ||
|
||
def __init__(self): | ||
def __init__(self, screener_table_index=SCREENER_TABLE_INDEX): | ||
"""initiate module""" | ||
self._screener_table_index = screener_table_index | ||
self.BASE_URL = "https://finviz.com/groups.ashx?{group}&v=120" | ||
self.url = self.BASE_URL.format(group="g=sector") | ||
Overview._load_setting(self) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,14 +7,21 @@ | |
.. moduleauthor:: Tianning Li <[email protected]> | ||
""" | ||
|
||
SCREENER_TABLE_INDEX = 21 | ||
|
||
|
||
class Financial(Overview): | ||
"""Financial inherit from overview module. | ||
Getting information from the finviz screener financial page. | ||
Args: | ||
screener_table_index(int): table index of the stock screener. change only if change on finviz side. | ||
""" | ||
|
||
def __init__(self): | ||
def __init__(self, screener_table_index=SCREENER_TABLE_INDEX): | ||
"""initiate module""" | ||
self._screener_table_index = screener_table_index | ||
self.BASE_URL = ( | ||
"https://finviz.com/screener.ashx?v=161{signal}{filter}&ft=4{ticker}" | ||
) | ||
|
Oops, something went wrong.