{"action":"created","comment":{"url":"https://api.github.com/repos/WattTime/pyiso/pulls/comments/36741295","id":36741295,"diff_hunk":"@@ -188,3 +190,68 @@ def parse_json_load_data(self, data):\n                 return data['FiveMinSystemLoads']['FiveMinSystemLoad']\n         except (KeyError, TypeError):\n             raise ValueError('Could not parse ISONE load data %s' % data)\n+\n+    def get_lmp(self, zone_name, latest=True, start_at=False, end_at=False, **kwargs):\n+\n+        # TODO, handle kwargs including latest, etc\n+        loc_dict = [a for a in self.locations if a['LocationName'] == '.Z.%s' % zone_name][0]\n+        locationid = loc_dict['LocationID']\n+        if latest:\n+            endpoint = '/fiveminutelmp/current/location/%s.json' % locationid\n+            price = self.fetch_data(endpoint, self.auth)['FiveMinLmp'][0]['LmpTotal']\n+            return price\n+        else:\n+            day = start_at.strftime('%Y%m%d')\n+            if not end_at:\n+                end_at = start_at + timedelta(days=1)\n+\n+            endpoint = '/fiveminutelmp/day/%s/location/%s.json' % (day, locationid)\n+            response = self.fetch_data(endpoint, self.auth)\n+\n+            lmp_dict = {}\n+            for item in response['FiveMinLmps']['FiveMinLmp']:\n+                # '%Y-%m-%dT%H:%M:%S.%f%z'\n+                current_time = parser.parse(item['BeginDate']).astimezone(pytz.utc)\n+                if start_at <= current_time <= end_at:\n+                    lmp_dict[current_time] = item['LmpTotal']\n+            return lmp_dict\n+\n+    locations = [","path":"pyiso/isone.py","position":47,"original_position":47,"commit_id":"9f93b0e9978a5fc496d4dbe615dcf76995cbce1e","original_commit_id":"9f93b0e9978a5fc496d4dbe615dcf76995cbce1e","user":{"login":"ndavis6","id":9117466,"avatar_url":"https://avatars.githubusercontent.com/u/9117466?v=3","gravatar_id":"","url":"https://api.github.com/users/ndavis6","html_url":"https://github.com/ndavis6","followers_url":"https://api.github.com/users/ndavis6/followers","following_url":"https://api.github.com/users/ndavis6/following{/other_user}","gists_url":"https://api.github.com/users/ndavis6/gists{/gist_id}","starred_url":"https://api.github.com/users/ndavis6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndavis6/subscriptions","organizations_url":"https://api.github.com/users/ndavis6/orgs","repos_url":"https://api.github.com/users/ndavis6/repos","events_url":"https://api.github.com/users/ndavis6/events{/privacy}","received_events_url":"https://api.github.com/users/ndavis6/received_events","type":"User","site_admin":false},"body":"This is pulled from the ISONE api, endpoint 'locations'.  Since it doesn't change very often, particularly for the zones (MAINE, NEWHAMPSHIRE, etc)  I thought it would be better to store locally rather than hit the API for it each time.","created_at":"2015-08-11T13:00:43Z","updated_at":"2015-08-11T13:00:43Z","html_url":"https://github.com/WattTime/pyiso/pull/31#discussion_r36741295","pull_request_url":"https://api.github.com/repos/WattTime/pyiso/pulls/31","_links":{"self":{"href":"https://api.github.com/repos/WattTime/pyiso/pulls/comments/36741295"},"html":{"href":"https://github.com/WattTime/pyiso/pull/31#discussion_r36741295"},"pull_request":{"href":"https://api.github.com/repos/WattTime/pyiso/pulls/31"}}},"pull_request":{"url":"https://api.github.com/repos/WattTime/pyiso/pulls/31","id":42125737,"html_url":"https://github.com/WattTime/pyiso/pull/31","diff_url":"https://github.com/WattTime/pyiso/pull/31.diff","patch_url":"https://github.com/WattTime/pyiso/pull/31.patch","issue_url":"https://api.github.com/repos/WattTime/pyiso/issues/31","number":31,"state":"open","locked":false,"title":"Add get_lmp function to ISONEClient, bump version","user":{"login":"ndavis6","id":9117466,"avatar_url":"https://avatars.githubusercontent.com/u/9117466?v=3","gravatar_id":"","url":"https://api.github.com/users/ndavis6","html_url":"https://github.com/ndavis6","followers_url":"https://api.github.com/users/ndavis6/followers","following_url":"https://api.github.com/users/ndavis6/following{/other_user}","gists_url":"https://api.github.com/users/ndavis6/gists{/gist_id}","starred_url":"https://api.github.com/users/ndavis6/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ndavis6/subscriptions","organizations_url":"https://api.github.com/users/ndavis6/orgs","repos_url":"https://api.github.com/users/ndavis6/repos","events_url":"https://api.github.com/users/ndavis6/events{/privacy}","received_events_url":"https://api.github.com/users/ndavis6/received_events","type":"User","site_admin":false},"body":"This is necessary for the ISONE integration on shift","created_at":"2015-08-11T12:59:40Z","updated_at":"2015-08-11T13:00:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"f52bc1ad5e2e64a284d339be4a70ce05d077e737","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/WattTime/pyiso/pulls/31/commits","review_comments_url":"https://api.github.com/repos/WattTime/pyiso/pulls/31/comments","review_comment_url":"https://api.github.com/repos/WattTime/pyiso/pulls/comments{/number}","comments_url":"https://api.github.com/repos/WattTime/pyiso/issues/31/comments","statuses_url":"https://api.github.com/repos/WattTime/pyiso/statuses/9f93b0e9978a5fc496d4dbe615dcf76995cbce1e","head":{"label":"WattTime:isone_lmp","ref":"isone_lmp","sha":"9f93b0e9978a5fc496d4dbe615dcf76995cbce1e","user":{"login":"WattTime","id":6070363,"avatar_url":"https://avatars.githubusercontent.com/u/6070363?v=3","gravatar_id":"","url":"https://api.github.com/users/WattTime","html_url":"https://github.com/WattTime","followers_url":"https://api.github.com/users/WattTime/followers","following_url":"https://api.github.com/users/WattTime/following{/other_user}","gists_url":"https://api.github.com/users/WattTime/gists{/gist_id}","starred_url":"https://api.github.com/users/WattTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WattTime/subscriptions","organizations_url":"https://api.github.com/users/WattTime/orgs","repos_url":"https://api.github.com/users/WattTime/repos","events_url":"https://api.github.com/users/WattTime/events{/privacy}","received_events_url":"https://api.github.com/users/WattTime/received_events","type":"Organization","site_admin":false},"repo":{"id":18228948,"name":"pyiso","full_name":"WattTime/pyiso","owner":{"login":"WattTime","id":6070363,"avatar_url":"https://avatars.githubusercontent.com/u/6070363?v=3","gravatar_id":"","url":"https://api.github.com/users/WattTime","html_url":"https://github.com/WattTime","followers_url":"https://api.github.com/users/WattTime/followers","following_url":"https://api.github.com/users/WattTime/following{/other_user}","gists_url":"https://api.github.com/users/WattTime/gists{/gist_id}","starred_url":"https://api.github.com/users/WattTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WattTime/subscriptions","organizations_url":"https://api.github.com/users/WattTime/orgs","repos_url":"https://api.github.com/users/WattTime/repos","events_url":"https://api.github.com/users/WattTime/events{/privacy}","received_events_url":"https://api.github.com/users/WattTime/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WattTime/pyiso","description":"Python client libraries for ISO and other power grid data sources.","fork":false,"url":"https://api.github.com/repos/WattTime/pyiso","forks_url":"https://api.github.com/repos/WattTime/pyiso/forks","keys_url":"https://api.github.com/repos/WattTime/pyiso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WattTime/pyiso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WattTime/pyiso/teams","hooks_url":"https://api.github.com/repos/WattTime/pyiso/hooks","issue_events_url":"https://api.github.com/repos/WattTime/pyiso/issues/events{/number}","events_url":"https://api.github.com/repos/WattTime/pyiso/events","assignees_url":"https://api.github.com/repos/WattTime/pyiso/assignees{/user}","branches_url":"https://api.github.com/repos/WattTime/pyiso/branches{/branch}","tags_url":"https://api.github.com/repos/WattTime/pyiso/tags","blobs_url":"https://api.github.com/repos/WattTime/pyiso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WattTime/pyiso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WattTime/pyiso/git/refs{/sha}","trees_url":"https://api.github.com/repos/WattTime/pyiso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WattTime/pyiso/statuses/{sha}","languages_url":"https://api.github.com/repos/WattTime/pyiso/languages","stargazers_url":"https://api.github.com/repos/WattTime/pyiso/stargazers","contributors_url":"https://api.github.com/repos/WattTime/pyiso/contributors","subscribers_url":"https://api.github.com/repos/WattTime/pyiso/subscribers","subscription_url":"https://api.github.com/repos/WattTime/pyiso/subscription","commits_url":"https://api.github.com/repos/WattTime/pyiso/commits{/sha}","git_commits_url":"https://api.github.com/repos/WattTime/pyiso/git/commits{/sha}","comments_url":"https://api.github.com/repos/WattTime/pyiso/comments{/number}","issue_comment_url":"https://api.github.com/repos/WattTime/pyiso/issues/comments{/number}","contents_url":"https://api.github.com/repos/WattTime/pyiso/contents/{+path}","compare_url":"https://api.github.com/repos/WattTime/pyiso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WattTime/pyiso/merges","archive_url":"https://api.github.com/repos/WattTime/pyiso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WattTime/pyiso/downloads","issues_url":"https://api.github.com/repos/WattTime/pyiso/issues{/number}","pulls_url":"https://api.github.com/repos/WattTime/pyiso/pulls{/number}","milestones_url":"https://api.github.com/repos/WattTime/pyiso/milestones{/number}","notifications_url":"https://api.github.com/repos/WattTime/pyiso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WattTime/pyiso/labels{/name}","releases_url":"https://api.github.com/repos/WattTime/pyiso/releases{/id}","created_at":"2014-03-28T22:54:11Z","updated_at":"2015-07-27T17:34:41Z","pushed_at":"2015-08-11T12:59:40Z","git_url":"git://github.com/WattTime/pyiso.git","ssh_url":"git@github.com:WattTime/pyiso.git","clone_url":"https://github.com/WattTime/pyiso.git","svn_url":"https://github.com/WattTime/pyiso","homepage":"","size":1058,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":8,"forks":15,"open_issues":8,"watchers":6,"default_branch":"master"}},"base":{"label":"WattTime:master","ref":"master","sha":"2435aa02e7c493bdef4cf44949d34fb3e2265e62","user":{"login":"WattTime","id":6070363,"avatar_url":"https://avatars.githubusercontent.com/u/6070363?v=3","gravatar_id":"","url":"https://api.github.com/users/WattTime","html_url":"https://github.com/WattTime","followers_url":"https://api.github.com/users/WattTime/followers","following_url":"https://api.github.com/users/WattTime/following{/other_user}","gists_url":"https://api.github.com/users/WattTime/gists{/gist_id}","starred_url":"https://api.github.com/users/WattTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WattTime/subscriptions","organizations_url":"https://api.github.com/users/WattTime/orgs","repos_url":"https://api.github.com/users/WattTime/repos","events_url":"https://api.github.com/users/WattTime/events{/privacy}","received_events_url":"https://api.github.com/users/WattTime/received_events","type":"Organization","site_admin":false},"repo":{"id":18228948,"name":"pyiso","full_name":"WattTime/pyiso","owner":{"login":"WattTime","id":6070363,"avatar_url":"https://avatars.githubusercontent.com/u/6070363?v=3","gravatar_id":"","url":"https://api.github.com/users/WattTime","html_url":"https://github.com/WattTime","followers_url":"https://api.github.com/users/WattTime/followers","following_url":"https://api.github.com/users/WattTime/following{/other_user}","gists_url":"https://api.github.com/users/WattTime/gists{/gist_id}","starred_url":"https://api.github.com/users/WattTime/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/WattTime/subscriptions","organizations_url":"https://api.github.com/users/WattTime/orgs","repos_url":"https://api.github.com/users/WattTime/repos","events_url":"https://api.github.com/users/WattTime/events{/privacy}","received_events_url":"https://api.github.com/users/WattTime/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/WattTime/pyiso","description":"Python client libraries for ISO and other power grid data sources.","fork":false,"url":"https://api.github.com/repos/WattTime/pyiso","forks_url":"https://api.github.com/repos/WattTime/pyiso/forks","keys_url":"https://api.github.com/repos/WattTime/pyiso/keys{/key_id}","collaborators_url":"https://api.github.com/repos/WattTime/pyiso/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/WattTime/pyiso/teams","hooks_url":"https://api.github.com/repos/WattTime/pyiso/hooks","issue_events_url":"https://api.github.com/repos/WattTime/pyiso/issues/events{/number}","events_url":"https://api.github.com/repos/WattTime/pyiso/events","assignees_url":"https://api.github.com/repos/WattTime/pyiso/assignees{/user}","branches_url":"https://api.github.com/repos/WattTime/pyiso/branches{/branch}","tags_url":"https://api.github.com/repos/WattTime/pyiso/tags","blobs_url":"https://api.github.com/repos/WattTime/pyiso/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/WattTime/pyiso/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/WattTime/pyiso/git/refs{/sha}","trees_url":"https://api.github.com/repos/WattTime/pyiso/git/trees{/sha}","statuses_url":"https://api.github.com/repos/WattTime/pyiso/statuses/{sha}","languages_url":"https://api.github.com/repos/WattTime/pyiso/languages","stargazers_url":"https://api.github.com/repos/WattTime/pyiso/stargazers","contributors_url":"https://api.github.com/repos/WattTime/pyiso/contributors","subscribers_url":"https://api.github.com/repos/WattTime/pyiso/subscribers","subscription_url":"https://api.github.com/repos/WattTime/pyiso/subscription","commits_url":"https://api.github.com/repos/WattTime/pyiso/commits{/sha}","git_commits_url":"https://api.github.com/repos/WattTime/pyiso/git/commits{/sha}","comments_url":"https://api.github.com/repos/WattTime/pyiso/comments{/number}","issue_comment_url":"https://api.github.com/repos/WattTime/pyiso/issues/comments{/number}","contents_url":"https://api.github.com/repos/WattTime/pyiso/contents/{+path}","compare_url":"https://api.github.com/repos/WattTime/pyiso/compare/{base}...{head}","merges_url":"https://api.github.com/repos/WattTime/pyiso/merges","archive_url":"https://api.github.com/repos/WattTime/pyiso/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/WattTime/pyiso/downloads","issues_url":"https://api.github.com/repos/WattTime/pyiso/issues{/number}","pulls_url":"https://api.github.com/repos/WattTime/pyiso/pulls{/number}","milestones_url":"https://api.github.com/repos/WattTime/pyiso/milestones{/number}","notifications_url":"https://api.github.com/repos/WattTime/pyiso/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/WattTime/pyiso/labels{/name}","releases_url":"https://api.github.com/repos/WattTime/pyiso/releases{/id}","created_at":"2014-03-28T22:54:11Z","updated_at":"2015-07-27T17:34:41Z","pushed_at":"2015-08-11T12:59:40Z","git_url":"git://github.com/WattTime/pyiso.git","ssh_url":"git@github.com:WattTime/pyiso.git","clone_url":"https://github.com/WattTime/pyiso.git","svn_url":"https://github.com/WattTime/pyiso","homepage":"","size":1058,"stargazers_count":6,"watchers_count":6,"language":"Python","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":15,"mirror_url":null,"open_issues_count":8,"forks":15,"open_issues":8,"watchers":6,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/WattTime/pyiso/pulls/31"},"html":{"href":"https://github.com/WattTime/pyiso/pull/31"},"issue":{"href":"https://api.github.com/repos/WattTime/pyiso/issues/31"},"comments":{"href":"https://api.github.com/repos/WattTime/pyiso/issues/31/comments"},"review_comments":{"href":"https://api.github.com/repos/WattTime/pyiso/pulls/31/comments"},"review_comment":{"href":"https://api.github.com/repos/WattTime/pyiso/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/WattTime/pyiso/pulls/31/commits"},"statuses":{"href":"https://api.github.com/repos/WattTime/pyiso/statuses/9f93b0e9978a5fc496d4dbe615dcf76995cbce1e"}}}}