Skip to content
This repository was archived by the owner on Apr 30, 2022. It is now read-only.

Commit 2118659

Browse files
committed
Push is no longer supported
1 parent 92b84b3 commit 2118659

File tree

1 file changed

+0
-73
lines changed

1 file changed

+0
-73
lines changed

Quandl/Quandl.py

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -141,79 +141,6 @@ def get(dataset, **kwargs):
141141

142142
return urldata
143143

144-
def push(data, code, name, authtoken='', desc='', override=False, verbose=False, text=None):
145-
''' Upload a pandas Dataframe to Quandl and returns link to the dataset.
146-
:param data: (required), pandas ts or numpy array
147-
:param str code: (required), Dataset code
148-
must consist of only capital letters, numbers, and underscores
149-
:param str name: (required), Dataset name
150-
:param str authtoken: (required), to upload data
151-
:param str desc: (optional), Description of dataset
152-
:param bool overide: (optional), whether to overide dataset of same code
153-
:param bool verbose: specify whether to print output text to stdout, default is False.
154-
:param str text: Deprecated. Use `verbose` instead.
155-
:returns: :str: link to uploaded dataset'''
156-
157-
override = str(override).lower()
158-
if text is not None:
159-
print('Deprecated: "text" is deprecated and will be removed in next release, use "verbose" instead.')
160-
verbose = text
161-
token = _getauthtoken(authtoken, verbose)
162-
if token == '':
163-
error = ("You need an API token to upload your data to Quandl, "
164-
"please see www.quandl.com/API for more information.")
165-
raise MissingToken(error)
166-
167-
#test that code is acceptable format
168-
_pushcodetest(code)
169-
datestr = ''
170-
171-
# Verify and format the data for upload.
172-
if not isinstance(data, pd.core.frame.DataFrame):
173-
error = "only pandas DataFrames are accepted for upload at this time"
174-
raise ValueError(error)
175-
176-
# check if indexed by date
177-
data_interm = data.to_records()
178-
index = data_interm.dtype.names
179-
datestr += ','.join(index) + '\n'
180-
181-
#format data for uploading
182-
for i in data_interm:
183-
# Check if index is a date
184-
if isinstance(i[0], datetime.datetime):
185-
datestr += i[0].date().isoformat()
186-
else:
187-
try:
188-
datestr += _parse_dates(str(i[0]))
189-
except ValueError:
190-
error = ("Please check your indices, one of them is "
191-
"not a recognizable date")
192-
raise DateNotRecognized(error)
193-
for n in i:
194-
if isinstance(n, (float, int)):
195-
datestr += ',' + str(n)
196-
datestr += '\n'
197-
198-
params = {'name': name,
199-
'code': code,
200-
'description': desc,
201-
'update_or_create': override,
202-
'data': datestr}
203-
204-
url = QUANDL_API_URL + 'datasets.json?auth_token=' + token
205-
jsonreturn = _htmlpush(url, params)
206-
if (jsonreturn['errors']
207-
and jsonreturn['errors']['code'][0] == 'has already been taken'):
208-
error = ("You are trying to overwrite a dataset which already "
209-
"exists on Quandl. If this is what you wish to do please "
210-
"recall the function with overide = True")
211-
raise ValueError(error)
212-
213-
rtn = ('http://www.quandl.com/' + jsonreturn['source_code'] + '/' +
214-
jsonreturn['code'])
215-
#Return URL of uploaded dataset
216-
return rtn
217144

218145

219146
def search(query, source=None, page=1, authtoken=None, verbose=True, prints=None):

0 commit comments

Comments
 (0)