-
Notifications
You must be signed in to change notification settings - Fork 221
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactored session management system to handle cookie and crumbs better.
- Loading branch information
connorsanders
committed
Dec 13, 2023
1 parent
29177c6
commit 9f1b166
Showing
9 changed files
with
835 additions
and
211 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,19 +10,24 @@ | |
|
||
setup( | ||
name='yahoofinancials', | ||
version='1.18', | ||
version='1.19', | ||
description='A powerful financial data module used for pulling both fundamental and technical data from Yahoo Finance', | ||
long_description=long_description, | ||
url='https://github.com/JECSand/yahoofinancials', | ||
download_url='https://github.com/JECSand/yahoofinancials/archive/1.18.tar.gz', | ||
download_url='https://github.com/JECSand/yahoofinancials/archive/1.19.tar.gz', | ||
author='Connor Sanders', | ||
author_email='[email protected]', | ||
license='MIT', | ||
keywords=['finance data', 'stocks', 'commodities', 'cryptocurrencies', 'currencies', 'forex', 'yahoo finance'], | ||
packages=['yahoofinancials'], | ||
install_requires=[ | ||
"pytz", | ||
"requests>=2.26", | ||
"pytz>=2022.5", | ||
"requests>=2.31", | ||
"appdirs>=1.4.4", | ||
"frozendict>=2.3.4", | ||
"peewee>=3.16.2", | ||
"beautifulsoup4>=4.11.1", | ||
"lxml>=4.9.1", | ||
], | ||
classifiers=[ | ||
'Development Status :: 5 - Production/Stable', | ||
|
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,5 @@ | ||
# YahooFinancials Unit Tests v1.18 | ||
# Version Released: 12/09/2023 | ||
# YahooFinancials Unit Tests v1.19 | ||
# Version Released: 12/12/2023 | ||
# Author: Connor Sanders | ||
# Tested on Python 3.7, 3.8, 3.9, 3.10, and 3.11 | ||
# Copyright (c) 2023 Connor Sanders <[email protected]> | ||
|
@@ -107,66 +107,85 @@ def test_yf_concurrency(self): | |
def test_yf_module_methods(self): | ||
|
||
# 10 Day Average Daily Volume | ||
if isinstance(self.test_yf_stock_single.get_ten_day_avg_daily_volume(), int): | ||
out = self.test_yf_stock_single.get_ten_day_avg_daily_volume() | ||
if isinstance(out, int): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Current Price | ||
if isinstance(self.test_yf_stock_single.get_current_price(), float): | ||
out = self.test_yf_stock_single.get_current_price() | ||
if isinstance(out, float): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Net Income | ||
if isinstance(self.test_yf_stock_single.get_net_income(), float): | ||
out = self.test_yf_stock_single.get_net_income() | ||
if isinstance(out, float): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Financial Data | ||
if self.test_yf_stock_single.get_financial_data().get("C").get("financialCurrency") == "USD": | ||
out = self.test_yf_stock_single.get_financial_data() | ||
if out.get("C").get("financialCurrency") == "USD": | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Profile Data | ||
if self.test_yf_stock_single.get_stock_profile_data().get("C").get("sector") == "Financial Services": | ||
out = self.test_yf_stock_single.get_stock_profile_data() | ||
if out.get("C").get("sector") == "Financial Services": | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Summary Data | ||
if self.test_yf_stock_single.get_summary_data().get("C").get("currency") == "USD": | ||
out = self.test_yf_stock_single.get_summary_data() | ||
if out.get("C").get("currency") == "USD": | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Price Data | ||
if self.test_yf_stock_single.get_stock_price_data().get("C").get("exchangeName") == "NYSE": | ||
out = self.test_yf_stock_single.get_stock_price_data() | ||
if out.get("C").get("exchangeName") == "NYSE": | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Key Statistics | ||
if isinstance(self.test_yf_stock_single.get_key_statistics_data().get("C").get("forwardPE"), float): | ||
out = self.test_yf_stock_single.get_key_statistics_data() | ||
if isinstance(out.get("C").get("forwardPE"), float): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock ESG SCORES | ||
if self.test_yf_stock_single.get_esg_score_data().get("C").get("peerGroup") == "Banks": | ||
out = self.test_yf_stock_single.get_esg_score_data() | ||
if out.get("C").get("peerGroup") == "Banks": | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Treasuries | ||
if isinstance(self.test_yf_treasuries_single.get_current_price(), float): | ||
out = self.test_yf_stock_single.get_current_price() | ||
if isinstance(out, float): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Earnings data check | ||
if isinstance(self.test_yf_stock_single.get_stock_earnings_data().get("C").get("earningsChart").get("quarterly")[0].get("actual"), float): | ||
out = self.test_yf_stock_single.get_stock_earnings_data() | ||
if isinstance(out.get("C").get("earningsChart").get("quarterly")[0].get("actual"), float): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Stock Data | ||
out = self.test_yf_stock_single.get_stock_data() | ||
if out.get("C").get("sector") == "Financial Services": | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
Oops, something went wrong.