Jason: heavy duty.
max_hist_file = max(files, key=os.path.get.ctime)
ValueError: max() arg is an empty sequence
I had this error as well. I usually change the name to Fidelity_dateperiod.csv when downloading so I'm able to easy understand the data period of that particular history file.
There is an undocumented feature to override the default CSV file locations. I think there is strong advantage for people to use the defaults, and you could consider making a specially named copy for your other purpose. But you don't have to. I am working on documenting that feature. Currently the working filename is advanced_f20.txt but I will probably choose a different name. Advanced is an inviting term. Maybe I will change that to unwise_features.txt. But anyway, here is a preview. If you add this line to your F2O_cfg.py file, it will look for files that match the pattern.
OVERRIDE_HISTORY_FILES=r'%USERPROFILE%\Documents\MySpecialPlace\Fidelity_*.csv'
Similarly, there is are OVERRIDE_HISTORY_FILES and OVERRIDE_WRITE_FOLDER too.
Since we are running on Windows, filenames are never case-sensitive.
Incidentally, if you replaced the backslashes with forward slashes, it would work and the r would not be needed.
It'd be helpful to print an error message with recommended resolution (ie, CSV Files not found in Downloads folder. Please add Account_History and Positions CSV files to the Downloads folder) rather than just the ValueError which isn't helpful to most.
I can work on an error detection for that file-not-found condition. Then print the better message. The ValueError was from Python itself.
Good point. Good find. Thanks. It now starts
def DBGather_logit(msg):
global DBGather_log_ctr
Separately, it seems that DBGather is reliant on "TICKER" to be included so some of my securities aren't picked up. I have some Mutual Funds that are unique in that they don't have ticker symbols. The only place I can get the current price is through Fidelity.com (or picked up by Money when imported through Fidelity OFX)
I compared. It seems that they have <FIID>4004 in the ticker spot. I just looked into <FIID> indeed the OFX spec, and indeed there it is. So what appears in the column C of the Portfolio_Positions_Mar-09-2024.csv (for example) file for that holding? 4004??? Note you can look at an F2O CSV file with a spreadsheet program, but don't write it back.
Regarding the longer cut off strings, I am not so sure this will cause a problem. I will try to think this over at a time where I might be more inspired.
OVERRIDE_WRITE_FOLDER
will tell the generated FID*.OFX files where to go. For many of us, that will be the PocketSense import folder. You can also feed OFX files to Money more directly, if you like.IGNORE_BEFORE_YYYYMMDD