-
Notifications
You must be signed in to change notification settings - Fork 218
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 #172 from JECSand/development
Development
- Loading branch information
Showing
10 changed files
with
198 additions
and
52 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,11 +10,11 @@ | |
|
||
setup( | ||
name='yahoofinancials', | ||
version='1.19', | ||
version='1.20', | ||
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.19.tar.gz', | ||
download_url='https://github.com/JECSand/yahoofinancials/archive/1.20.tar.gz', | ||
author='Connor Sanders', | ||
author_email='[email protected]', | ||
license='MIT', | ||
|
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,7 +1,7 @@ | ||
# YahooFinancials Unit Tests v1.19 | ||
# Version Released: 12/12/2023 | ||
# YahooFinancials Unit Tests v1.20 | ||
# Version Released: 12/17/2023 | ||
# Author: Connor Sanders | ||
# Tested on Python 3.7, 3.8, 3.9, 3.10, and 3.11 | ||
# Tested on Python 3.7, 3.8, 3.9, 3.10, 3.11, and 3.12 | ||
# Copyright (c) 2023 Connor Sanders <[email protected]> | ||
# MIT License | ||
|
||
|
@@ -42,6 +42,8 @@ def setUp(self): | |
self.test_yf_treasuries_multi = yf(us_treasuries) | ||
self.test_yf_currencies = yf(currencies) | ||
self.test_yf_concurrent = yf(stocks, concurrent=True) | ||
self.test_yf_stock_flat = yf('C', flat_format=True) | ||
self.test_yf_stock_analytic = yf('WFC') | ||
|
||
# Fundamentals Test | ||
def test_yf_fundamentals(self): | ||
|
@@ -103,6 +105,35 @@ def test_yf_concurrency(self): | |
result = check_fundamental(multi_all_statement_data_qt, 'all') | ||
self.assertEqual(result, True) | ||
|
||
# Fundamentals in Flat Format Test | ||
def test_yf_fundamentals_flat(self): | ||
# Single stock test | ||
single_all_statement_data_qt = self.test_yf_stock_flat.get_financial_stmts('quarterly', | ||
['income', 'cash', 'balance']) | ||
if ((isinstance(single_all_statement_data_qt.get("incomeStatementHistoryQuarterly").get("C"), dict) and | ||
isinstance(single_all_statement_data_qt.get("balanceSheetHistoryQuarterly").get("C"), dict)) and | ||
isinstance(single_all_statement_data_qt.get("cashflowStatementHistoryQuarterly").get("C"), dict)): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Analytic Methods Test | ||
def test_yf_analytic_methods(self): | ||
|
||
# Get Insights | ||
out = self.test_yf_stock_analytic.get_insights() | ||
if out.get("WFC").get("instrumentInfo").get("technicalEvents").get("sector") == "Financial Services": | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Get Recommendations | ||
out = self.test_yf_stock_analytic.get_recommendations() | ||
if isinstance(out.get("WFC"), list): | ||
self.assertEqual(True, True) | ||
else: | ||
self.assertEqual(False, True) | ||
|
||
# Extra Module Methods Test | ||
def test_yf_module_methods(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
Oops, something went wrong.