[BioPython] saving pickled objects in MySQL database

Daniel Tomso dtomso at athenixcorp.com
Mon Nov 28 08:26:41 EST 2005


Hi--

There's probably a better way to do this - - -

But - - - 

You could use StringIO (or cStringIO) to create a file handle in memory,
write to it w/ Pickle (or cPickle), read the contents from it with
readlines(), then drop the result into a memo field in MySQL using
MySQLdb.

Seems like it would work . . .

I've also done similar semi-workaround solutions using a ramdisk, which
is straightforward and relatively fast.

Dan T.




Daniel J. Tomso

Senior Scientist, Bioinformatics
Athenix Corporation

2202 Ellis Road

Suite B

Durham, NC 27703

 

919.281.0920

dtomso at athenixcorp.com

www.athenixcorp.com

 

 

 

Disclaimer: This message (including any attachments) may contain
confidential or privileged information and is intended only for the use
of the addressee named above. If you are not the intended recipient of
this message, you are hereby notified that you must not use, copy,
disclose or take any action based on this message or information herein.
If you have received this message in error, please advise the sender
immediately and erase all copies of this message and any related
attachments.  Thank you.



-----Original Message-----
From: biopython-bounces at portal.open-bio.org
[mailto:biopython-bounces at portal.open-bio.org] On Behalf Of Ann Loraine
Sent: Wednesday, November 23, 2005 10:49 PM
To: biopython at biopython.org
Cc: Ann Loraine
Subject: [BioPython] saving pickled objects in MySQL database

Hi,

This may be a bit off topic - my apologies if so.

Can anybody point me to some good references or recipes on the best
way to save pickled Python objects in a MySQL database?

I'm using MySQLdb to talk to the database.

Ideally, I'd like to find a way to stream object data directly into
the database without an intermediate step of writing data to a file on
disk.

Thanks in advance for your help!

-Ann

--
Ann Loraine
Assistant Professor
Section on Statistical Genetics
University of Alabama at Birmingham
http://www.ssg.uab.edu
http://www.transvar.org

_______________________________________________
BioPython mailing list  -  BioPython at biopython.org
http://biopython.org/mailman/listinfo/biopython




More information about the BioPython mailing list