[CentralOH] Python and Oracle

Jon Miller jonebird at gmail.com
Wed Dec 9 14:13:50 CET 2009


You may want to consider using an ORM package which will abstract a
lot of the particular details around the particular flavor of RDBMS
that you are connecting to. In helping others learn python, I usually
end up introducing them to sqlalchemy (SA) and encourage them to take
the time to learn it. IMO, it's worth climbing the moderate learning
curve it possesses. Also, if you're not a fan of ORMs than you can
still take advantage of the abstractions and consistency SA provides
in it's SQL Expression Language.

Here is a link to their documentation about Oracle support:
http://www.sqlalchemy.org/docs/05/reference/dialects/oracle.html

But to give a better "start here" link, I'd suggest the basic overview page:
http://www.sqlalchemy.org/docs/05/intro.html#overview

-- Jon Miller

On Tue, Dec 8, 2009 at 10:40 PM, Michael S. Yanovich
<yanovich at cse.ohio-state.edu> wrote:
> I've started a challenge in Python (I may have gotten myself in over my
> head) where I want to create a Python script that would access a *remote*
> Oracle database and provide the contents of a certain entry in the database.
> I've done some research on this and it seems that I would need either
> cx_Oracle or PyODBC.
>
> For cx_Oracle it looks like I need to have Oracle installed locally to use
> it. However, I have found some useful tutorials on using cx_Oracle that make
> it look easy for what I want to accomplish.
>
> As for PyODBC I would have to compile it locally and change my PATHs for
> Python to get this to work, but I'm not fully sure on how to go about using
> it to access a database. (It seems more intimidating)
>
> The server I would like to remotely connect to doesn't have a documented
> API, but it does have a publicly search-able database that anyone can
> connect to and browse. I know it is built on Oracle. I have determined this
> by the error messages and such the system throws at someone. I am assuming
> though that the information I am looking for is in a database.
>
> The database is:
> https://courses.osu.edu/psp/hcosuct/EMPLOYEE/HRMS/c/COMMUNITY_ACCESS.OSR_CAT_SRCH.GBL
>
> It can be access by going to http://buckeyelink.osu.edu/ and scrolling down
> to and clicking on "Course Catalog" under Academics and under Public Access.
>
> I know something of this nature can be done because a website has
> accomplished this using PHP and maybe something else.
> http://schedulizer.com/
>
> My question to everyone is: Which route should I go cx_Oracle or PyODBC, or
> am I going about this all wrong? Or is there an easier way?
>
>
> _______________________________________________
> CentralOH mailing list
> CentralOH at python.org
> http://mail.python.org/mailman/listinfo/centraloh
>
>


More information about the CentralOH mailing list