{"action":"created","comment":{"url":"https://api.github.com/repos/quandl/quandl-python/pulls/comments/224881469","pull_request_review_id":164364828,"id":224881469,"node_id":"MDI0OlB1bGxSZXF1ZXN0UmV2aWV3Q29tbWVudDIyNDg4MTQ2OQ==","diff_hunk":"@@ -14,3 +30,54 @@ def get_path(cls):\n     def data(self, **options):\n         updated_options = Util.convert_options(**options)\n         return Data.page(self, **updated_options)\n+\n+    def bulk_download_file(self, file_or_folder_path, **options):\n+        if not isinstance(file_or_folder_path, str):\n+            raise QuandlError(Message.ERROR_FOLDER_ISSUE)\n+\n+        return self._url_request(file_or_folder_path, **options)\n+\n+    def _url_request(self, file_or_folder_path, **options):\n+        url = self._download_request_path()\n+        code_name = self.code\n+        if 'params' not in options:\n+            options['params'] = {}\n+        if ApiConfig.api_key:\n+            options['params']['api_key'] = ApiConfig.api_key\n+        if ApiConfig.api_version:\n+            options['params']['api_version'] = ApiConfig.api_version\n+\n+        if list(options.keys()):\n+            url += '.json?qopts.export=true&' + urlencode(options['params'])\n+\n+        r = Connection.request('get', url, **options)\n+        response_data = r.json()\n+\n+        status = response_data['datatable_bulk_download']['file']['status']\n+\n+        if status == 'fresh':\n+            file_link = response_data['datatable_bulk_download']['file']['link']\n+\n+            file_path = file_or_folder_path\n+            if os.path.isdir(file_or_folder_path):\n+                file_path = file_or_folder_path + '/' + code_name.replace('/', '_') + '.zip'\n+\n+            res = urlopen(file_link)\n+\n+            with open(file_path, 'wb') as fd:\n+                while True:\n+                    chunk = res.read(self.BULK_CHUNK_SIZE)\n+                    if not chunk:\n+                        break\n+                    fd.write(chunk)\n+\n+            return file_path\n+        else:\n+            print(Message.LONG_GENERATION_TIME)\n+            self._url_request(file_or_folder_path, **options)","path":"quandl/model/datatable.py","position":77,"original_position":77,"commit_id":"ff664a8052be9439e91be22a7c5d236aa4fe45b3","original_commit_id":"ff664a8052be9439e91be22a7c5d236aa4fe45b3","user":{"login":"fengshuo","id":1814753,"node_id":"MDQ6VXNlcjE4MTQ3NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1814753?v=4","gravatar_id":"","url":"https://api.github.com/users/fengshuo","html_url":"https://github.com/fengshuo","followers_url":"https://api.github.com/users/fengshuo/followers","following_url":"https://api.github.com/users/fengshuo/following{/other_user}","gists_url":"https://api.github.com/users/fengshuo/gists{/gist_id}","starred_url":"https://api.github.com/users/fengshuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengshuo/subscriptions","organizations_url":"https://api.github.com/users/fengshuo/orgs","repos_url":"https://api.github.com/users/fengshuo/repos","events_url":"https://api.github.com/users/fengshuo/events{/privacy}","received_events_url":"https://api.github.com/users/fengshuo/received_events","type":"User","site_admin":false},"body":"ah yeah i changed the order here yesterday good catch","created_at":"2018-10-12T18:43:12Z","updated_at":"2018-10-12T18:43:13Z","html_url":"https://github.com/quandl/quandl-python/pull/120#discussion_r224881469","pull_request_url":"https://api.github.com/repos/quandl/quandl-python/pulls/120","author_association":"NONE","_links":{"self":{"href":"https://api.github.com/repos/quandl/quandl-python/pulls/comments/224881469"},"html":{"href":"https://github.com/quandl/quandl-python/pull/120#discussion_r224881469"},"pull_request":{"href":"https://api.github.com/repos/quandl/quandl-python/pulls/120"}},"in_reply_to_id":224816291},"pull_request":{"url":"https://api.github.com/repos/quandl/quandl-python/pulls/120","id":221946841,"node_id":"MDExOlB1bGxSZXF1ZXN0MjIxOTQ2ODQx","html_url":"https://github.com/quandl/quandl-python/pull/120","diff_url":"https://github.com/quandl/quandl-python/pull/120.diff","patch_url":"https://github.com/quandl/quandl-python/pull/120.patch","issue_url":"https://api.github.com/repos/quandl/quandl-python/issues/120","number":120,"state":"open","locked":false,"title":"add exporting table files","user":{"login":"fengshuo","id":1814753,"node_id":"MDQ6VXNlcjE4MTQ3NTM=","avatar_url":"https://avatars3.githubusercontent.com/u/1814753?v=4","gravatar_id":"","url":"https://api.github.com/users/fengshuo","html_url":"https://github.com/fengshuo","followers_url":"https://api.github.com/users/fengshuo/followers","following_url":"https://api.github.com/users/fengshuo/following{/other_user}","gists_url":"https://api.github.com/users/fengshuo/gists{/gist_id}","starred_url":"https://api.github.com/users/fengshuo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/fengshuo/subscriptions","organizations_url":"https://api.github.com/users/fengshuo/orgs","repos_url":"https://api.github.com/users/fengshuo/repos","events_url":"https://api.github.com/users/fengshuo/events{/privacy}","received_events_url":"https://api.github.com/users/fengshuo/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-10-10T22:00:33Z","updated_at":"2018-10-12T18:43:13Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5cb6ffd71b86657e91c64749660cad22b8925fc6","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[{"id":345213760,"node_id":"MDU6TGFiZWwzNDUyMTM3NjA=","url":"https://api.github.com/repos/quandl/quandl-python/labels/ready%20for%20review","name":"ready for review","color":"c7def8","default":false}],"milestone":null,"commits_url":"https://api.github.com/repos/quandl/quandl-python/pulls/120/commits","review_comments_url":"https://api.github.com/repos/quandl/quandl-python/pulls/120/comments","review_comment_url":"https://api.github.com/repos/quandl/quandl-python/pulls/comments{/number}","comments_url":"https://api.github.com/repos/quandl/quandl-python/issues/120/comments","statuses_url":"https://api.github.com/repos/quandl/quandl-python/statuses/ff664a8052be9439e91be22a7c5d236aa4fe45b3","head":{"label":"quandl:CP-7116/python-download","ref":"CP-7116/python-download","sha":"ff664a8052be9439e91be22a7c5d236aa4fe45b3","user":{"login":"quandl","id":1659378,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTkzNzg=","avatar_url":"https://avatars0.githubusercontent.com/u/1659378?v=4","gravatar_id":"","url":"https://api.github.com/users/quandl","html_url":"https://github.com/quandl","followers_url":"https://api.github.com/users/quandl/followers","following_url":"https://api.github.com/users/quandl/following{/other_user}","gists_url":"https://api.github.com/users/quandl/gists{/gist_id}","starred_url":"https://api.github.com/users/quandl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quandl/subscriptions","organizations_url":"https://api.github.com/users/quandl/orgs","repos_url":"https://api.github.com/users/quandl/repos","events_url":"https://api.github.com/users/quandl/events{/privacy}","received_events_url":"https://api.github.com/users/quandl/received_events","type":"Organization","site_admin":false},"repo":{"id":8986011,"node_id":"MDEwOlJlcG9zaXRvcnk4OTg2MDEx","name":"quandl-python","full_name":"quandl/quandl-python","private":false,"owner":{"login":"quandl","id":1659378,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTkzNzg=","avatar_url":"https://avatars0.githubusercontent.com/u/1659378?v=4","gravatar_id":"","url":"https://api.github.com/users/quandl","html_url":"https://github.com/quandl","followers_url":"https://api.github.com/users/quandl/followers","following_url":"https://api.github.com/users/quandl/following{/other_user}","gists_url":"https://api.github.com/users/quandl/gists{/gist_id}","starred_url":"https://api.github.com/users/quandl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quandl/subscriptions","organizations_url":"https://api.github.com/users/quandl/orgs","repos_url":"https://api.github.com/users/quandl/repos","events_url":"https://api.github.com/users/quandl/events{/privacy}","received_events_url":"https://api.github.com/users/quandl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/quandl/quandl-python","description":null,"fork":false,"url":"https://api.github.com/repos/quandl/quandl-python","forks_url":"https://api.github.com/repos/quandl/quandl-python/forks","keys_url":"https://api.github.com/repos/quandl/quandl-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quandl/quandl-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quandl/quandl-python/teams","hooks_url":"https://api.github.com/repos/quandl/quandl-python/hooks","issue_events_url":"https://api.github.com/repos/quandl/quandl-python/issues/events{/number}","events_url":"https://api.github.com/repos/quandl/quandl-python/events","assignees_url":"https://api.github.com/repos/quandl/quandl-python/assignees{/user}","branches_url":"https://api.github.com/repos/quandl/quandl-python/branches{/branch}","tags_url":"https://api.github.com/repos/quandl/quandl-python/tags","blobs_url":"https://api.github.com/repos/quandl/quandl-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quandl/quandl-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quandl/quandl-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/quandl/quandl-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quandl/quandl-python/statuses/{sha}","languages_url":"https://api.github.com/repos/quandl/quandl-python/languages","stargazers_url":"https://api.github.com/repos/quandl/quandl-python/stargazers","contributors_url":"https://api.github.com/repos/quandl/quandl-python/contributors","subscribers_url":"https://api.github.com/repos/quandl/quandl-python/subscribers","subscription_url":"https://api.github.com/repos/quandl/quandl-python/subscription","commits_url":"https://api.github.com/repos/quandl/quandl-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/quandl/quandl-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/quandl/quandl-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/quandl/quandl-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/quandl/quandl-python/contents/{+path}","compare_url":"https://api.github.com/repos/quandl/quandl-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quandl/quandl-python/merges","archive_url":"https://api.github.com/repos/quandl/quandl-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quandl/quandl-python/downloads","issues_url":"https://api.github.com/repos/quandl/quandl-python/issues{/number}","pulls_url":"https://api.github.com/repos/quandl/quandl-python/pulls{/number}","milestones_url":"https://api.github.com/repos/quandl/quandl-python/milestones{/number}","notifications_url":"https://api.github.com/repos/quandl/quandl-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quandl/quandl-python/labels{/name}","releases_url":"https://api.github.com/repos/quandl/quandl-python/releases{/id}","deployments_url":"https://api.github.com/repos/quandl/quandl-python/deployments","created_at":"2013-03-24T12:53:23Z","updated_at":"2018-10-12T03:36:56Z","pushed_at":"2018-10-12T14:23:48Z","git_url":"git://github.com/quandl/quandl-python.git","ssh_url":"git@github.com:quandl/quandl-python.git","clone_url":"https://github.com/quandl/quandl-python.git","svn_url":"https://github.com/quandl/quandl-python","homepage":null,"size":147,"stargazers_count":679,"watchers_count":679,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":208,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":208,"open_issues":2,"watchers":679,"default_branch":"master"}},"base":{"label":"quandl:master","ref":"master","sha":"46df6b4b48d6ab96e5f2a3e51707450730862203","user":{"login":"quandl","id":1659378,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTkzNzg=","avatar_url":"https://avatars0.githubusercontent.com/u/1659378?v=4","gravatar_id":"","url":"https://api.github.com/users/quandl","html_url":"https://github.com/quandl","followers_url":"https://api.github.com/users/quandl/followers","following_url":"https://api.github.com/users/quandl/following{/other_user}","gists_url":"https://api.github.com/users/quandl/gists{/gist_id}","starred_url":"https://api.github.com/users/quandl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quandl/subscriptions","organizations_url":"https://api.github.com/users/quandl/orgs","repos_url":"https://api.github.com/users/quandl/repos","events_url":"https://api.github.com/users/quandl/events{/privacy}","received_events_url":"https://api.github.com/users/quandl/received_events","type":"Organization","site_admin":false},"repo":{"id":8986011,"node_id":"MDEwOlJlcG9zaXRvcnk4OTg2MDEx","name":"quandl-python","full_name":"quandl/quandl-python","private":false,"owner":{"login":"quandl","id":1659378,"node_id":"MDEyOk9yZ2FuaXphdGlvbjE2NTkzNzg=","avatar_url":"https://avatars0.githubusercontent.com/u/1659378?v=4","gravatar_id":"","url":"https://api.github.com/users/quandl","html_url":"https://github.com/quandl","followers_url":"https://api.github.com/users/quandl/followers","following_url":"https://api.github.com/users/quandl/following{/other_user}","gists_url":"https://api.github.com/users/quandl/gists{/gist_id}","starred_url":"https://api.github.com/users/quandl/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/quandl/subscriptions","organizations_url":"https://api.github.com/users/quandl/orgs","repos_url":"https://api.github.com/users/quandl/repos","events_url":"https://api.github.com/users/quandl/events{/privacy}","received_events_url":"https://api.github.com/users/quandl/received_events","type":"Organization","site_admin":false},"html_url":"https://github.com/quandl/quandl-python","description":null,"fork":false,"url":"https://api.github.com/repos/quandl/quandl-python","forks_url":"https://api.github.com/repos/quandl/quandl-python/forks","keys_url":"https://api.github.com/repos/quandl/quandl-python/keys{/key_id}","collaborators_url":"https://api.github.com/repos/quandl/quandl-python/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/quandl/quandl-python/teams","hooks_url":"https://api.github.com/repos/quandl/quandl-python/hooks","issue_events_url":"https://api.github.com/repos/quandl/quandl-python/issues/events{/number}","events_url":"https://api.github.com/repos/quandl/quandl-python/events","assignees_url":"https://api.github.com/repos/quandl/quandl-python/assignees{/user}","branches_url":"https://api.github.com/repos/quandl/quandl-python/branches{/branch}","tags_url":"https://api.github.com/repos/quandl/quandl-python/tags","blobs_url":"https://api.github.com/repos/quandl/quandl-python/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/quandl/quandl-python/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/quandl/quandl-python/git/refs{/sha}","trees_url":"https://api.github.com/repos/quandl/quandl-python/git/trees{/sha}","statuses_url":"https://api.github.com/repos/quandl/quandl-python/statuses/{sha}","languages_url":"https://api.github.com/repos/quandl/quandl-python/languages","stargazers_url":"https://api.github.com/repos/quandl/quandl-python/stargazers","contributors_url":"https://api.github.com/repos/quandl/quandl-python/contributors","subscribers_url":"https://api.github.com/repos/quandl/quandl-python/subscribers","subscription_url":"https://api.github.com/repos/quandl/quandl-python/subscription","commits_url":"https://api.github.com/repos/quandl/quandl-python/commits{/sha}","git_commits_url":"https://api.github.com/repos/quandl/quandl-python/git/commits{/sha}","comments_url":"https://api.github.com/repos/quandl/quandl-python/comments{/number}","issue_comment_url":"https://api.github.com/repos/quandl/quandl-python/issues/comments{/number}","contents_url":"https://api.github.com/repos/quandl/quandl-python/contents/{+path}","compare_url":"https://api.github.com/repos/quandl/quandl-python/compare/{base}...{head}","merges_url":"https://api.github.com/repos/quandl/quandl-python/merges","archive_url":"https://api.github.com/repos/quandl/quandl-python/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/quandl/quandl-python/downloads","issues_url":"https://api.github.com/repos/quandl/quandl-python/issues{/number}","pulls_url":"https://api.github.com/repos/quandl/quandl-python/pulls{/number}","milestones_url":"https://api.github.com/repos/quandl/quandl-python/milestones{/number}","notifications_url":"https://api.github.com/repos/quandl/quandl-python/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/quandl/quandl-python/labels{/name}","releases_url":"https://api.github.com/repos/quandl/quandl-python/releases{/id}","deployments_url":"https://api.github.com/repos/quandl/quandl-python/deployments","created_at":"2013-03-24T12:53:23Z","updated_at":"2018-10-12T03:36:56Z","pushed_at":"2018-10-12T14:23:48Z","git_url":"git://github.com/quandl/quandl-python.git","ssh_url":"git@github.com:quandl/quandl-python.git","clone_url":"https://github.com/quandl/quandl-python.git","svn_url":"https://github.com/quandl/quandl-python","homepage":null,"size":147,"stargazers_count":679,"watchers_count":679,"language":"Python","has_issues":true,"has_projects":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":208,"mirror_url":null,"archived":false,"open_issues_count":2,"license":{"key":"mit","name":"MIT License","spdx_id":"MIT","url":"https://api.github.com/licenses/mit","node_id":"MDc6TGljZW5zZTEz"},"forks":208,"open_issues":2,"watchers":679,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/quandl/quandl-python/pulls/120"},"html":{"href":"https://github.com/quandl/quandl-python/pull/120"},"issue":{"href":"https://api.github.com/repos/quandl/quandl-python/issues/120"},"comments":{"href":"https://api.github.com/repos/quandl/quandl-python/issues/120/comments"},"review_comments":{"href":"https://api.github.com/repos/quandl/quandl-python/pulls/120/comments"},"review_comment":{"href":"https://api.github.com/repos/quandl/quandl-python/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/quandl/quandl-python/pulls/120/commits"},"statuses":{"href":"https://api.github.com/repos/quandl/quandl-python/statuses/ff664a8052be9439e91be22a7c5d236aa4fe45b3"}},"author_association":"NONE"}}
{"actor":{"display_login":"fengshuo"}}