Database access via Python

In my ongoing quest to do absolutely everything through Python, I’ve been looking a lot lately at manipulating databases. I’ve been using arcpy to access GIS databases for years, and last year I finally got around to using pyodbc (and pypyodbc) for accessing SQL Server databases.

Now that I’m in an Oracle environment, Oracle has provided the cx_Oracle library to directly connect to databases. I have yet to test that though. What I’m interested in at the moment is creating and accessing databases for personal use.

I considered MongoDB for a while, but I don’t think I want to go NoSQL yet. This is why I have been experimenting with SQLite (through the sqlite3 library), as it is included in the Python install, and has the delightful SpatiaLite extension. The slogan goes against my one of my mottos (Spatial is Special) while supporting my other motto (Everything is Spatial).

Advertisements

2 thoughts on “Database access via Python

  1. Great post! I have abandoned pyodbc in production for accessing MS SQL Server as it was unstable. A better alternative I stick to is pymssql, works really great.

    Considering the databases per se, I a big fan of PostGIS. You can do a whole lot with them – check my post for details (https://tereshenkov.wordpress.com/2016/08/20/esri-enterprise-geodatabase-and-postgis-database/). I think you’ll love PostGIS in particular how well it can be integrated with the open source Python stack and ArcGIS ecosystem!

    Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s