import tcxparser
from darksky import forecast
from configparser import ConfigParser

# Darksky weather API.
# Create config file manually
parser = ConfigParser()
parser.read('slowburn.config', encoding='utf-8')
darksky_key = parser.get('darksky', 'key')

tcx = tcxparser.TCXParser('gps_logs/2017-06-15_Running.tcx')

print(tcx.duration)
boston = forecast(darksky_key, 42.3601, -71.0589)
print(boston)

@@ -19,37 +19,8 @@
 rom 
-darksky import forecast%0Afrom 
 conf
@@ -48,16 +48,122 @@
 gParser%0A
+from datetime import datetime%0Aimport urllib.request%0Aimport dateutil.parser%0A%0At = '1984-06-02T19:05:00.000Z'
 %0A# Darks
@@ -176,17 +176,16 @@
 ther API
-.
 %0A# Creat
@@ -389,46 +389,307 @@
 x')%0A
-%0Aprint(tcx.duration)%0Aboston = 
+run_time = tcx.completed_at%0A%0Adef convert_time_to_unix(time):%0A    parsed_time = dateutil.parser.parse(time)%0A    time_in_unix = parsed_time.strftime('%25s')%0A    return time_in_unix%0A%0Aunix_run_time = convert_time_to_unix(run_time)%0Adarksky_request = urllib.request.urlopen(%22https://api.darksky.net/
 forecast
 (dar
@@ -684,17 +684,21 @@
 forecast
-(
+/%22 + 
 darksky_
@@ -704,18 +704,21 @@
 _key
-,
  
++ %22/
 42.3601,
  -71
@@ -717,17 +717,16 @@
 601,
- 
 -71.0589
 )%0Apr
@@ -725,20 +725,255 @@
 0589
-)%0Aprint(boston
+,%22 + unix_run_time + %22?exclude=currently,flags%22).read()%0Aprint(darksky_request)%0A%0A%0Aclass getWeather:%0A    def __init__(self, date, time):%0A        self.date = date%0A        self.time = time%0A%0A    def goodbye(self, date):%0A        print(%22my name is %22 + date
 )%0A

Call Darksky API with TCX run time Use simpler GET request to Darksky API rather than a third party Python wrapper