Friday, January 1, 2010

R, Python, and WRDS

I just discovered that python can be run through Wharton's SSH connection! I know that I can run python commands from within R with Rpy, and I can use SSH through R, so can I write a python program in R to query COMPUSTAT? Super cool if so; I'm investigating. Tell me if you know, please.

I'm hoping I can take this approach rather get into the SAS or FORTRAN programs. SAS looks understandable enough, but its just so ugly.

Edit: there's an SQL proc in SAS which lets you use just plane-jane SQL, so I'll probably end up using that. But it would be so much cooler to do it all within R.

1 comment:

AlexC said...

Hi TJ,

I am a PhD student in Finance and I would like to access the WRDS database with Python as well; however, I am having trouble setting up the remote connection.

Is there any way that you could post your python code for the connection? Thanks so much for your help!