{"action":"created","comment":{"url":"https://api.github.com/repos/socrata/connectors/pulls/comments/59747374","id":59747374,"diff_hunk":"@@ -0,0 +1,64 @@\n+import fme\n+import fmeobjects\n+import json\n+import urllib2\n+from urllib2 import URLError\n+\n+# Construct URL for API call to Census\n+# example (commute time): http://api.census.gov/data/2013/acs1?get=NAME,B08303_001E,B08303_002E,B08303_003E,B08303_004E,B08303_005E,B08303_006E,B08303_007E,B08303_008E,B08303_009E,B08303_010E,B08303_011E,B08303_012E,B08303_013E&for=place:63000&in=state:53\n+\n+class PythonCensusApiCityReader(object):\n+    def __init__(self):\n+        \n+        self.apikey = fme.macroValues['API_KEY']\n+        self.acsyear = fme.macroValues['ACS_YEAR']\n+        self.indicators = fme.macroValues['INDICATORS']\n+        self.url = fme.macroValues['URL']\n+        self.years = fme.macroValues['YEARS']\n+        self.cities = [fme.macroValues['CITY1'],fme.macroValues['CITY2'],fme.macroValues['CITY3'],fme.macroValues['CITY4'],fme.macroValues['CITY5'],fme.macroValues['CITY6'],fme.macroValues['CITY7'],fme.macroValues['CITY8']]\n+\n+        self.log = fmeobjects.FMELogFile()\n+\n+    def close(self):\n+\t\t# loop through years\n+\t\tlstYears = self.years.split(\",\")","path":"Census API to Socrata/PythonCensusApiCityReader.py","position":24,"original_position":24,"commit_id":"5ab3fcb602cc794ef16bf292b51671ba7ffc8f24","original_commit_id":"5ab3fcb602cc794ef16bf292b51671ba7ffc8f24","user":{"login":"angli-socrata","id":8376267,"avatar_url":"https://avatars.githubusercontent.com/u/8376267?v=3","gravatar_id":"","url":"https://api.github.com/users/angli-socrata","html_url":"https://github.com/angli-socrata","followers_url":"https://api.github.com/users/angli-socrata/followers","following_url":"https://api.github.com/users/angli-socrata/following{/other_user}","gists_url":"https://api.github.com/users/angli-socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/angli-socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angli-socrata/subscriptions","organizations_url":"https://api.github.com/users/angli-socrata/orgs","repos_url":"https://api.github.com/users/angli-socrata/repos","events_url":"https://api.github.com/users/angli-socrata/events{/privacy}","received_events_url":"https://api.github.com/users/angli-socrata/received_events","type":"User","site_admin":false},"body":"Nit-picking: For variable naming, we should be using lowercase with words separated by underscores as described in PEP 8 (related: http://stackoverflow.com/questions/159720/what-is-the-naming-convention-in-python-for-variable-and-function-names). ","created_at":"2016-04-14T16:23:55Z","updated_at":"2016-04-14T16:23:55Z","html_url":"https://github.com/socrata/connectors/pull/31#discussion_r59747374","pull_request_url":"https://api.github.com/repos/socrata/connectors/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/socrata/connectors/pulls/comments/59747374"},"html":{"href":"https://github.com/socrata/connectors/pull/31#discussion_r59747374"},"pull_request":{"href":"https://api.github.com/repos/socrata/connectors/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/socrata/connectors/pulls/31","id":65856109,"html_url":"https://github.com/socrata/connectors/pull/31","diff_url":"https://github.com/socrata/connectors/pull/31.diff","patch_url":"https://github.com/socrata/connectors/pull/31.patch","issue_url":"https://api.github.com/repos/socrata/connectors/issues/31","number":31,"state":"open","locked":false,"title":"Example on how to use Census API and write to Socrata for FME 2016 Wo…","user":{"login":"aliciatb","id":3361040,"avatar_url":"https://avatars.githubusercontent.com/u/3361040?v=3","gravatar_id":"","url":"https://api.github.com/users/aliciatb","html_url":"https://github.com/aliciatb","followers_url":"https://api.github.com/users/aliciatb/followers","following_url":"https://api.github.com/users/aliciatb/following{/other_user}","gists_url":"https://api.github.com/users/aliciatb/gists{/gist_id}","starred_url":"https://api.github.com/users/aliciatb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aliciatb/subscriptions","organizations_url":"https://api.github.com/users/aliciatb/orgs","repos_url":"https://api.github.com/users/aliciatb/repos","events_url":"https://api.github.com/users/aliciatb/events{/privacy}","received_events_url":"https://api.github.com/users/aliciatb/received_events","type":"User","site_admin":false},"body":"This workflow illustrates how to retrieve Census Average Commute Indicator data from the API for multiple cities using python caller and writes to Socrata in support of FME 2016 World Tour presentation","created_at":"2016-04-08T22:29:34Z","updated_at":"2016-04-14T16:23:55Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f3535a51e695f7f298e9eb12dd6ffb29344ad10e","assignee":{"login":"angli-socrata","id":8376267,"avatar_url":"https://avatars.githubusercontent.com/u/8376267?v=3","gravatar_id":"","url":"https://api.github.com/users/angli-socrata","html_url":"https://github.com/angli-socrata","followers_url":"https://api.github.com/users/angli-socrata/followers","following_url":"https://api.github.com/users/angli-socrata/following{/other_user}","gists_url":"https://api.github.com/users/angli-socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/angli-socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angli-socrata/subscriptions","organizations_url":"https://api.github.com/users/angli-socrata/orgs","repos_url":"https://api.github.com/users/angli-socrata/repos","events_url":"https://api.github.com/users/angli-socrata/events{/privacy}","received_events_url":"https://api.github.com/users/angli-socrata/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/socrata/connectors/pulls/31/commits","review_comments_url":"https://api.github.com/repos/socrata/connectors/pulls/31/comments","review_comment_url":"https://api.github.com/repos/socrata/connectors/pulls/comments{/number}","comments_url":"https://api.github.com/repos/socrata/connectors/issues/31/comments","statuses_url":"https://api.github.com/repos/socrata/connectors/statuses/5ab3fcb602cc794ef16bf292b51671ba7ffc8f24","head":{"label":"socrata:census_api_socrata_template","ref":"census_api_socrata_template","sha":"5ab3fcb602cc794ef16bf292b51671ba7ffc8f24","user":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"repo":{"id":20735565,"name":"connectors","full_name":"socrata/connectors","owner":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/socrata/connectors","description":"ETL Tools and Templates","fork":false,"url":"https://api.github.com/repos/socrata/connectors","forks_url":"https://api.github.com/repos/socrata/connectors/forks","keys_url":"https://api.github.com/repos/socrata/connectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/socrata/connectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/socrata/connectors/teams","hooks_url":"https://api.github.com/repos/socrata/connectors/hooks","issue_events_url":"https://api.github.com/repos/socrata/connectors/issues/events{/number}","events_url":"https://api.github.com/repos/socrata/connectors/events","assignees_url":"https://api.github.com/repos/socrata/connectors/assignees{/user}","branches_url":"https://api.github.com/repos/socrata/connectors/branches{/branch}","tags_url":"https://api.github.com/repos/socrata/connectors/tags","blobs_url":"https://api.github.com/repos/socrata/connectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/socrata/connectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/socrata/connectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/socrata/connectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/socrata/connectors/statuses/{sha}","languages_url":"https://api.github.com/repos/socrata/connectors/languages","stargazers_url":"https://api.github.com/repos/socrata/connectors/stargazers","contributors_url":"https://api.github.com/repos/socrata/connectors/contributors","subscribers_url":"https://api.github.com/repos/socrata/connectors/subscribers","subscription_url":"https://api.github.com/repos/socrata/connectors/subscription","commits_url":"https://api.github.com/repos/socrata/connectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/socrata/connectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/socrata/connectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/socrata/connectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/socrata/connectors/contents/{+path}","compare_url":"https://api.github.com/repos/socrata/connectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/socrata/connectors/merges","archive_url":"https://api.github.com/repos/socrata/connectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/socrata/connectors/downloads","issues_url":"https://api.github.com/repos/socrata/connectors/issues{/number}","pulls_url":"https://api.github.com/repos/socrata/connectors/pulls{/number}","milestones_url":"https://api.github.com/repos/socrata/connectors/milestones{/number}","notifications_url":"https://api.github.com/repos/socrata/connectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/socrata/connectors/labels{/name}","releases_url":"https://api.github.com/repos/socrata/connectors/releases{/id}","deployments_url":"https://api.github.com/repos/socrata/connectors/deployments","created_at":"2014-06-11T18:10:45Z","updated_at":"2016-02-09T23:07:08Z","pushed_at":"2016-04-09T17:36:46Z","git_url":"git://github.com/socrata/connectors.git","ssh_url":"git@github.com:socrata/connectors.git","clone_url":"https://github.com/socrata/connectors.git","svn_url":"https://github.com/socrata/connectors","homepage":"http://socrata.github.io/connectors/","size":11950,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":7,"forks":5,"open_issues":7,"watchers":3,"default_branch":"master"}},"base":{"label":"socrata:master","ref":"master","sha":"21cd534ba93558a7606edf5704d890803c52c846","user":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"repo":{"id":20735565,"name":"connectors","full_name":"socrata/connectors","owner":{"login":"socrata","id":57695,"avatar_url":"https://avatars.githubusercontent.com/u/57695?v=3","gravatar_id":"","url":"https://api.github.com/users/socrata","html_url":"https://github.com/socrata","followers_url":"https://api.github.com/users/socrata/followers","following_url":"https://api.github.com/users/socrata/following{/other_user}","gists_url":"https://api.github.com/users/socrata/gists{/gist_id}","starred_url":"https://api.github.com/users/socrata/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/socrata/subscriptions","organizations_url":"https://api.github.com/users/socrata/orgs","repos_url":"https://api.github.com/users/socrata/repos","events_url":"https://api.github.com/users/socrata/events{/privacy}","received_events_url":"https://api.github.com/users/socrata/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/socrata/connectors","description":"ETL Tools and Templates","fork":false,"url":"https://api.github.com/repos/socrata/connectors","forks_url":"https://api.github.com/repos/socrata/connectors/forks","keys_url":"https://api.github.com/repos/socrata/connectors/keys{/key_id}","collaborators_url":"https://api.github.com/repos/socrata/connectors/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/socrata/connectors/teams","hooks_url":"https://api.github.com/repos/socrata/connectors/hooks","issue_events_url":"https://api.github.com/repos/socrata/connectors/issues/events{/number}","events_url":"https://api.github.com/repos/socrata/connectors/events","assignees_url":"https://api.github.com/repos/socrata/connectors/assignees{/user}","branches_url":"https://api.github.com/repos/socrata/connectors/branches{/branch}","tags_url":"https://api.github.com/repos/socrata/connectors/tags","blobs_url":"https://api.github.com/repos/socrata/connectors/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/socrata/connectors/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/socrata/connectors/git/refs{/sha}","trees_url":"https://api.github.com/repos/socrata/connectors/git/trees{/sha}","statuses_url":"https://api.github.com/repos/socrata/connectors/statuses/{sha}","languages_url":"https://api.github.com/repos/socrata/connectors/languages","stargazers_url":"https://api.github.com/repos/socrata/connectors/stargazers","contributors_url":"https://api.github.com/repos/socrata/connectors/contributors","subscribers_url":"https://api.github.com/repos/socrata/connectors/subscribers","subscription_url":"https://api.github.com/repos/socrata/connectors/subscription","commits_url":"https://api.github.com/repos/socrata/connectors/commits{/sha}","git_commits_url":"https://api.github.com/repos/socrata/connectors/git/commits{/sha}","comments_url":"https://api.github.com/repos/socrata/connectors/comments{/number}","issue_comment_url":"https://api.github.com/repos/socrata/connectors/issues/comments{/number}","contents_url":"https://api.github.com/repos/socrata/connectors/contents/{+path}","compare_url":"https://api.github.com/repos/socrata/connectors/compare/{base}...{head}","merges_url":"https://api.github.com/repos/socrata/connectors/merges","archive_url":"https://api.github.com/repos/socrata/connectors/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/socrata/connectors/downloads","issues_url":"https://api.github.com/repos/socrata/connectors/issues{/number}","pulls_url":"https://api.github.com/repos/socrata/connectors/pulls{/number}","milestones_url":"https://api.github.com/repos/socrata/connectors/milestones{/number}","notifications_url":"https://api.github.com/repos/socrata/connectors/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/socrata/connectors/labels{/name}","releases_url":"https://api.github.com/repos/socrata/connectors/releases{/id}","deployments_url":"https://api.github.com/repos/socrata/connectors/deployments","created_at":"2014-06-11T18:10:45Z","updated_at":"2016-02-09T23:07:08Z","pushed_at":"2016-04-09T17:36:46Z","git_url":"git://github.com/socrata/connectors.git","ssh_url":"git@github.com:socrata/connectors.git","clone_url":"https://github.com/socrata/connectors.git","svn_url":"https://github.com/socrata/connectors","homepage":"http://socrata.github.io/connectors/","size":11950,"stargazers_count":3,"watchers_count":3,"language":null,"has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":5,"mirror_url":null,"open_issues_count":7,"forks":5,"open_issues":7,"watchers":3,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/socrata/connectors/pulls/31"},"html":{"href":"https://github.com/socrata/connectors/pull/31"},"issue":{"href":"https://api.github.com/repos/socrata/connectors/issues/31"},"comments":{"href":"https://api.github.com/repos/socrata/connectors/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/socrata/connectors/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/socrata/connectors/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/socrata/connectors/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/socrata/connectors/statuses/5ab3fcb602cc794ef16bf292b51671ba7ffc8f24"}}}}