robinhood-unofficial / pyrh

Python Framework to make trades with the unofficial Robinhood API
https://pyrh.readthedocs.io/en/latest/
MIT License
1.78k stars 603 forks source link

module 'pyrh.endpoints' has no attribute 'option_market_data' #257

Closed jgansl closed 4 years ago

jgansl commented 4 years ago
~/Documents/inverse/env/lib/python3.7/site-packages/pyrh/robinhood.py in get_option_market_data(self, optionid)
    860         market_data = {}
    861         try:
--> 862             market_data = self.get_url(endpoints.option_market_data(optionid)) or {}
    863         except requests.exceptions.HTTPError:
    864             raise RH_exception.InvalidOptionId()

AttributeError: module 'pyrh.endpoints' has no attribute 'option_market_data'

Changing it to 'market_data' gives me:

~/Documents/inverse/env/lib/python3.7/site-packages/pyrh/robinhood.py in wrapper(self, *args, **kwargs)
     79             if "Authorization" not in self.headers:
     80                 self.auth_method()
---> 81             return function(self, *args, **kwargs)  # pylint: disable=E1102
     82 
     83         return wrapper

~/Documents/inverse/env/lib/python3.7/site-packages/pyrh/robinhood.py in get_option_market_data(self, optionid)
    862         market_data = {}
    863         try:
--> 864             market_data = self.get_url(endpoints.market_data(optionid)) or {}
    865         except requests.exceptions.HTTPError:
    866             raise RH_exception.InvalidOptionId()

~/Documents/inverse/env/lib/python3.7/site-packages/pyrh/robinhood.py in get_url(self, url)
    790         """
    791 
--> 792         return self.session.get(url, timeout=15).json()
    793 
    794     def get_popularity(self, stock=""):

~/Documents/inverse/env/lib/python3.7/site-packages/requests/models.py in json(self, **kwargs)
    896                     # used.
    897                     pass
--> 898         return complexjson.loads(self.text, **kwargs)
    899 
    900     @property

/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/__init__.py in loads(s, encoding, cls, object_hook, parse_float, parse_int, parse_constant, object_pairs_hook, **kw)
    346             parse_int is None and parse_float is None and
    347             parse_constant is None and object_pairs_hook is None and not kw):
--> 348         return _default_decoder.decode(s)
    349     if cls is None:
    350         cls = JSONDecoder

/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py in decode(self, s, _w)
    335 
    336         """
--> 337         obj, end = self.raw_decode(s, idx=_w(s, 0).end())
    338         end = _w(s, end).end()
    339         if end != len(s):

/usr/local/opt/python/Frameworks/Python.framework/Versions/3.7/lib/python3.7/json/decoder.py in raw_decode(self, s, idx)
    353             obj, end = self.scan_once(s, idx)
    354         except StopIteration as err:
--> 355             raise JSONDecodeError("Expecting value", s, err.value) from None
    356         return obj, end

JSONDecodeError: Expecting value: line 1 column 1 (char 0)
stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

stale[bot] commented 4 years ago

Closing this issue automatically because it has not had any activity since it has been marked as stale. If you think it is still relevant and should be addressed, feel free to open a new one.