From 2118659da5b8347b0e8128a6b6712f695b4708ce Mon Sep 17 00:00:00 2001 From: ChrisStevens Date: Tue, 23 Feb 2016 12:55:11 -0500 Subject: [PATCH] Push is no longer supported --- Quandl/Quandl.py | 73 ------------------------------------------------ 1 file changed, 73 deletions(-) diff --git a/Quandl/Quandl.py b/Quandl/Quandl.py index a0787a4..fd84a82 100644 --- a/Quandl/Quandl.py +++ b/Quandl/Quandl.py @@ -141,79 +141,6 @@ def get(dataset, **kwargs): return urldata -def push(data, code, name, authtoken='', desc='', override=False, verbose=False, text=None): - ''' Upload a pandas Dataframe to Quandl and returns link to the dataset. - :param data: (required), pandas ts or numpy array - :param str code: (required), Dataset code - must consist of only capital letters, numbers, and underscores - :param str name: (required), Dataset name - :param str authtoken: (required), to upload data - :param str desc: (optional), Description of dataset - :param bool overide: (optional), whether to overide dataset of same code - :param bool verbose: specify whether to print output text to stdout, default is False. - :param str text: Deprecated. Use `verbose` instead. - :returns: :str: link to uploaded dataset''' - - override = str(override).lower() - if text is not None: - print('Deprecated: "text" is deprecated and will be removed in next release, use "verbose" instead.') - verbose = text - token = _getauthtoken(authtoken, verbose) - if token == '': - error = ("You need an API token to upload your data to Quandl, " - "please see www.quandl.com/API for more information.") - raise MissingToken(error) - - #test that code is acceptable format - _pushcodetest(code) - datestr = '' - - # Verify and format the data for upload. - if not isinstance(data, pd.core.frame.DataFrame): - error = "only pandas DataFrames are accepted for upload at this time" - raise ValueError(error) - - # check if indexed by date - data_interm = data.to_records() - index = data_interm.dtype.names - datestr += ','.join(index) + '\n' - - #format data for uploading - for i in data_interm: - # Check if index is a date - if isinstance(i[0], datetime.datetime): - datestr += i[0].date().isoformat() - else: - try: - datestr += _parse_dates(str(i[0])) - except ValueError: - error = ("Please check your indices, one of them is " - "not a recognizable date") - raise DateNotRecognized(error) - for n in i: - if isinstance(n, (float, int)): - datestr += ',' + str(n) - datestr += '\n' - - params = {'name': name, - 'code': code, - 'description': desc, - 'update_or_create': override, - 'data': datestr} - - url = QUANDL_API_URL + 'datasets.json?auth_token=' + token - jsonreturn = _htmlpush(url, params) - if (jsonreturn['errors'] - and jsonreturn['errors']['code'][0] == 'has already been taken'): - error = ("You are trying to overwrite a dataset which already " - "exists on Quandl. If this is what you wish to do please " - "recall the function with overide = True") - raise ValueError(error) - - rtn = ('http://www.quandl.com/' + jsonreturn['source_code'] + '/' + - jsonreturn['code']) - #Return URL of uploaded dataset - return rtn def search(query, source=None, page=1, authtoken=None, verbose=True, prints=None):