diff --git a/CHANGES b/CHANGES index 14ab5c8..0b7d93d 100644 --- a/CHANGES +++ b/CHANGES @@ -24,4 +24,5 @@ 1.4 01/13/2019 -- Python3.7 support added. 1.4 01/13/2019 -- Added patch for reported bug described in Issue #15. 1.4 01/13/2019 -- Added method for get_stock_earnings_data(). -1.5 01/27/2019 -- Added get_daily_dividend_data() method as request in Issue #20. \ No newline at end of file +1.5 01/27/2019 -- Added get_daily_dividend_data() method as request in Issue #20. +1.5 01/27/2019 -- Added test_yf_dividend_price() unit testing method. \ No newline at end of file diff --git a/README.rst b/README.rst index b3ac861..bbd65c9 100644 --- a/README.rst +++ b/README.rst @@ -7,9 +7,9 @@ A python module that returns stock, cryptocurrency, forex, mutual fund, commodit .. image:: https://travis-ci.org/JECSand/yahoofinancials.svg?branch=master :target: https://travis-ci.org/JECSand/yahoofinancials -Current Version: v1.4 +Current Version: v1.5 -Version Released: 01/13/2019 +Version Released: 01/27/2019 Report any bugs by opening an issue here: https://github.com/JECSand/yahoofinancials/issues @@ -20,7 +20,7 @@ A powerful financial data module used for pulling both fundamental and technical - As of Version 0.10, Yahoo Financials now returns historical pricing data for commodity futures, cryptocurrencies, ETFs, mutual funds, U.S. Treasuries, currencies, indexes, and stocks. Installation ------------- +------------- - yahoofinancials runs on Python 2.7, 3.3, 3.4, 3.5, 3.6, and 3.7. - The package depends on beautifulsoup4 and pytz to work. @@ -98,53 +98,54 @@ Featured Methods - price_type can also be set to 'average' to calculate the shares outstanding with the daily average price. -Methods Added in V1.4 +Methods Added in V1.5 ^^^^^^^^^^^^^^^^^^^^^^^ -- get_key_statistics_data(): +- get_daily_dividend_data(start_date, end_date) Additional Module Methods ^^^^^^^^^^^^^^^^^^^^^^^^^ -- get_interest_expense(): -- get_operating_income(): -- get_total_operating_expense(): -- get_total_revenue(): -- get_cost_of_revenue(): -- get_income_before_tax(): -- get_income_tax_expense(): -- get_gross_profit(): -- get_net_income_from_continuing_ops(): -- get_research_and_development(): -- get_current_price(): -- get_current_change(): -- get_current_percent_change(): -- get_current_volume(): -- get_prev_close_price(): -- get_open_price(): -- get_ten_day_avg_daily_volume(): -- get_three_month_avg_daily_volume(): -- get_stock_exchange(): -- get_market_cap(): -- get_daily_low(): -- get_daily_high(): -- get_currency(): -- get_yearly_high(): -- get_yearly_low(): -- get_dividend_yield(): -- get_annual_avg_div_yield(): -- get_five_yr_avg_div_yield(): -- get_dividend_rate(): -- get_annual_avg_div_rate(): -- get_50day_moving_avg(): -- get_200day_moving_avg(): -- get_beta(): -- get_payout_ratio(): -- get_pe_ratio(): -- get_price_to_sales(): -- get_exdividend_date(): -- get_book_value(): -- get_ebit(): -- get_net_income(): -- get_earnings_per_share(): +- get_interest_expense() +- get_operating_income() +- get_total_operating_expense() +- get_total_revenue() +- get_cost_of_revenue() +- get_income_before_tax() +- get_income_tax_expense() +- get_gross_profit() +- get_net_income_from_continuing_ops() +- get_research_and_development() +- get_current_price() +- get_current_change() +- get_current_percent_change() +- get_current_volume() +- get_prev_close_price() +- get_open_price() +- get_ten_day_avg_daily_volume() +- get_three_month_avg_daily_volume() +- get_stock_exchange() +- get_market_cap() +- get_daily_low() +- get_daily_high() +- get_currency() +- get_yearly_high() +- get_yearly_low() +- get_dividend_yield() +- get_annual_avg_div_yield() +- get_five_yr_avg_div_yield() +- get_dividend_rate() +- get_annual_avg_div_rate() +- get_50day_moving_avg() +- get_200day_moving_avg() +- get_beta() +- get_payout_ratio() +- get_pe_ratio() +- get_price_to_sales() +- get_exdividend_date() +- get_book_value() +- get_ebit() +- get_net_income() +- get_earnings_per_share() +- get_key_statistics_data() Usage Examples -------------- @@ -620,6 +621,7 @@ Examples of Returned JSON Data "ytdReturn": null } } + 11. Apple Key Statistics Data: @@ -686,3 +688,64 @@ Examples of Returned JSON Data "fiveYearAverageReturn": null } } + +12. Apple and Wells Fargo Daily Dividend Data: + + +.. code-block:: python + + start_date = '1987-09-15' + end_date = '1988-09-15' + yahoo_financials = YahooFinancials(['AAPL', 'WFC']) + print(yahoo_financials.get_daily_dividend_data(start_date, end_date)) + + +.. code-block:: javascript + + { + "AAPL": [ + { + "date": 564157800, + "formatted_date": "1987-11-17", + "amount": 0.08 + }, + { + "date": 571674600, + "formatted_date": "1988-02-12", + "amount": 0.08 + }, + { + "date": 579792600, + "formatted_date": "1988-05-16", + "amount": 0.08 + }, + { + "date": 587655000, + "formatted_date": "1988-08-15", + "amount": 0.08 + } + ], + "WFC": [ + { + "date": 562861800, + "formatted_date": "1987-11-02", + "amount": 0.3008 + }, + { + "date": 570724200, + "formatted_date": "1988-02-01", + "amount": 0.3008 + }, + { + "date": 578583000, + "formatted_date": "1988-05-02", + "amount": 0.3344 + }, + { + "date": 586445400, + "formatted_date": "1988-08-01", + "amount": 0.3344 + } + ] + } + diff --git a/setup.py b/setup.py index 970cf83..0e22442 100644 --- a/setup.py +++ b/setup.py @@ -10,11 +10,11 @@ setup( name='yahoofinancials', - version='1.4', + version='1.5', 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.4.tar.gz', + download_url='https://github.com/JECSand/yahoofinancials/archive/1.5.tar.gz', author='Connor Sanders', author_email='connor@exceleri.com', license='MIT', diff --git a/test/test_yahoofinancials.py b/test/test_yahoofinancials.py index 9bcd9b7..2b79bc6 100644 --- a/test/test_yahoofinancials.py +++ b/test/test_yahoofinancials.py @@ -1,12 +1,11 @@ -# YahooFinancials Unit Tests v1.4 -# Version Released: 01/13/2019 +# YahooFinancials Unit Tests v1.5 +# Version Released: 01/27/2019 # Author: Connor Sanders # Tested on Python 2.7, 3.3, 3.4, 3.5, 3.6, and 3.7 # Copyright (c) 2019 Connor Sanders # MIT License import sys -import datetime from yahoofinancials import YahooFinancials if sys.version_info < (2, 7): diff --git a/yahoofinancials/__init__.py b/yahoofinancials/__init__.py index 2d41a20..294392b 100644 --- a/yahoofinancials/__init__.py +++ b/yahoofinancials/__init__.py @@ -1,12 +1,12 @@ """ ============================== The Yahoo Financials Module -Version: 1.4 +Version: 1.5 ============================== Author: Connor Sanders Email: sandersconnor1@gmail.com -Version Released: 01/13/2019 +Version Released: 01/27/2019 Tested on Python 2.7, 3.3, 3.4, 3.5, 3.6, and 3.7 Copyright (c) 2019 Connor Sanders @@ -569,7 +569,6 @@ def get_stock_dividend_data(self, start, end, interval): re_data.update({tick: div_data}) except: re_data.update({tick: None}) - print(re_data) return re_data