{"action":"created","comment":{"url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/comments/25400750","id":25400750,"diff_hunk":"@@ -0,0 +1,154 @@\n+from collections import OrderedDict\n+from pyramid.view import view_config\n+from pyramid.response import Response\n+from ..embedding import embed\n+from urllib.parse import (\n+    parse_qs,\n+    urlencode,\n+)\n+\n+# includes concatenated properties\n+_tsv_mapping = OrderedDict([\n+    ('Accession', ('files.accession')),\n+    ('Experiment', ('accession')),\n+    ('Assay', ('assay_term_name')),\n+    ('Biosample term id', ('biosample_term_id')),\n+    ('Biosample term name', ('biosample_term_name')),\n+    ('Biosample type', ('biosample_type')),\n+    ('Biosample life stage', ('replicates.library.biosample.life_stage')),\n+    ('Biosample sex', ('replicates.library.biosample.sex')),\n+    ('Biosample organism', ('replicates.library.biosample.organism.name')),\n+    ('Biosample treatments', ('replicates.library.biosample.treatments.treatment_term_name')),\n+    ('Biosample subcellular fraction term name', ('replicates.library.biosample.subcellular_fraction_term_name')),\n+    ('Biosample phase', ('replicates.library.biosample.phase')),\n+    ('Experiment target', 'target.name'),\n+    ('Antibody accession', ('replicates.antibody.accession')),\n+    ('Nucleic acid term name', ('replicates.library.nucleic_acid_term_name')),\n+    ('Depleted in term name', ('replicates.library.depleted_in_term_name')),\n+    ('Library extraction method', ('replicates.library.extraction_method')),\n+    ('Library fragmentation method', ('replicates.library.fragmentation_method')),\n+    ('Libary lysis method', ('replicates.library.lysis_method')),\n+    ('Read length', ('replicates.library.read_length')),\n+    ('Paired endedness', ('replicates.library.paired_ended')),\n+    ('Experiment date released', ('date_released')),\n+    ('Project', ('award.project')),\n+    ('File format', ('files.file_format')),\n+    ('Size', ('files.file_size')),\n+    ('Output type', ('files.output_type')),\n+    ('Lab', ('files.lab')),\n+    ('md5sum', ('files.md5sum')),\n+    ('href', ('files.href')),\n+    ('Assembly', ('files.assembly'))\n+])\n+\n+\n+def dict_generator(indict, pre=None):\n+    pre = pre[:] if pre else []\n+    if isinstance(indict, dict):\n+        for key, value in indict.items():\n+            if isinstance(value, dict):\n+                for d in dict_generator(value, [key] + pre):\n+                    yield d\n+            elif isinstance(value, list) or isinstance(value, tuple):\n+                for v in value:\n+                    for d in dict_generator(v, [key] + pre):\n+                        yield d\n+            else:\n+                yield pre + [key, value]\n+    else:\n+        yield indict\n+\n+\n+@view_config(route_name='metadata', request_method='GET', renderer='tsv')\n+def metadata_tsv(context, request):\n+\n+    param_list = parse_qs(request.matchdict['search_params'].encode('utf-8'))","path":"src/encoded/views/download.py","position":65,"original_position":65,"commit_id":"c5ae2e3db1039995b5b8f84de11dda39177a52c7","original_commit_id":"c5ae2e3db1039995b5b8f84de11dda39177a52c7","user":{"login":"lrowe","id":290859,"avatar_url":"https://avatars.githubusercontent.com/u/290859?v=3","gravatar_id":"","url":"https://api.github.com/users/lrowe","html_url":"https://github.com/lrowe","followers_url":"https://api.github.com/users/lrowe/followers","following_url":"https://api.github.com/users/lrowe/following{/other_user}","gists_url":"https://api.github.com/users/lrowe/gists{/gist_id}","starred_url":"https://api.github.com/users/lrowe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lrowe/subscriptions","organizations_url":"https://api.github.com/users/lrowe/orgs","repos_url":"https://api.github.com/users/lrowe/repos","events_url":"https://api.github.com/users/lrowe/events{/privacy}","received_events_url":"https://api.github.com/users/lrowe/received_events","type":"User","site_admin":false},"body":"Any reason not to just use request.params here and supply them as the query string?","created_at":"2015-02-26T02:37:03Z","updated_at":"2015-02-26T02:37:03Z","html_url":"https://github.com/ENCODE-DCC/encoded/pull/653#discussion_r25400750","pull_request_url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653","_links":{"self":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/comments/25400750"},"html":{"href":"https://github.com/ENCODE-DCC/encoded/pull/653#discussion_r25400750"},"pull_request":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653"}}},"pull_request":{"url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653","id":30043494,"html_url":"https://github.com/ENCODE-DCC/encoded/pull/653","diff_url":"https://github.com/ENCODE-DCC/encoded/pull/653.diff","patch_url":"https://github.com/ENCODE-DCC/encoded/pull/653.patch","issue_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/653","number":653,"state":"open","locked":false,"title":"828 batch download","user":{"login":"nikhilRP","id":1268637,"avatar_url":"https://avatars.githubusercontent.com/u/1268637?v=3","gravatar_id":"","url":"https://api.github.com/users/nikhilRP","html_url":"https://github.com/nikhilRP","followers_url":"https://api.github.com/users/nikhilRP/followers","following_url":"https://api.github.com/users/nikhilRP/following{/other_user}","gists_url":"https://api.github.com/users/nikhilRP/gists{/gist_id}","starred_url":"https://api.github.com/users/nikhilRP/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nikhilRP/subscriptions","organizations_url":"https://api.github.com/users/nikhilRP/orgs","repos_url":"https://api.github.com/users/nikhilRP/repos","events_url":"https://api.github.com/users/nikhilRP/events{/privacy}","received_events_url":"https://api.github.com/users/nikhilRP/received_events","type":"User","site_admin":false},"body":"","created_at":"2015-02-26T01:35:24Z","updated_at":"2015-02-26T02:37:03Z","closed_at":null,"merged_at":null,"merge_commit_sha":"143b2a9a7a7e305df985a1d0ca7f1c6cdf1469c5","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653/commits","review_comments_url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653/comments","review_comment_url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/comments{/number}","comments_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/653/comments","statuses_url":"https://api.github.com/repos/ENCODE-DCC/encoded/statuses/c5ae2e3db1039995b5b8f84de11dda39177a52c7","head":{"label":"ENCODE-DCC:828_batch_download","ref":"828_batch_download","sha":"c5ae2e3db1039995b5b8f84de11dda39177a52c7","user":{"login":"ENCODE-DCC","id":1713898,"avatar_url":"https://avatars.githubusercontent.com/u/1713898?v=3","gravatar_id":"","url":"https://api.github.com/users/ENCODE-DCC","html_url":"https://github.com/ENCODE-DCC","followers_url":"https://api.github.com/users/ENCODE-DCC/followers","following_url":"https://api.github.com/users/ENCODE-DCC/following{/other_user}","gists_url":"https://api.github.com/users/ENCODE-DCC/gists{/gist_id}","starred_url":"https://api.github.com/users/ENCODE-DCC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ENCODE-DCC/subscriptions","organizations_url":"https://api.github.com/users/ENCODE-DCC/orgs","repos_url":"https://api.github.com/users/ENCODE-DCC/repos","events_url":"https://api.github.com/users/ENCODE-DCC/events{/privacy}","received_events_url":"https://api.github.com/users/ENCODE-DCC/received_events","type":"Organization","site_admin":false},"repo":{"id":7045549,"name":"encoded","full_name":"ENCODE-DCC/encoded","owner":{"login":"ENCODE-DCC","id":1713898,"avatar_url":"https://avatars.githubusercontent.com/u/1713898?v=3","gravatar_id":"","url":"https://api.github.com/users/ENCODE-DCC","html_url":"https://github.com/ENCODE-DCC","followers_url":"https://api.github.com/users/ENCODE-DCC/followers","following_url":"https://api.github.com/users/ENCODE-DCC/following{/other_user}","gists_url":"https://api.github.com/users/ENCODE-DCC/gists{/gist_id}","starred_url":"https://api.github.com/users/ENCODE-DCC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ENCODE-DCC/subscriptions","organizations_url":"https://api.github.com/users/ENCODE-DCC/orgs","repos_url":"https://api.github.com/users/ENCODE-DCC/repos","events_url":"https://api.github.com/users/ENCODE-DCC/events{/privacy}","received_events_url":"https://api.github.com/users/ENCODE-DCC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ENCODE-DCC/encoded","description":"Metadata database for ENCODE 3","fork":false,"url":"https://api.github.com/repos/ENCODE-DCC/encoded","forks_url":"https://api.github.com/repos/ENCODE-DCC/encoded/forks","keys_url":"https://api.github.com/repos/ENCODE-DCC/encoded/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ENCODE-DCC/encoded/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ENCODE-DCC/encoded/teams","hooks_url":"https://api.github.com/repos/ENCODE-DCC/encoded/hooks","issue_events_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/events{/number}","events_url":"https://api.github.com/repos/ENCODE-DCC/encoded/events","assignees_url":"https://api.github.com/repos/ENCODE-DCC/encoded/assignees{/user}","branches_url":"https://api.github.com/repos/ENCODE-DCC/encoded/branches{/branch}","tags_url":"https://api.github.com/repos/ENCODE-DCC/encoded/tags","blobs_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/refs{/sha}","trees_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ENCODE-DCC/encoded/statuses/{sha}","languages_url":"https://api.github.com/repos/ENCODE-DCC/encoded/languages","stargazers_url":"https://api.github.com/repos/ENCODE-DCC/encoded/stargazers","contributors_url":"https://api.github.com/repos/ENCODE-DCC/encoded/contributors","subscribers_url":"https://api.github.com/repos/ENCODE-DCC/encoded/subscribers","subscription_url":"https://api.github.com/repos/ENCODE-DCC/encoded/subscription","commits_url":"https://api.github.com/repos/ENCODE-DCC/encoded/commits{/sha}","git_commits_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/commits{/sha}","comments_url":"https://api.github.com/repos/ENCODE-DCC/encoded/comments{/number}","issue_comment_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/comments{/number}","contents_url":"https://api.github.com/repos/ENCODE-DCC/encoded/contents/{+path}","compare_url":"https://api.github.com/repos/ENCODE-DCC/encoded/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ENCODE-DCC/encoded/merges","archive_url":"https://api.github.com/repos/ENCODE-DCC/encoded/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ENCODE-DCC/encoded/downloads","issues_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues{/number}","pulls_url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls{/number}","milestones_url":"https://api.github.com/repos/ENCODE-DCC/encoded/milestones{/number}","notifications_url":"https://api.github.com/repos/ENCODE-DCC/encoded/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ENCODE-DCC/encoded/labels{/name}","releases_url":"https://api.github.com/repos/ENCODE-DCC/encoded/releases{/id}","created_at":"2012-12-07T00:52:21Z","updated_at":"2015-02-24T00:36:24Z","pushed_at":"2015-02-26T01:31:01Z","git_url":"git://github.com/ENCODE-DCC/encoded.git","ssh_url":"git@github.com:ENCODE-DCC/encoded.git","clone_url":"https://github.com/ENCODE-DCC/encoded.git","svn_url":"https://github.com/ENCODE-DCC/encoded","homepage":"https://www.encodeproject.org","size":92908,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":12,"default_branch":"master"}},"base":{"label":"ENCODE-DCC:master","ref":"master","sha":"93bb33b29faf2cb9008b21da8c777df7359880c3","user":{"login":"ENCODE-DCC","id":1713898,"avatar_url":"https://avatars.githubusercontent.com/u/1713898?v=3","gravatar_id":"","url":"https://api.github.com/users/ENCODE-DCC","html_url":"https://github.com/ENCODE-DCC","followers_url":"https://api.github.com/users/ENCODE-DCC/followers","following_url":"https://api.github.com/users/ENCODE-DCC/following{/other_user}","gists_url":"https://api.github.com/users/ENCODE-DCC/gists{/gist_id}","starred_url":"https://api.github.com/users/ENCODE-DCC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ENCODE-DCC/subscriptions","organizations_url":"https://api.github.com/users/ENCODE-DCC/orgs","repos_url":"https://api.github.com/users/ENCODE-DCC/repos","events_url":"https://api.github.com/users/ENCODE-DCC/events{/privacy}","received_events_url":"https://api.github.com/users/ENCODE-DCC/received_events","type":"Organization","site_admin":false},"repo":{"id":7045549,"name":"encoded","full_name":"ENCODE-DCC/encoded","owner":{"login":"ENCODE-DCC","id":1713898,"avatar_url":"https://avatars.githubusercontent.com/u/1713898?v=3","gravatar_id":"","url":"https://api.github.com/users/ENCODE-DCC","html_url":"https://github.com/ENCODE-DCC","followers_url":"https://api.github.com/users/ENCODE-DCC/followers","following_url":"https://api.github.com/users/ENCODE-DCC/following{/other_user}","gists_url":"https://api.github.com/users/ENCODE-DCC/gists{/gist_id}","starred_url":"https://api.github.com/users/ENCODE-DCC/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ENCODE-DCC/subscriptions","organizations_url":"https://api.github.com/users/ENCODE-DCC/orgs","repos_url":"https://api.github.com/users/ENCODE-DCC/repos","events_url":"https://api.github.com/users/ENCODE-DCC/events{/privacy}","received_events_url":"https://api.github.com/users/ENCODE-DCC/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/ENCODE-DCC/encoded","description":"Metadata database for ENCODE 3","fork":false,"url":"https://api.github.com/repos/ENCODE-DCC/encoded","forks_url":"https://api.github.com/repos/ENCODE-DCC/encoded/forks","keys_url":"https://api.github.com/repos/ENCODE-DCC/encoded/keys{/key_id}","collaborators_url":"https://api.github.com/repos/ENCODE-DCC/encoded/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/ENCODE-DCC/encoded/teams","hooks_url":"https://api.github.com/repos/ENCODE-DCC/encoded/hooks","issue_events_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/events{/number}","events_url":"https://api.github.com/repos/ENCODE-DCC/encoded/events","assignees_url":"https://api.github.com/repos/ENCODE-DCC/encoded/assignees{/user}","branches_url":"https://api.github.com/repos/ENCODE-DCC/encoded/branches{/branch}","tags_url":"https://api.github.com/repos/ENCODE-DCC/encoded/tags","blobs_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/refs{/sha}","trees_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/trees{/sha}","statuses_url":"https://api.github.com/repos/ENCODE-DCC/encoded/statuses/{sha}","languages_url":"https://api.github.com/repos/ENCODE-DCC/encoded/languages","stargazers_url":"https://api.github.com/repos/ENCODE-DCC/encoded/stargazers","contributors_url":"https://api.github.com/repos/ENCODE-DCC/encoded/contributors","subscribers_url":"https://api.github.com/repos/ENCODE-DCC/encoded/subscribers","subscription_url":"https://api.github.com/repos/ENCODE-DCC/encoded/subscription","commits_url":"https://api.github.com/repos/ENCODE-DCC/encoded/commits{/sha}","git_commits_url":"https://api.github.com/repos/ENCODE-DCC/encoded/git/commits{/sha}","comments_url":"https://api.github.com/repos/ENCODE-DCC/encoded/comments{/number}","issue_comment_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/comments{/number}","contents_url":"https://api.github.com/repos/ENCODE-DCC/encoded/contents/{+path}","compare_url":"https://api.github.com/repos/ENCODE-DCC/encoded/compare/{base}...{head}","merges_url":"https://api.github.com/repos/ENCODE-DCC/encoded/merges","archive_url":"https://api.github.com/repos/ENCODE-DCC/encoded/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/ENCODE-DCC/encoded/downloads","issues_url":"https://api.github.com/repos/ENCODE-DCC/encoded/issues{/number}","pulls_url":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls{/number}","milestones_url":"https://api.github.com/repos/ENCODE-DCC/encoded/milestones{/number}","notifications_url":"https://api.github.com/repos/ENCODE-DCC/encoded/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/ENCODE-DCC/encoded/labels{/name}","releases_url":"https://api.github.com/repos/ENCODE-DCC/encoded/releases{/id}","created_at":"2012-12-07T00:52:21Z","updated_at":"2015-02-24T00:36:24Z","pushed_at":"2015-02-26T01:31:01Z","git_url":"git://github.com/ENCODE-DCC/encoded.git","ssh_url":"git@github.com:ENCODE-DCC/encoded.git","clone_url":"https://github.com/ENCODE-DCC/encoded.git","svn_url":"https://github.com/ENCODE-DCC/encoded","homepage":"https://www.encodeproject.org","size":92908,"stargazers_count":12,"watchers_count":12,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":6,"mirror_url":null,"open_issues_count":3,"forks":6,"open_issues":3,"watchers":12,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653"},"html":{"href":"https://github.com/ENCODE-DCC/encoded/pull/653"},"issue":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/653"},"comments":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/issues/653/comments"},"review_comments":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653/comments"},"review_comment":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/pulls/653/commits"},"statuses":{"href":"https://api.github.com/repos/ENCODE-DCC/encoded/statuses/c5ae2e3db1039995b5b8f84de11dda39177a52c7"}}}}