robinhood-unofficial / pyrh

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

ValueError exception hit in urls.py 'build_chain' function #258

Closed clay-moss closed 4 years ago

clay-moss commented 4 years ago

https://github.com/robinhood-unofficial/pyrh/blob/ff1a0661f01f2b5fa4a30473781ddb72004b3d21/pyrh/urls.py#L175

The trailing slash '/' causes an exception to be encountered in the 'yarl' library.

print(rh.get_options('SPY', '2020-06-30', 'call'))

Traceback (most recent call last): File "C:/Users/Clayton/PycharmProjects/vix-pc-ratio-algo/algo.py", line 6, in print(rh.get_options('SPY', '2020-06-30', 'call')) File "C:\Users\Clayton\PycharmProjects\vix-pc-ratio-algo\venv\lib\site-packages\pyrh\robinhood.py", line 498, in get_options chain_id = self.get_url(urls.build_chain(instrument_id))["results"][0]["id"] File "C:\Users\Clayton\PycharmProjects\vix-pc-ratio-algo\venv\lib\site-packages\pyrh\urls.py", line 175, in build_chain OPTIONS_CHAIN_BASE.with_query(equity_instrument_ids=f"{instrument_id}") / "/" File "C:\Users\Clayton\PycharmProjects\vix-pc-ratio-algo\venv\lib\site-packages\yarl__init.py", line 293, in truediv__ raise ValueError( ValueError: Appending path '/' starting from slash is forbidden

clay-moss commented 4 years ago

PR for issue #259

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.