robinhood-to-csv icon indicating copy to clipboard operation
robinhood-to-csv copied to clipboard

profit_extractor.py runs into AttributeError for option trades

Open atiq-cs opened this issue 2 years ago • 2 comments

While the run without --profit works without problems, profit calculation is encountering DataFrame not having certain attribute!

$ python  csv-options-export.py --profit
Username:
Password:
MFA:

Generated device token: 
Pulling trades. Please wait...
0 queued trades and 688 executed trades found in your account.
Choose a filename or press enter to save to `option-trades.csv`:

What is your tax multiplier -default 0.25 (25%) ?
Traceback (most recent call last):
  File "D:\python\robinhood-to-csv\csv-options-export.py", line 164, in <module>
    profit_csv = profit_extractor(csv, filename)
  File "D:\python\robinhood-to-csv\profit_extractor.py", line 23, in profit_extractor
    handle['last_transaction_at'] = pd.to_datetime(handle.last_transaction_at)
  File "D:\python\robinhood-to-csv\env\lib\site-packages\pandas\core\generic.py", line 5575, in __getattr__
    return object.__getattribute__(self, name)
AttributeError: 'DataFrame' object has no attribute 'last_transaction_at'

Python Info

$ python -V
Python 3.10.4

atiq-cs avatar Apr 09 '22 23:04 atiq-cs

May I ask how you log in? It seems that the password doesn't work. And I tried the way in readme to get the token but also failed.

hhhanying avatar Apr 17 '22 00:04 hhhanying

@hhhanying are you trying to fix this bug? or just trying to log in?

atiq-cs avatar Apr 17 '22 00:04 atiq-cs