There are already tools like PyAmazon for talking to the Amazon API in python. I didn't see an obvious way to get one's "books I own" list using it, though there may be one; instead, inspired by a simple and at least partially broken perl script from the O'Reilly Hacks collection, I came up with a tool that walks the web interface, logs on securely, and pokes through the forms, gathering data as it goes. I happen to have told Amazon about 152 books, and will probably add more, so this turned out to save me some effort. It should be simple to have the script fetch DVD and CD's as well.
I recently (late 2005) stumbled upon Tyrannioware, a project which has gone a lot further in the same direction, in Python - and I expect to pick up from there instead, when I get around to it.