{"action":"created","comment":{"url":"https://api.github.com/repos/wireservice/csvkit/pulls/comments/55145793","id":55145793,"diff_hunk":"@@ -0,0 +1,42 @@\n+#!/usr/bin/env python\n+\n+\"\"\"\n+csvtranspose\n+\"\"\"\n+\n+import agate\n+\n+from csvkit.cli import CSVKitUtility\n+\n+\n+class CSVTranspose(CSVKitUtility):\n+    description = 'Transpose CSV data.'\n+\n+    def add_arguments(self):\n+        pass\n+\n+    def main(self):\n+        self.args.columns = None\n+        self.args.no_header_row = True\n+\n+        rows, column_names, column_ids = self.get_rows_and_column_names_and_column_ids(**self.reader_kwargs)\n+        rows = map(list, zip(*rows))\n+\n+        column_names = list(rows[0])","path":"csvkit/utilities/csvtranspose.py","position":25,"original_position":25,"commit_id":"7600f08d5e4325c89fbb790381c6ea5e75737e1c","original_commit_id":"7600f08d5e4325c89fbb790381c6ea5e75737e1c","user":{"login":"Fil","id":7001,"avatar_url":"https://avatars.githubusercontent.com/u/7001?v=3","gravatar_id":"","url":"https://api.github.com/users/Fil","html_url":"https://github.com/Fil","followers_url":"https://api.github.com/users/Fil/followers","following_url":"https://api.github.com/users/Fil/following{/other_user}","gists_url":"https://api.github.com/users/Fil/gists{/gist_id}","starred_url":"https://api.github.com/users/Fil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fil/subscriptions","organizations_url":"https://api.github.com/users/Fil/orgs","repos_url":"https://api.github.com/users/Fil/repos","events_url":"https://api.github.com/users/Fil/events{/privacy}","received_events_url":"https://api.github.com/users/Fil/received_events","type":"User","site_admin":false},"body":"no: the contents of the first column of the original csv become the names of the columns in the transposed csv","created_at":"2016-03-06T18:45:18Z","updated_at":"2016-03-06T18:45:18Z","html_url":"https://github.com/wireservice/csvkit/pull/583#discussion_r55145793","pull_request_url":"https://api.github.com/repos/wireservice/csvkit/pulls/583","_links":{"self":{"href":"https://api.github.com/repos/wireservice/csvkit/pulls/comments/55145793"},"html":{"href":"https://github.com/wireservice/csvkit/pull/583#discussion_r55145793"},"pull_request":{"href":"https://api.github.com/repos/wireservice/csvkit/pulls/583"}}},"pull_request":{"url":"https://api.github.com/repos/wireservice/csvkit/pulls/583","id":61849273,"html_url":"https://github.com/wireservice/csvkit/pull/583","diff_url":"https://github.com/wireservice/csvkit/pull/583.diff","patch_url":"https://github.com/wireservice/csvkit/pull/583.patch","issue_url":"https://api.github.com/repos/wireservice/csvkit/issues/583","number":583,"state":"open","locked":false,"title":"csvtranspose","user":{"login":"Fil","id":7001,"avatar_url":"https://avatars.githubusercontent.com/u/7001?v=3","gravatar_id":"","url":"https://api.github.com/users/Fil","html_url":"https://github.com/Fil","followers_url":"https://api.github.com/users/Fil/followers","following_url":"https://api.github.com/users/Fil/following{/other_user}","gists_url":"https://api.github.com/users/Fil/gists{/gist_id}","starred_url":"https://api.github.com/users/Fil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fil/subscriptions","organizations_url":"https://api.github.com/users/Fil/orgs","repos_url":"https://api.github.com/users/Fil/repos","events_url":"https://api.github.com/users/Fil/events{/privacy}","received_events_url":"https://api.github.com/users/Fil/received_events","type":"User","site_admin":false},"body":"csvtranspose with python (see also #221)\r\n\r\nnot battle-tested with enormous files, but it works on a 1.5MB file I had\r\nAlso I've checked that `csvtranspose|csvtranspose` is identity","created_at":"2016-03-06T17:49:39Z","updated_at":"2016-03-06T18:45:18Z","closed_at":null,"merged_at":null,"merge_commit_sha":"fe35e61a0f9c589fa83083d4d40d5c12159382a7","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/wireservice/csvkit/pulls/583/commits","review_comments_url":"https://api.github.com/repos/wireservice/csvkit/pulls/583/comments","review_comment_url":"https://api.github.com/repos/wireservice/csvkit/pulls/comments{/number}","comments_url":"https://api.github.com/repos/wireservice/csvkit/issues/583/comments","statuses_url":"https://api.github.com/repos/wireservice/csvkit/statuses/7600f08d5e4325c89fbb790381c6ea5e75737e1c","head":{"label":"Fil:csvtranspose","ref":"csvtranspose","sha":"7600f08d5e4325c89fbb790381c6ea5e75737e1c","user":{"login":"Fil","id":7001,"avatar_url":"https://avatars.githubusercontent.com/u/7001?v=3","gravatar_id":"","url":"https://api.github.com/users/Fil","html_url":"https://github.com/Fil","followers_url":"https://api.github.com/users/Fil/followers","following_url":"https://api.github.com/users/Fil/following{/other_user}","gists_url":"https://api.github.com/users/Fil/gists{/gist_id}","starred_url":"https://api.github.com/users/Fil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fil/subscriptions","organizations_url":"https://api.github.com/users/Fil/orgs","repos_url":"https://api.github.com/users/Fil/repos","events_url":"https://api.github.com/users/Fil/events{/privacy}","received_events_url":"https://api.github.com/users/Fil/received_events","type":"User","site_admin":false},"repo":{"id":53267664,"name":"csvkit","full_name":"Fil/csvkit","owner":{"login":"Fil","id":7001,"avatar_url":"https://avatars.githubusercontent.com/u/7001?v=3","gravatar_id":"","url":"https://api.github.com/users/Fil","html_url":"https://github.com/Fil","followers_url":"https://api.github.com/users/Fil/followers","following_url":"https://api.github.com/users/Fil/following{/other_user}","gists_url":"https://api.github.com/users/Fil/gists{/gist_id}","starred_url":"https://api.github.com/users/Fil/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Fil/subscriptions","organizations_url":"https://api.github.com/users/Fil/orgs","repos_url":"https://api.github.com/users/Fil/repos","events_url":"https://api.github.com/users/Fil/events{/privacy}","received_events_url":"https://api.github.com/users/Fil/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Fil/csvkit","description":"A suite of utilities for converting to and working with CSV, the king of tabular file formats.","fork":true,"url":"https://api.github.com/repos/Fil/csvkit","forks_url":"https://api.github.com/repos/Fil/csvkit/forks","keys_url":"https://api.github.com/repos/Fil/csvkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Fil/csvkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Fil/csvkit/teams","hooks_url":"https://api.github.com/repos/Fil/csvkit/hooks","issue_events_url":"https://api.github.com/repos/Fil/csvkit/issues/events{/number}","events_url":"https://api.github.com/repos/Fil/csvkit/events","assignees_url":"https://api.github.com/repos/Fil/csvkit/assignees{/user}","branches_url":"https://api.github.com/repos/Fil/csvkit/branches{/branch}","tags_url":"https://api.github.com/repos/Fil/csvkit/tags","blobs_url":"https://api.github.com/repos/Fil/csvkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Fil/csvkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Fil/csvkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/Fil/csvkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Fil/csvkit/statuses/{sha}","languages_url":"https://api.github.com/repos/Fil/csvkit/languages","stargazers_url":"https://api.github.com/repos/Fil/csvkit/stargazers","contributors_url":"https://api.github.com/repos/Fil/csvkit/contributors","subscribers_url":"https://api.github.com/repos/Fil/csvkit/subscribers","subscription_url":"https://api.github.com/repos/Fil/csvkit/subscription","commits_url":"https://api.github.com/repos/Fil/csvkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/Fil/csvkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/Fil/csvkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/Fil/csvkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/Fil/csvkit/contents/{+path}","compare_url":"https://api.github.com/repos/Fil/csvkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Fil/csvkit/merges","archive_url":"https://api.github.com/repos/Fil/csvkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Fil/csvkit/downloads","issues_url":"https://api.github.com/repos/Fil/csvkit/issues{/number}","pulls_url":"https://api.github.com/repos/Fil/csvkit/pulls{/number}","milestones_url":"https://api.github.com/repos/Fil/csvkit/milestones{/number}","notifications_url":"https://api.github.com/repos/Fil/csvkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Fil/csvkit/labels{/name}","releases_url":"https://api.github.com/repos/Fil/csvkit/releases{/id}","deployments_url":"https://api.github.com/repos/Fil/csvkit/deployments","created_at":"2016-03-06T17:41:21Z","updated_at":"2016-03-06T17:41:22Z","pushed_at":"2016-03-06T18:10:02Z","git_url":"git://github.com/Fil/csvkit.git","ssh_url":"git@github.com:Fil/csvkit.git","clone_url":"https://github.com/Fil/csvkit.git","svn_url":"https://github.com/Fil/csvkit","homepage":"http://csvkit.rtfd.org/","size":21324,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"wireservice:master","ref":"master","sha":"48f9602e1c6d0c35569365e7169ed435f6ef7e13","user":{"login":"wireservice","id":17111824,"avatar_url":"https://avatars.githubusercontent.com/u/17111824?v=3","gravatar_id":"","url":"https://api.github.com/users/wireservice","html_url":"https://github.com/wireservice","followers_url":"https://api.github.com/users/wireservice/followers","following_url":"https://api.github.com/users/wireservice/following{/other_user}","gists_url":"https://api.github.com/users/wireservice/gists{/gist_id}","starred_url":"https://api.github.com/users/wireservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireservice/subscriptions","organizations_url":"https://api.github.com/users/wireservice/orgs","repos_url":"https://api.github.com/users/wireservice/repos","events_url":"https://api.github.com/users/wireservice/events{/privacy}","received_events_url":"https://api.github.com/users/wireservice/received_events","type":"Organization","site_admin":false},"repo":{"id":1553944,"name":"csvkit","full_name":"wireservice/csvkit","owner":{"login":"wireservice","id":17111824,"avatar_url":"https://avatars.githubusercontent.com/u/17111824?v=3","gravatar_id":"","url":"https://api.github.com/users/wireservice","html_url":"https://github.com/wireservice","followers_url":"https://api.github.com/users/wireservice/followers","following_url":"https://api.github.com/users/wireservice/following{/other_user}","gists_url":"https://api.github.com/users/wireservice/gists{/gist_id}","starred_url":"https://api.github.com/users/wireservice/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wireservice/subscriptions","organizations_url":"https://api.github.com/users/wireservice/orgs","repos_url":"https://api.github.com/users/wireservice/repos","events_url":"https://api.github.com/users/wireservice/events{/privacy}","received_events_url":"https://api.github.com/users/wireservice/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/wireservice/csvkit","description":"A suite of utilities for converting to and working with CSV, the king of tabular file formats.","fork":false,"url":"https://api.github.com/repos/wireservice/csvkit","forks_url":"https://api.github.com/repos/wireservice/csvkit/forks","keys_url":"https://api.github.com/repos/wireservice/csvkit/keys{/key_id}","collaborators_url":"https://api.github.com/repos/wireservice/csvkit/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/wireservice/csvkit/teams","hooks_url":"https://api.github.com/repos/wireservice/csvkit/hooks","issue_events_url":"https://api.github.com/repos/wireservice/csvkit/issues/events{/number}","events_url":"https://api.github.com/repos/wireservice/csvkit/events","assignees_url":"https://api.github.com/repos/wireservice/csvkit/assignees{/user}","branches_url":"https://api.github.com/repos/wireservice/csvkit/branches{/branch}","tags_url":"https://api.github.com/repos/wireservice/csvkit/tags","blobs_url":"https://api.github.com/repos/wireservice/csvkit/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/wireservice/csvkit/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/wireservice/csvkit/git/refs{/sha}","trees_url":"https://api.github.com/repos/wireservice/csvkit/git/trees{/sha}","statuses_url":"https://api.github.com/repos/wireservice/csvkit/statuses/{sha}","languages_url":"https://api.github.com/repos/wireservice/csvkit/languages","stargazers_url":"https://api.github.com/repos/wireservice/csvkit/stargazers","contributors_url":"https://api.github.com/repos/wireservice/csvkit/contributors","subscribers_url":"https://api.github.com/repos/wireservice/csvkit/subscribers","subscription_url":"https://api.github.com/repos/wireservice/csvkit/subscription","commits_url":"https://api.github.com/repos/wireservice/csvkit/commits{/sha}","git_commits_url":"https://api.github.com/repos/wireservice/csvkit/git/commits{/sha}","comments_url":"https://api.github.com/repos/wireservice/csvkit/comments{/number}","issue_comment_url":"https://api.github.com/repos/wireservice/csvkit/issues/comments{/number}","contents_url":"https://api.github.com/repos/wireservice/csvkit/contents/{+path}","compare_url":"https://api.github.com/repos/wireservice/csvkit/compare/{base}...{head}","merges_url":"https://api.github.com/repos/wireservice/csvkit/merges","archive_url":"https://api.github.com/repos/wireservice/csvkit/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/wireservice/csvkit/downloads","issues_url":"https://api.github.com/repos/wireservice/csvkit/issues{/number}","pulls_url":"https://api.github.com/repos/wireservice/csvkit/pulls{/number}","milestones_url":"https://api.github.com/repos/wireservice/csvkit/milestones{/number}","notifications_url":"https://api.github.com/repos/wireservice/csvkit/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/wireservice/csvkit/labels{/name}","releases_url":"https://api.github.com/repos/wireservice/csvkit/releases{/id}","deployments_url":"https://api.github.com/repos/wireservice/csvkit/deployments","created_at":"2011-04-01T03:00:30Z","updated_at":"2016-03-06T04:20:29Z","pushed_at":"2016-03-06T18:10:03Z","git_url":"git://github.com/wireservice/csvkit.git","ssh_url":"git@github.com:wireservice/csvkit.git","clone_url":"https://github.com/wireservice/csvkit.git","svn_url":"https://github.com/wireservice/csvkit","homepage":"http://csvkit.rtfd.org/","size":22015,"stargazers_count":1950,"watchers_count":1950,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":304,"mirror_url":null,"open_issues_count":68,"forks":304,"open_issues":68,"watchers":1950,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/wireservice/csvkit/pulls/583"},"html":{"href":"https://github.com/wireservice/csvkit/pull/583"},"issue":{"href":"https://api.github.com/repos/wireservice/csvkit/issues/583"},"comments":{"href":"https://api.github.com/repos/wireservice/csvkit/issues/583/comments"},"review_comments":{"href":"https://api.github.com/repos/wireservice/csvkit/pulls/583/comments"},"review_comment":{"href":"https://api.github.com/repos/wireservice/csvkit/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/wireservice/csvkit/pulls/583/commits"},"statuses":{"href":"https://api.github.com/repos/wireservice/csvkit/statuses/7600f08d5e4325c89fbb790381c6ea5e75737e1c"}}}}