I need to insert a python tuple (of floats) into a MySQL database. In principle I could pickle it and insert it as a string, but that would grant me the chance only to retrieve it through python. Alternative is to serialize the tuple to XML and store the XML string.
What solutions do you think would be also possible, with an eye toward storing other stuff (e.g. a list, or an object). Recovering it from other languages is a plus.
I’d look at serializing it to JSON, using the simplejson package, or the built-in json package in python 2.6.
It’s simple to use in python, importable by practically every other language, and you don’t have to make all of the “what tag should I use? what attributes should this have?” decisions that you might in XML.