{"action":"created","comment":{"url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/comments/75224906","id":75224906,"diff_hunk":"@@ -201,16 +202,21 @@ def add(self, files, recursive=False, **kwargs):\n         return self._add.request(self._client, (), files,\n                                  recursive=recursive, **kwargs)\n \n-    def get(self, multihash, **kwargs):\n+    def get(self, multihash, output_path='.', **kwargs):\n         \"\"\"Downloads a file, or directory of files from IPFS.\n \n-        Files are placed in the current working directory.\n+        Files are placed in the current working directory if\n+        output_path is not specified. Otherwise, they are\n+        moved to output_path.\n \n         Keyword arguments:\n         multihash -- unique checksum used to identify IPFS resources\n+        output_path -- where to put the downloaded file\n         kwargs -- additional named arguments\n         \"\"\"\n-        return self._get.request(self._client, multihash, **kwargs)\n+        self._get.request(self._client, multihash, **kwargs)\n+        if output_path is not '.':\n+            shutil.move(multihash, output_path)","path":"ipfsApi/client.py","position":29,"original_position":29,"commit_id":"a2ca38adf8b72bcf2164abe48c5223706a6c8f86","original_commit_id":"a2ca38adf8b72bcf2164abe48c5223706a6c8f86","user":{"login":"alexander255","id":246386,"avatar_url":"https://avatars.githubusercontent.com/u/246386?v=3","gravatar_id":"","url":"https://api.github.com/users/alexander255","html_url":"https://github.com/alexander255","followers_url":"https://api.github.com/users/alexander255/followers","following_url":"https://api.github.com/users/alexander255/following{/other_user}","gists_url":"https://api.github.com/users/alexander255/gists{/gist_id}","starred_url":"https://api.github.com/users/alexander255/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexander255/subscriptions","organizations_url":"https://api.github.com/users/alexander255/orgs","repos_url":"https://api.github.com/users/alexander255/repos","events_url":"https://api.github.com/users/alexander255/events{/privacy}","received_events_url":"https://api.github.com/users/alexander255/received_events","type":"User","site_admin":false},"body":"Is there really no better way to do this than to call `shutil.move`? What if the output file is very big and the output path is on a different file system? What if the current working directory isn't writable?","created_at":"2016-08-17T23:15:09Z","updated_at":"2016-08-17T23:15:09Z","html_url":"https://github.com/ipfs/py-ipfs-api/pull/62#discussion_r75224906","pull_request_url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62","_links":{"self":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/comments/75224906"},"html":{"href":"https://github.com/ipfs/py-ipfs-api/pull/62#discussion_r75224906"},"pull_request":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62"}}},"pull_request":{"url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62","id":81693052,"html_url":"https://github.com/ipfs/py-ipfs-api/pull/62","diff_url":"https://github.com/ipfs/py-ipfs-api/pull/62.diff","patch_url":"https://github.com/ipfs/py-ipfs-api/pull/62.patch","issue_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/62","number":62,"state":"open","locked":false,"title":"Update get function to accept destination path","user":{"login":"whereswaldon","id":3922125,"avatar_url":"https://avatars.githubusercontent.com/u/3922125?v=3","gravatar_id":"","url":"https://api.github.com/users/whereswaldon","html_url":"https://github.com/whereswaldon","followers_url":"https://api.github.com/users/whereswaldon/followers","following_url":"https://api.github.com/users/whereswaldon/following{/other_user}","gists_url":"https://api.github.com/users/whereswaldon/gists{/gist_id}","starred_url":"https://api.github.com/users/whereswaldon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/whereswaldon/subscriptions","organizations_url":"https://api.github.com/users/whereswaldon/orgs","repos_url":"https://api.github.com/users/whereswaldon/repos","events_url":"https://api.github.com/users/whereswaldon/events{/privacy}","received_events_url":"https://api.github.com/users/whereswaldon/received_events","type":"User","site_admin":false},"body":"Now the `api.get()` function can accept a filepath that it will move the downloaded file to. This mimics the functionality of `ipfs get <hash> -o <path>`. This PR should resolve #48 ","created_at":"2016-08-17T18:32:11Z","updated_at":"2016-08-17T23:15:09Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1f9666b513c7edca3c3baacfbef99d34e2978b51","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62/commits","review_comments_url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62/comments","review_comment_url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/62/comments","statuses_url":"https://api.github.com/repos/ipfs/py-ipfs-api/statuses/a2ca38adf8b72bcf2164abe48c5223706a6c8f86","head":{"label":"ipfs:get-filename","ref":"get-filename","sha":"a2ca38adf8b72bcf2164abe48c5223706a6c8f86","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":41890299,"name":"py-ipfs-api","full_name":"ipfs/py-ipfs-api","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/py-ipfs-api","description":"A python client library for the IPFS API","fork":false,"url":"https://api.github.com/repos/ipfs/py-ipfs-api","forks_url":"https://api.github.com/repos/ipfs/py-ipfs-api/forks","keys_url":"https://api.github.com/repos/ipfs/py-ipfs-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/py-ipfs-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/py-ipfs-api/teams","hooks_url":"https://api.github.com/repos/ipfs/py-ipfs-api/hooks","issue_events_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/py-ipfs-api/events","assignees_url":"https://api.github.com/repos/ipfs/py-ipfs-api/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/py-ipfs-api/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/py-ipfs-api/tags","blobs_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/py-ipfs-api/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/py-ipfs-api/languages","stargazers_url":"https://api.github.com/repos/ipfs/py-ipfs-api/stargazers","contributors_url":"https://api.github.com/repos/ipfs/py-ipfs-api/contributors","subscribers_url":"https://api.github.com/repos/ipfs/py-ipfs-api/subscribers","subscription_url":"https://api.github.com/repos/ipfs/py-ipfs-api/subscription","commits_url":"https://api.github.com/repos/ipfs/py-ipfs-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/py-ipfs-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/py-ipfs-api/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/py-ipfs-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/py-ipfs-api/merges","archive_url":"https://api.github.com/repos/ipfs/py-ipfs-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/py-ipfs-api/downloads","issues_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/py-ipfs-api/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/py-ipfs-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/py-ipfs-api/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/py-ipfs-api/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/py-ipfs-api/deployments","created_at":"2015-09-04T00:23:43Z","updated_at":"2016-08-15T15:39:29Z","pushed_at":"2016-08-17T18:32:11Z","git_url":"git://github.com/ipfs/py-ipfs-api.git","ssh_url":"git@github.com:ipfs/py-ipfs-api.git","clone_url":"https://github.com/ipfs/py-ipfs-api.git","svn_url":"https://github.com/ipfs/py-ipfs-api","homepage":"","size":375,"stargazers_count":75,"watchers_count":75,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":16,"forks":25,"open_issues":16,"watchers":75,"default_branch":"master"}},"base":{"label":"ipfs:master","ref":"master","sha":"db6afe1cc3fc0bfa70b3a6c42f4990b4ed327d98","user":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"repo":{"id":41890299,"name":"py-ipfs-api","full_name":"ipfs/py-ipfs-api","owner":{"login":"ipfs","id":10536621,"avatar_url":"https://avatars.githubusercontent.com/u/10536621?v=3","gravatar_id":"","url":"https://api.github.com/users/ipfs","html_url":"https://github.com/ipfs","followers_url":"https://api.github.com/users/ipfs/followers","following_url":"https://api.github.com/users/ipfs/following{/other_user}","gists_url":"https://api.github.com/users/ipfs/gists{/gist_id}","starred_url":"https://api.github.com/users/ipfs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ipfs/subscriptions","organizations_url":"https://api.github.com/users/ipfs/orgs","repos_url":"https://api.github.com/users/ipfs/repos","events_url":"https://api.github.com/users/ipfs/events{/privacy}","received_events_url":"https://api.github.com/users/ipfs/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ipfs/py-ipfs-api","description":"A python client library for the IPFS API","fork":false,"url":"https://api.github.com/repos/ipfs/py-ipfs-api","forks_url":"https://api.github.com/repos/ipfs/py-ipfs-api/forks","keys_url":"https://api.github.com/repos/ipfs/py-ipfs-api/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ipfs/py-ipfs-api/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ipfs/py-ipfs-api/teams","hooks_url":"https://api.github.com/repos/ipfs/py-ipfs-api/hooks","issue_events_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/events{/number}","events_url":"https://api.github.com/repos/ipfs/py-ipfs-api/events","assignees_url":"https://api.github.com/repos/ipfs/py-ipfs-api/assignees{/user}","branches_url":"https://api.github.com/repos/ipfs/py-ipfs-api/branches{/branch}","tags_url":"https://api.github.com/repos/ipfs/py-ipfs-api/tags","blobs_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/refs{/sha}","trees_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ipfs/py-ipfs-api/statuses/{sha}","languages_url":"https://api.github.com/repos/ipfs/py-ipfs-api/languages","stargazers_url":"https://api.github.com/repos/ipfs/py-ipfs-api/stargazers","contributors_url":"https://api.github.com/repos/ipfs/py-ipfs-api/contributors","subscribers_url":"https://api.github.com/repos/ipfs/py-ipfs-api/subscribers","subscription_url":"https://api.github.com/repos/ipfs/py-ipfs-api/subscription","commits_url":"https://api.github.com/repos/ipfs/py-ipfs-api/commits{/sha}","git_commits_url":"https://api.github.com/repos/ipfs/py-ipfs-api/git/commits{/sha}","comments_url":"https://api.github.com/repos/ipfs/py-ipfs-api/comments{/number}","issue_comment_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/comments{/number}","contents_url":"https://api.github.com/repos/ipfs/py-ipfs-api/contents/{+path}","compare_url":"https://api.github.com/repos/ipfs/py-ipfs-api/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ipfs/py-ipfs-api/merges","archive_url":"https://api.github.com/repos/ipfs/py-ipfs-api/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ipfs/py-ipfs-api/downloads","issues_url":"https://api.github.com/repos/ipfs/py-ipfs-api/issues{/number}","pulls_url":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls{/number}","milestones_url":"https://api.github.com/repos/ipfs/py-ipfs-api/milestones{/number}","notifications_url":"https://api.github.com/repos/ipfs/py-ipfs-api/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ipfs/py-ipfs-api/labels{/name}","releases_url":"https://api.github.com/repos/ipfs/py-ipfs-api/releases{/id}","deployments_url":"https://api.github.com/repos/ipfs/py-ipfs-api/deployments","created_at":"2015-09-04T00:23:43Z","updated_at":"2016-08-15T15:39:29Z","pushed_at":"2016-08-17T18:32:11Z","git_url":"git://github.com/ipfs/py-ipfs-api.git","ssh_url":"git@github.com:ipfs/py-ipfs-api.git","clone_url":"https://github.com/ipfs/py-ipfs-api.git","svn_url":"https://github.com/ipfs/py-ipfs-api","homepage":"","size":375,"stargazers_count":75,"watchers_count":75,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":25,"mirror_url":null,"open_issues_count":16,"forks":25,"open_issues":16,"watchers":75,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62"},"html":{"href":"https://github.com/ipfs/py-ipfs-api/pull/62"},"issue":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/62"},"comments":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/issues/62/comments"},"review_comments":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62/comments"},"review_comment":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/pulls/62/commits"},"statuses":{"href":"https://api.github.com/repos/ipfs/py-ipfs-api/statuses/a2ca38adf8b72bcf2164abe48c5223706a6c8f86"}}}}
{"actor":{"display_login":"alexander255"}}