jseutter / ofxparse

Ofx file format parser for Python
http://sites.google.com/site/ofxparse/
MIT License
204 stars 121 forks source link

transaction.security and position.security should be Security() object instead of str #158

Open hezhao opened 4 years ago

hezhao commented 4 years ago

transaction.security and position.security currently are only assigned as str of CUSIP number, instead it should be a Security() object, so that more useful ticker symbol can also be obtained. I see that ofx.security_list already parses a list of Security() objects, it should not be difficult to create a lookup map with CUSIP as key and Security() object as value.

https://github.com/jseutter/ofxparse/blob/3236cfd96434feb6bc79a8b66f3400f18e2ad3c4/ofxparse/ofxparse.py#L644

https://github.com/jseutter/ofxparse/blob/3236cfd96434feb6bc79a8b66f3400f18e2ad3c4/ofxparse/ofxparse.py#L601

bzbarsky commented 4 years ago

In particular, the docs at https://github.com/jseutter/ofxparse/blob/master/README.rst already claim that this is a Security object.