This repository has been archived by the owner on Apr 30, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 339
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* support exporting table zip files * update doc
- Loading branch information
Showing
8 changed files
with
247 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
from quandl.errors.quandl_error import InvalidRequestError | ||
from .utils.api_key_util import ApiKeyUtil | ||
from .model.datatable import Datatable | ||
from .message import Message | ||
|
||
|
||
def export_table(datatable_code, **kwargs): | ||
"""Downloads an entire table as a zip file. | ||
:param str datatable_code: The datatable code to download, such as MER/F1 | ||
:param str filename: The filename for the download. \ | ||
If not specified, will download to the current working directory | ||
:param str api_key: Most databases require api_key for bulk download | ||
""" | ||
|
||
# discourage users from using authtoken | ||
if 'authtoken' in kwargs: | ||
raise InvalidRequestError(Message.ERROR_AUTHTOKEN_NOT_SUPPORTED) | ||
|
||
ApiKeyUtil.init_api_key_from_args(kwargs) | ||
|
||
filename = kwargs.pop('filename', '.') | ||
return Datatable(datatable_code).download_file(filename, **kwargs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters