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

rh.get_historical_quotes(self, stock, interval, span, bounds=Bounds.REGULAR) usage documentation #288

Closed FergusClare closed 3 years ago

FergusClare commented 3 years ago

Documentation Request

In pyrh/pyrh/robinhood.py on lines 167 through 177, the valid interval/spans are present but without any examples for how to run. Can we get examples for each of the interval formats added to the DocString so that when we call help(rh.get_historical_quotes), the samples are available? I have tried:

>>> spy = rh.get_historical_quotes('SPY',interval='week', span='one')
>>> spy
{'span': ['"one" is not a valid choice.']}

...as well as having tried:

>>> spy = rh.get_historical_quotes('SPY',interval='week', span=7)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pyrh/robinhood.py", line 499, in get_historical_quotes
    endpoints.historicals()
TypeError: can only concatenate str (not "int") to str

Any help here is appreciated.

stale[bot] commented 3 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 3 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.