[moneydance] python modules urllib
Jim Karcz
jkarcz at gmail.com
Wed Sep 5 21:08:15 EDT 2007
That brings back some memories.
The following if a bit of a hack, but it worked.
I think I did a cut and paste to a text file from my site where I
displayed the entire price history. I then parsed the results with a
perl script which put it into the format that the python script below
needs. I populated the list of setPriceForSecurity function calls, one
for each date.
I'm not sure where I got the script from though. I did this back in aug
of 2006 so it might still work. I am also not sure why everything is
written as 1/price.
##set_prices.py
root = moneydance.getRootAccount()
currencies = root.getCurrencyTable()
def setPriceForSecurity(symbol, price, dateint):
security = currencies.getCurrencyByTickerSymbol(symbol)
if not security:
print "No security with symbol/name: %s"%(symbol)
return
if dateint:
security.setUserRate(price)
security.setSnapshotInt(dateint, price)
print "Successfully set price for %s"%(security)
setPriceForSecurity('HW-GEF', 1/71.116258, 20050218)
setPriceForSecurity('HW-GEF', 1/77.355404, 20060817)
Brock Palen wrote:
> Is there a way to get all the python modules in money dance?
> I was making a script that grabs TIAA-CREF daily values form their
> website, but when i try to run it under moneydance i get
>
> importError: no module named urllib
>
> etc, so i cant scrape their website, I am new to python (perl is my
> comfort zone) so if I am missing something forgive my ignorance.
> How do others get daily values of TIAA-CREF variable annuities?
>
>
>
> Brock Palen
> brockp at mlds-networks.com
> www.mlds-networks.com
> MLDS Owner Senior Tech.
>
>
> _______________________________________________
> moneydance-info mailing list
> moneydance-info at moneydance.com
> http://moneydance.com/mailman/listinfo/moneydance-info
>
More information about the moneydance-info
mailing list