Sunday, September 5, 2010

Python and Oracle: you need to start somewhere!

If you need to access an Oracle database using python (actually, to access any database), the first thing you'll need to read is the Python Database API Specification 2.0, which proposes a standard interface to be used by database access libraries. This specification is database agnostic, and various libraries exist which implement it (more or less strictly) for different DBMS.
The library I am using for Oracle access is cx-Oracle, which (almost!) conforms to this specification.
If the Python Database API Specification is too abstract for you and you'd be happy if the official cx-Oracle docs contained more examples, what you need is a nice tutorial to introduce yourself to this library. Then maybe another tutorial to go beyond the basics. Now probably the Specification and the cx-Oracle docs make more sense!
Oh, if you want to work with cx-oracle, you will need to install it first :-). I found very useful this howto  by Catherine Devlin. If you work with Ubuntu, you will love it for sure.
Hope this helps!

PS
I assume that yo have some familiarity with Python and Oracle.
If not, I bet this post is not the most interesting you've ever read!

1 comment:

  1. Reading this post has been a thoroughly enlightening experience. God bless you.

    ReplyDelete