Can I export my datas in pickle format safely ?

D

DurumDara

Hi !

I want to create a database from datas.
I want to store my datas in lists/dicts/normal variables.

I thinking about that I can use the pickle to serialize/load my datas
from the file.

But: I remember that in the year of 2004(?) I tried this thing. I store
my CD informations in pickled objects (in files).
And when I changed my python version from ??? to 2.3(?), and I get some
error messages...

So: I want to store datas in the simply as possible, but I don't want to
get error messages in the future, when I upgrade a new python version.

I see that the Gnosis project have pickle tools that can dump objects to
XML.
XML is compatible in any future versions, I can read it, etc.

So. Anyone can help me: pickle module have problems when I want to load
older dumped objects, or I can use it for dev. my application ?
Or any tool I need to use ?

Thanks for the advance:
dd
 
S

Sybren Stuvel

DurumDara enlightened us with:
I want to create a database from datas.

Just nitpicking: 'data' is already plural, a single is called 'datum'.
I thinking about that I can use the pickle to serialize/load my
datas from the file.

Sure you can. Be very, very careful though, since unpickling data can
result in that data taking over your Python.
And when I changed my python version from ??? to 2.3(?), and I get
some error messages...

Which is exactly as documented in the pickle module.
So: I want to store datas in the simply as possible, but I don't
want to get error messages in the future, when I upgrade a new
python version.

Without knowing more about your data, I can't help you out. You could
try an SQLite database.
I see that the Gnosis project have pickle tools that can dump
objects to XML. XML is compatible in any future versions, I can
read it, etc.

Don't be too sure that it's compatible for the indefinite future. XML
is just as future-proof as any other format.

Sybren
 
M

Marc 'BlackJack' Rintsch

DurumDara said:
I thinking about that I can use the pickle to serialize/load my datas
from the file.

But: I remember that in the year of 2004(?) I tried this thing. I store
my CD informations in pickled objects (in files).
And when I changed my python version from ??? to 2.3(?), and I get some
error messages...

What are the error messages? Pickled data should survive such a version
change. Remember that even "text protocol" pickles are binary data which
may break across platforms if the files are not opened in binary mode for
writing and reading. And all classes of the types that were pickled must
be "reachable" when unpickling.

Ciao,
Marc 'BlackJack' Rintsch
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top