joshfraser / robinhood-to-csv

Python script to export Robinhood trades to a CSV file
MIT License
259 stars 109 forks source link

profit_extractor.py runs into AttributeError for option trades #72

Open atiq-cs opened 2 years ago

atiq-cs commented 2 years ago

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
hhhanying commented 2 years ago

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.

atiq-cs commented 2 years ago

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