def format_wiki_url(api_key, symbol, start_date, end_date):
 query_params = [('start_date', start_date.strftime('%Y-%m-%d')), ('end_date', end_date.strftime('%Y-%m-%d')), ('order', 'asc')]
 if (api_key is not None):
  query_params = ([('api_key', api_key)] + query_params)
 return 'https://www.quandl.com/api/v3/datasets/WIKI/{symbol}.csv?{query}'.format(symbol=symbol, query=urlencode(query_params))

def format_wiki_url ( api_key , symbol , start_date , end_date ) : query_params = [ ( 'start_date' , start_date . strftime ( '%Y-%m-%d' ) ) , ( 'end_date' , end_date . strftime ( '%Y-%m-%d' ) ) , ( 'order' , 'asc' ) ] if ( api_key is not None ) : query_params = ( [ ( 'api_key' , api_key ) ] + query_params ) return 'https://www.quandl.com/api/v3/datasets/WIKI/{symbol}.csv?{query}' . format ( symbol = symbol , query = urlencode ( query_params ) )
build a query url for a quandl wiki dataset .