IOPro - MySQL

0 views
Skip to first unread message

Larry Green

unread,
Mar 28, 2015, 12:58:22 PM3/28/15
to anac...@continuum.io
Very simply, I need to understand how to setup the connection string for use of IOPro with a MySQL database.

iopro seems to piggyback pyodbc. 

The documentation says -
connect_string = 'DSN=myodbc3;UID=devel;PWD=XXX;DATABASE=test'  # MySQL

But there is zero explanation of this, or relevant examples. 

Do I need to have pyodbc installed in conda?

I use sqlalchemy and PyMySQL.  is the connection the same?

I also see references to Drivers etc., but no explanation as to when,why and how to use...

To make simple, my sqlalchemy connection is:
engine_str = 'mysql+pymysql://{}:{}@{}/{}'.format(login, passwd, server, db)

engine = sqlalchemy.create_engine(engine_str, echo=False, encoding='utf-8', pool_recycle=3600)

conn = engine.connect()   


Please help...




Ilan Schnell

unread,
Mar 28, 2015, 1:05:01 PM3/28/15
to Anaconda, Jay Bourque
IOPro comes with it's own version of pyodbc, which may be imported as iopro.pyodbc.
I'm CCing Jay, who is the main developer of IOPro.

- Ilan

--
Anaconda Community Support Group Brought to you by Continuum Analytics
---
You received this message because you are subscribed to the Google Groups "Anaconda - Public" group.
To unsubscribe from this group and stop receiving emails from it, send an email to anaconda+u...@continuum.io.
To post to this group, send email to anac...@continuum.io.
Visit this group at http://groups.google.com/a/continuum.io/group/anaconda/.

Larry Green

unread,
Mar 28, 2015, 4:34:01 PM3/28/15
to anac...@continuum.io, Jay Bourque
Hi ,

I found the MySQL Driver in the Windows 7 administrative settings.  Then used that in the connection string, and it worked.  Thanks.

I will say that the IOPro fetchdictarray from a MySQL table seems to return some strange results/characters.  

Is there any way to bring the table directly into a pandas DataFrame?

________________________________

Larry Green, CFA

SmartMarketData, LLC

lgr...@SmartMarketData.com

203.829.3000 (m)

Oscar Villellas

unread,
Mar 30, 2015, 7:33:58 AM3/30/15
to anac...@continuum.io, Jay Bourque
There is no call in IOPro.pyodbc that returns a dataframe directly. However, a single call is enough to make a dataframe out of the results of fetch_dictarray or fetch_sarray in a quite efficient way.

For fetch_dictarray you can use "pandas.DataFrame.from_dict", while for fetch_sarray just pass the result to the DataFrame constructor. In our tests the conversions are very efficient.

Can you develop a bit more on the strange results/characters? Are you using an unicode driver? what are the actual types used in those fields? what is the NumPy dtype returned for those character fields?

Thanks,
  Oscar

Reply all
Reply to author
Forward
0 new messages