-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
12 changed files
with
1,715 additions
and
1,590 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
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 |
---|---|---|
@@ -1,5 +1,8 @@ | ||
# flake8: noqa | ||
|
||
""" mstarpy init """ | ||
from .funds import Funds | ||
from .stock import Stock | ||
from .search import filter_universe, search_field, search_filter, search_funds, search_stock | ||
|
||
__version__ = "1.0.4" | ||
__version__ = "1.0.4" |
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 |
---|---|---|
@@ -1,25 +1,25 @@ | ||
def not_200_response(url,response): | ||
""" | ||
This function raise a ConnectionError if the status code a requests is not 200. | ||
"""module to raise error""" | ||
|
||
|
||
def not_200_response(url, response): | ||
""" | ||
This function raise a ConnectionError | ||
if the status code a requests is not 200. | ||
""" | ||
if not response.status_code == 200: | ||
raise ConnectionError(f"Error {response.status_code} for the api {url}. Message : {response.reason}.") | ||
raise ConnectionError( | ||
f"""Error {response.status_code} | ||
for the api {url}. Message : {response.reason}.""" | ||
) | ||
|
||
|
||
def no_site_error(code, name, country, site): | ||
""" | ||
This function raise a ValueError if the selected country is "us" or a site is not selected. | ||
""" | ||
|
||
|
||
if not site or country == 'us': | ||
This function raise a ValueError if the | ||
selected country is "us" or a site is not selected. | ||
""" | ||
if not site or country == "us": | ||
if country: | ||
raise ValueError(f"The funds of the country {country} cannot be scraped.") | ||
else: | ||
raise ValueError(f"The funds {name} ({code}) cannot be scraped.") | ||
|
||
|
||
|
||
|
||
raise ValueError(f"""The funds of the | ||
country {country} cannot be scraped.""") | ||
raise ValueError(f"The funds {name} ({code}) cannot be scraped.") |
Oops, something went wrong.