Skip to content

Commit

Permalink
Merge pull request quandl#36 from brianrisk/master
Browse files Browse the repository at this point in the history
made modifying version in request_version easier
  • Loading branch information
ChrisStevens committed May 14, 2015
2 parents d0e30ec + a73e884 commit 727dd49
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions Quandl/Quandl.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@

#Base API call URL
QUANDL_API_URL = 'https://www.quandl.com/api/v1/'
VERSION = '2.8.7'


def get(dataset, **kwargs):
Expand Down Expand Up @@ -228,7 +229,7 @@ def search(query, source=None, page=1, authtoken=None, verbose=True, prints=None
print('Deprecated: "prints" is depreciated and will be removed in next release, use "verbose" instead.')
verbose = prints
token = _getauthtoken(authtoken, verbose)
search_url = QUANDL_API_URL + '/datasets.json?request_source=python&request_version=2&query='
search_url = QUANDL_API_URL + '/datasets.json?request_source=python&request_version=' + VERSION + '&query='
#parse query for proper API submission
parsedquery = re.sub(" ", "+", query)
parsedquery = re.sub("&", "+", parsedquery)
Expand Down Expand Up @@ -339,7 +340,7 @@ def _getauthtoken(token,text):
def _append_query_fields(url, **kwargs):
field_values = ['{0}={1}'.format(key, val)
for key, val in kwargs.items() if val]
return url + 'request_source=python&request_version=2&' +'&'.join(field_values)
return url + 'request_source=python&request_version=' + VERSION + '&' +'&'.join(field_values)

# Setup custom Exceptions

Expand Down
2 changes: 1 addition & 1 deletion Quandl/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
__email__ = '[email protected]'
__url__ = 'http://www.quandl.com/'
__license__ = 'MIT'
__version__ = '2.8.6'
__version__ = '2.8.7'

#############################################
#
Expand Down

0 comments on commit 727dd49

Please sign in to comment.