Title: KeyError: after_hours with Rest example in readme · Issue #69 · massive-com/client-python · GitHub
Open Graph Title: KeyError: after_hours with Rest example in readme · Issue #69 · massive-com/client-python
X Title: KeyError: after_hours with Rest example in readme · Issue #69 · massive-com/client-python
Description: from polygon import RESTClient def main(): key = "your api key" # RESTClient can be used as a context manager to facilitate closing the underlying http session # https://requests.readthedocs.io/en/master/user/advanced/#session-objects wi...
Open Graph Description: from polygon import RESTClient def main(): key = "your api key" # RESTClient can be used as a context manager to facilitate closing the underlying http session # https://requests.readthedocs.io/en/...
X Description: from polygon import RESTClient def main(): key = "your api key" # RESTClient can be used as a context manager to facilitate closing the underlying http session # https://requests.readthed...
Opengraph URL: https://github.com/massive-com/client-python/issues/69
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"KeyError: after_hours with Rest example in readme","articleBody":"from polygon import RESTClient\r\n\r\ndef main():\r\n key = \"your api key\"\r\n\r\n # RESTClient can be used as a context manager to facilitate closing the underlying http session\r\n # https://requests.readthedocs.io/en/master/user/advanced/#session-objects\r\n with RESTClient(key) as client:\r\n resp = client.stocks_equities_daily_open_close(\"AAPL\", \"2018-03-02\")\r\n print(f\"On: {resp.from_} Apple opened at {resp.open} and closed at {resp.close}\")\r\n\r\n\r\nif __name__ == '__main__':\r\n main()\r\n\r\n---------------------------------------------------------------------------\r\nKeyError Traceback (most recent call last)\r\n\u003cipython-input-13-c5e08e084552\u003e in \u003cmodule\u003e\r\n 13 \r\n 14 if __name__ == '__main__':\r\n---\u003e 15 main()\r\n\r\n\u003cipython-input-13-c5e08e084552\u003e in main()\r\n 8 # https://requests.readthedocs.io/en/master/user/advanced/#session-objects\r\n 9 with RESTClient(POLYGON_API_KEY) as client:\r\n---\u003e 10 resp = client.stocks_equities_daily_open_close(\"AAPL\", \"2018-03-02\")\r\n 11 print(f\"On: {resp.from_} Apple opened at {resp.open} and closed at {resp.close}\")\r\n 12 \r\n\r\n~/anaconda3/envs/test/lib/python3.8/site-packages/polygon/rest/client.py in stocks_equities_daily_open_close(self, symbol, date, **query_params)\r\n 126 **query_params) -\u003e models.StocksEquitiesDailyOpenCloseApiResponse:\r\n 127 endpoint = f\"{self.url}/v1/open-close/{symbol}/{date}\"\r\n--\u003e 128 return self._handle_response(\"StocksEquitiesDailyOpenCloseApiResponse\", endpoint, query_params)\r\n 129 \r\n 130 def stocks_equities_condition_mappings(self, ticktype,\r\n\r\n~/anaconda3/envs/test/lib/python3.8/site-packages/polygon/rest/client.py in _handle_response(self, response_type, endpoint, params)\r\n 31 resp: requests.Response = self._session.get(endpoint, params=params, timeout=self.timeout)\r\n 32 if resp.status_code == 200:\r\n---\u003e 33 return unmarshal.unmarshal_json(response_type, resp.json())\r\n 34 else:\r\n 35 resp.raise_for_status()\r\n\r\n~/anaconda3/envs/test/lib/python3.8/site-packages/polygon/rest/models/unmarshal.py in unmarshal_json(response_type, resp_json)\r\n 6 def unmarshal_json(response_type, resp_json) -\u003e Type[models.AnyDefinition]:\r\n 7 obj = models.name_to_class[response_type]()\r\n----\u003e 8 obj.unmarshal_json(resp_json)\r\n 9 return obj\r\n\r\n~/anaconda3/envs/test/lib/python3.8/site-packages/polygon/rest/models/definitions.py in unmarshal_json(self, input_json)\r\n 22 return self\r\n 23 elif isinstance(input_json, dict):\r\n---\u003e 24 self._unmarshal_json_object(input_json)\r\n 25 return self\r\n 26 elif isinstance(input_json, float) or isinstance(input_json, int):\r\n\r\n~/anaconda3/envs/test/lib/python3.8/site-packages/polygon/rest/models/definitions.py in _unmarshal_json_object(self, input_json)\r\n 40 if key in self._swagger_name_to_python:\r\n 41 attribute_name = self._swagger_name_to_python[key]\r\n---\u003e 42 if not self._attribute_is_primitive[attribute_name]:\r\n 43 if attribute_name in self._attributes_to_types:\r\n 44 attribute_type = self._attributes_to_types[attribute_name]\r\n\r\nKeyError: 'after_hours'","author":{"url":"https://github.com/satyan-g","@type":"Person","name":"satyan-g"},"datePublished":"2021-05-09T02:40:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/69/client-python/issues/69"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:1a70be05-c5a2-1462-4931-feab4b7c77fe |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 94A0:216A08:661613:891BA9:6A4DD0A0 |
| html-safe-nonce | 4ef858c9868d8bc1e3e8d33abcaf4d048877fa8a5274fdee0128d65c33ac6b94 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NEEwOjIxNkEwODo2NjE2MTM6ODkxQkE5OjZBNEREMEEwIiwidmlzaXRvcl9pZCI6IjE2OTIzODExNDEyMDg1MTg4MTYiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | ecba2e73d1c86bfee7f5db4cfe8c537cbda81b0b996a584fb60311659553adc9 |
| hovercard-subject-tag | issue:881648947 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/massive-com/client-python/69/issue_layout |
| twitter:image | https://opengraph.githubassets.com/09de674eebbf3409065de5fec6c7ca4c7ac13bd447e7c25ce3f8be8f9f42c99d/massive-com/client-python/issues/69 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/09de674eebbf3409065de5fec6c7ca4c7ac13bd447e7c25ce3f8be8f9f42c99d/massive-com/client-python/issues/69 |
| og:image:alt | from polygon import RESTClient def main(): key = "your api key" # RESTClient can be used as a context manager to facilitate closing the underlying http session # https://requests.readthedocs.io/en/... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | satyan-g |
| hostname | github.com |
| expected-hostname | github.com |
| None | 06b8a6144231bf3a234f1c2e9993861e07ce98a905912b114aa386c2d7e84b33 |
| turbo-cache-control | no-preview |
| go-import | github.com/massive-com/client-python git https://github.com/massive-com/client-python.git |
| octolytics-dimension-user_id | 191946194 |
| octolytics-dimension-user_login | massive-com |
| octolytics-dimension-repository_id | 216660192 |
| octolytics-dimension-repository_nwo | massive-com/client-python |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 216660192 |
| octolytics-dimension-repository_network_root_nwo | massive-com/client-python |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 1d344bdb7547fe6bca17a59bb2b8aac3dc9532a0 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width