Skip to content

Commit

Permalink
#11 bug fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
JECSand committed Aug 29, 2018
1 parent 28d2bda commit 4d47223
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions yahoofinancials/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
import time
from bs4 import BeautifulSoup
import datetime
from datetime import date
import pytz
try:
from urllib import FancyURLopener
Expand Down Expand Up @@ -106,15 +105,10 @@ def get_report_type(frequency):
# Public static method to format date serial string to readable format and vice versa
@staticmethod
def format_date(in_date):
print(in_date)
if isinstance(in_date, str):
year, month, day = in_date.split()[0].split('-')
d = date(int(year), int(month), int(day))
#form_date = int(time.mktime(d.timetuple()))
form_date = int(calendar.timegm(time.strptime(in_date, '%Y-%m-%d')))
else:
form_date = str((datetime.datetime(1970, 1, 1) + datetime.timedelta(seconds=in_date)).date())
print(form_date)
return form_date

# Private Static Method to Convert Eastern Time to UTC
Expand Down Expand Up @@ -293,7 +287,6 @@ def _build_api_url(hist_obj, up_ticker):
api_url = base_url + up_ticker + '?symbol= ' + up_ticker + '&period1=' + str(hist_obj['start']) + '&period2=' +\
str(hist_obj['end']) + '&interval=' + hist_obj['interval']
api_url += '&events=div|split|earn&lang=en-US&region=US'
print(api_url)
return api_url

# Private Static Method to get financial data via API Call
Expand Down

0 comments on commit 4d47223

Please sign in to comment.