{"action":"created","comment":{"url":"https://api.github.com/repos/numeracy/stdlib/pulls/comments/66895134","id":66895134,"diff_hunk":"@@ -0,0 +1,71 @@\n+#!/usr/bin/python\n+import json\n+import urllib2\n+import sys\n+import csv\n+import os\n+\n+\n+\n+def getData(data, dataDir):\n+\ttsvRow = []\n+\tjsonFile = json.loads(data)\n+\trows = jsonFile[1]\n+\theaders = ['Country', 'Year', 'Population']\n+\tpopulationValues = []\n+\n+\t# append headers if file does not exist\n+\tif(not os.path.exists(dataDir + 'worldtotalpopulation.tsv')):\n+\t\ttsvRow.append(headers)\n+\n+\ttry:\n+\t\tfor row in rows:\n+\t\t\tcountry = rows[0]['country']['value'].encode('utf-8')\n+\t\t\tyear = row['date'].encode('utf-8')\n+\t\t\tpopulation = row['value'].encode('utf-8')\n+\t\t\tpopulationValues = [country, year, population]\n+\t\t\ttsvRow.append(populationValues)\n+\texcept:\n+\t\tprint('No data found.')\n+\t\t\n+\treturn tsvRow\n+\n+\n+def writeToCsv(data, outFile, mode):\n+\twith open(outFile, mode) as csvFile:\n+\t\twriter = csv.writer(csvFile, delimiter='\\t')\n+\t\twriter.writerows(data)\n+\tcsvFile.close()\n+\n+\n+def getCountryCodes(codeDir):\n+\tcodes = []\n+\twith open(codeDir, 'rb') as f:\n+\t\treader = csv.reader(f, delimiter=' ')\n+\t\tfor row in reader:\n+\t\t\tcodes.append(row[0])\n+\treturn codes\n+\n+\n+\n+# ---------------------------------------------------------------------------------","path":"population/World Population/worldpopulation.py","position":51,"original_position":51,"commit_id":"332362ed9efbe84007bc943ef3c93fc07cee404e","original_commit_id":"332362ed9efbe84007bc943ef3c93fc07cee404e","user":{"login":"jacobfrench","id":7955079,"avatar_url":"https://avatars.githubusercontent.com/u/7955079?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobfrench","html_url":"https://github.com/jacobfrench","followers_url":"https://api.github.com/users/jacobfrench/followers","following_url":"https://api.github.com/users/jacobfrench/following{/other_user}","gists_url":"https://api.github.com/users/jacobfrench/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobfrench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobfrench/subscriptions","organizations_url":"https://api.github.com/users/jacobfrench/orgs","repos_url":"https://api.github.com/users/jacobfrench/repos","events_url":"https://api.github.com/users/jacobfrench/events{/privacy}","received_events_url":"https://api.github.com/users/jacobfrench/received_events","type":"User","site_admin":false},"body":"Ok, I'll change it and do them this way from here on out.","created_at":"2016-06-14T01:06:24Z","updated_at":"2016-06-14T01:06:24Z","html_url":"https://github.com/numeracy/stdlib/pull/1#discussion_r66895134","pull_request_url":"https://api.github.com/repos/numeracy/stdlib/pulls/1","_links":{"self":{"href":"https://api.github.com/repos/numeracy/stdlib/pulls/comments/66895134"},"html":{"href":"https://github.com/numeracy/stdlib/pull/1#discussion_r66895134"},"pull_request":{"href":"https://api.github.com/repos/numeracy/stdlib/pulls/1"}}},"pull_request":{"url":"https://api.github.com/repos/numeracy/stdlib/pulls/1","id":73642594,"html_url":"https://github.com/numeracy/stdlib/pull/1","diff_url":"https://github.com/numeracy/stdlib/pull/1.diff","patch_url":"https://github.com/numeracy/stdlib/pull/1.patch","issue_url":"https://api.github.com/repos/numeracy/stdlib/issues/1","number":1,"state":"closed","locked":false,"title":"added worldpopulation script","user":{"login":"jacobfrench","id":7955079,"avatar_url":"https://avatars.githubusercontent.com/u/7955079?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobfrench","html_url":"https://github.com/jacobfrench","followers_url":"https://api.github.com/users/jacobfrench/followers","following_url":"https://api.github.com/users/jacobfrench/following{/other_user}","gists_url":"https://api.github.com/users/jacobfrench/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobfrench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobfrench/subscriptions","organizations_url":"https://api.github.com/users/jacobfrench/orgs","repos_url":"https://api.github.com/users/jacobfrench/repos","events_url":"https://api.github.com/users/jacobfrench/events{/privacy}","received_events_url":"https://api.github.com/users/jacobfrench/received_events","type":"User","site_admin":false},"body":"Run worldpopulation.py without any parameters to get a full list of country populations or give it a country code to append only that country to worldpopulation.tsv.","created_at":"2016-06-13T21:01:46Z","updated_at":"2016-06-14T01:06:24Z","closed_at":"2016-06-13T21:02:25Z","merged_at":"2016-06-13T21:02:25Z","merge_commit_sha":"74d557e611add85ab4092c532f7f9b3276d15876","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/numeracy/stdlib/pulls/1/commits","review_comments_url":"https://api.github.com/repos/numeracy/stdlib/pulls/1/comments","review_comment_url":"https://api.github.com/repos/numeracy/stdlib/pulls/comments{/number}","comments_url":"https://api.github.com/repos/numeracy/stdlib/issues/1/comments","statuses_url":"https://api.github.com/repos/numeracy/stdlib/statuses/332362ed9efbe84007bc943ef3c93fc07cee404e","head":{"label":"jacobfrench:scripts","ref":"scripts","sha":"332362ed9efbe84007bc943ef3c93fc07cee404e","user":{"login":"jacobfrench","id":7955079,"avatar_url":"https://avatars.githubusercontent.com/u/7955079?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobfrench","html_url":"https://github.com/jacobfrench","followers_url":"https://api.github.com/users/jacobfrench/followers","following_url":"https://api.github.com/users/jacobfrench/following{/other_user}","gists_url":"https://api.github.com/users/jacobfrench/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobfrench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobfrench/subscriptions","organizations_url":"https://api.github.com/users/jacobfrench/orgs","repos_url":"https://api.github.com/users/jacobfrench/repos","events_url":"https://api.github.com/users/jacobfrench/events{/privacy}","received_events_url":"https://api.github.com/users/jacobfrench/received_events","type":"User","site_admin":false},"repo":{"id":61068650,"name":"stdlib","full_name":"jacobfrench/stdlib","owner":{"login":"jacobfrench","id":7955079,"avatar_url":"https://avatars.githubusercontent.com/u/7955079?v=3","gravatar_id":"","url":"https://api.github.com/users/jacobfrench","html_url":"https://github.com/jacobfrench","followers_url":"https://api.github.com/users/jacobfrench/followers","following_url":"https://api.github.com/users/jacobfrench/following{/other_user}","gists_url":"https://api.github.com/users/jacobfrench/gists{/gist_id}","starred_url":"https://api.github.com/users/jacobfrench/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jacobfrench/subscriptions","organizations_url":"https://api.github.com/users/jacobfrench/orgs","repos_url":"https://api.github.com/users/jacobfrench/repos","events_url":"https://api.github.com/users/jacobfrench/events{/privacy}","received_events_url":"https://api.github.com/users/jacobfrench/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/jacobfrench/stdlib","description":"Raw data and scripts for the Numeracy Standard Library","fork":true,"url":"https://api.github.com/repos/jacobfrench/stdlib","forks_url":"https://api.github.com/repos/jacobfrench/stdlib/forks","keys_url":"https://api.github.com/repos/jacobfrench/stdlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/jacobfrench/stdlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/jacobfrench/stdlib/teams","hooks_url":"https://api.github.com/repos/jacobfrench/stdlib/hooks","issue_events_url":"https://api.github.com/repos/jacobfrench/stdlib/issues/events{/number}","events_url":"https://api.github.com/repos/jacobfrench/stdlib/events","assignees_url":"https://api.github.com/repos/jacobfrench/stdlib/assignees{/user}","branches_url":"https://api.github.com/repos/jacobfrench/stdlib/branches{/branch}","tags_url":"https://api.github.com/repos/jacobfrench/stdlib/tags","blobs_url":"https://api.github.com/repos/jacobfrench/stdlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/jacobfrench/stdlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/jacobfrench/stdlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/jacobfrench/stdlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/jacobfrench/stdlib/statuses/{sha}","languages_url":"https://api.github.com/repos/jacobfrench/stdlib/languages","stargazers_url":"https://api.github.com/repos/jacobfrench/stdlib/stargazers","contributors_url":"https://api.github.com/repos/jacobfrench/stdlib/contributors","subscribers_url":"https://api.github.com/repos/jacobfrench/stdlib/subscribers","subscription_url":"https://api.github.com/repos/jacobfrench/stdlib/subscription","commits_url":"https://api.github.com/repos/jacobfrench/stdlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/jacobfrench/stdlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/jacobfrench/stdlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/jacobfrench/stdlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/jacobfrench/stdlib/contents/{+path}","compare_url":"https://api.github.com/repos/jacobfrench/stdlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/jacobfrench/stdlib/merges","archive_url":"https://api.github.com/repos/jacobfrench/stdlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/jacobfrench/stdlib/downloads","issues_url":"https://api.github.com/repos/jacobfrench/stdlib/issues{/number}","pulls_url":"https://api.github.com/repos/jacobfrench/stdlib/pulls{/number}","milestones_url":"https://api.github.com/repos/jacobfrench/stdlib/milestones{/number}","notifications_url":"https://api.github.com/repos/jacobfrench/stdlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/jacobfrench/stdlib/labels{/name}","releases_url":"https://api.github.com/repos/jacobfrench/stdlib/releases{/id}","deployments_url":"https://api.github.com/repos/jacobfrench/stdlib/deployments","created_at":"2016-06-13T20:48:54Z","updated_at":"2016-06-13T20:56:18Z","pushed_at":"2016-06-13T20:59:17Z","git_url":"git://github.com/jacobfrench/stdlib.git","ssh_url":"git@github.com:jacobfrench/stdlib.git","clone_url":"https://github.com/jacobfrench/stdlib.git","svn_url":"https://github.com/jacobfrench/stdlib","homepage":null,"size":98,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"numeracy:master","ref":"master","sha":"9d8f6c5fed8735998de1227517ba35ee8f1c9903","user":{"login":"numeracy","id":19848014,"avatar_url":"https://avatars.githubusercontent.com/u/19848014?v=3","gravatar_id":"","url":"https://api.github.com/users/numeracy","html_url":"https://github.com/numeracy","followers_url":"https://api.github.com/users/numeracy/followers","following_url":"https://api.github.com/users/numeracy/following{/other_user}","gists_url":"https://api.github.com/users/numeracy/gists{/gist_id}","starred_url":"https://api.github.com/users/numeracy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numeracy/subscriptions","organizations_url":"https://api.github.com/users/numeracy/orgs","repos_url":"https://api.github.com/users/numeracy/repos","events_url":"https://api.github.com/users/numeracy/events{/privacy}","received_events_url":"https://api.github.com/users/numeracy/received_events","type":"Organization","site_admin":false},"repo":{"id":61059111,"name":"stdlib","full_name":"numeracy/stdlib","owner":{"login":"numeracy","id":19848014,"avatar_url":"https://avatars.githubusercontent.com/u/19848014?v=3","gravatar_id":"","url":"https://api.github.com/users/numeracy","html_url":"https://github.com/numeracy","followers_url":"https://api.github.com/users/numeracy/followers","following_url":"https://api.github.com/users/numeracy/following{/other_user}","gists_url":"https://api.github.com/users/numeracy/gists{/gist_id}","starred_url":"https://api.github.com/users/numeracy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/numeracy/subscriptions","organizations_url":"https://api.github.com/users/numeracy/orgs","repos_url":"https://api.github.com/users/numeracy/repos","events_url":"https://api.github.com/users/numeracy/events{/privacy}","received_events_url":"https://api.github.com/users/numeracy/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/numeracy/stdlib","description":"Raw data and scripts for the Numeracy Standard Library","fork":false,"url":"https://api.github.com/repos/numeracy/stdlib","forks_url":"https://api.github.com/repos/numeracy/stdlib/forks","keys_url":"https://api.github.com/repos/numeracy/stdlib/keys{/key_id}","collaborators_url":"https://api.github.com/repos/numeracy/stdlib/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/numeracy/stdlib/teams","hooks_url":"https://api.github.com/repos/numeracy/stdlib/hooks","issue_events_url":"https://api.github.com/repos/numeracy/stdlib/issues/events{/number}","events_url":"https://api.github.com/repos/numeracy/stdlib/events","assignees_url":"https://api.github.com/repos/numeracy/stdlib/assignees{/user}","branches_url":"https://api.github.com/repos/numeracy/stdlib/branches{/branch}","tags_url":"https://api.github.com/repos/numeracy/stdlib/tags","blobs_url":"https://api.github.com/repos/numeracy/stdlib/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/numeracy/stdlib/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/numeracy/stdlib/git/refs{/sha}","trees_url":"https://api.github.com/repos/numeracy/stdlib/git/trees{/sha}","statuses_url":"https://api.github.com/repos/numeracy/stdlib/statuses/{sha}","languages_url":"https://api.github.com/repos/numeracy/stdlib/languages","stargazers_url":"https://api.github.com/repos/numeracy/stdlib/stargazers","contributors_url":"https://api.github.com/repos/numeracy/stdlib/contributors","subscribers_url":"https://api.github.com/repos/numeracy/stdlib/subscribers","subscription_url":"https://api.github.com/repos/numeracy/stdlib/subscription","commits_url":"https://api.github.com/repos/numeracy/stdlib/commits{/sha}","git_commits_url":"https://api.github.com/repos/numeracy/stdlib/git/commits{/sha}","comments_url":"https://api.github.com/repos/numeracy/stdlib/comments{/number}","issue_comment_url":"https://api.github.com/repos/numeracy/stdlib/issues/comments{/number}","contents_url":"https://api.github.com/repos/numeracy/stdlib/contents/{+path}","compare_url":"https://api.github.com/repos/numeracy/stdlib/compare/{base}...{head}","merges_url":"https://api.github.com/repos/numeracy/stdlib/merges","archive_url":"https://api.github.com/repos/numeracy/stdlib/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/numeracy/stdlib/downloads","issues_url":"https://api.github.com/repos/numeracy/stdlib/issues{/number}","pulls_url":"https://api.github.com/repos/numeracy/stdlib/pulls{/number}","milestones_url":"https://api.github.com/repos/numeracy/stdlib/milestones{/number}","notifications_url":"https://api.github.com/repos/numeracy/stdlib/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/numeracy/stdlib/labels{/name}","releases_url":"https://api.github.com/repos/numeracy/stdlib/releases{/id}","deployments_url":"https://api.github.com/repos/numeracy/stdlib/deployments","created_at":"2016-06-13T18:14:44Z","updated_at":"2016-06-13T21:02:27Z","pushed_at":"2016-06-13T21:02:25Z","git_url":"git://github.com/numeracy/stdlib.git","ssh_url":"git@github.com:numeracy/stdlib.git","clone_url":"https://github.com/numeracy/stdlib.git","svn_url":"https://github.com/numeracy/stdlib","homepage":null,"size":98,"stargazers_count":0,"watchers_count":0,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":1,"mirror_url":null,"open_issues_count":0,"forks":1,"open_issues":0,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/numeracy/stdlib/pulls/1"},"html":{"href":"https://github.com/numeracy/stdlib/pull/1"},"issue":{"href":"https://api.github.com/repos/numeracy/stdlib/issues/1"},"comments":{"href":"https://api.github.com/repos/numeracy/stdlib/issues/1/comments"},"review_comments":{"href":"https://api.github.com/repos/numeracy/stdlib/pulls/1/comments"},"review_comment":{"href":"https://api.github.com/repos/numeracy/stdlib/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/numeracy/stdlib/pulls/1/commits"},"statuses":{"href":"https://api.github.com/repos/numeracy/stdlib/statuses/332362ed9efbe84007bc943ef3c93fc07cee404e"}}}}
{"actor":{"display_login":"jacobfrench"}}