03 February 2012

There is a recurring question at GIS mailing lists, forum and at some extent in my mailbox: what is the best way to master Python for developing geospatial applications? I myself had this question far away in 2006 when I started switching from proprietary software to open source, and had identified in Python the way to go.

In this post I will try to quickly summarize what is the best way to go in my opinion.

Python basics

If you are completely new to Python, first things to check out, are some very basic and popular resources, like these ones:

Obviously it does not hurt that they are, like most of resurces I will provide in this post, free resources like in beer.

Play with some Python GIS library

As soon as you have some basic skills for writing simple Python programs, start using the Python core library with some of the most popular GIS Python libraries, choosing the ones that are more relevant to the context of your background:

Before even writing any programs, test these Python APIs with a beautiful and unique feature of Python: the command line interpreter

For making it even more powerful, don’t forget to check out IPython and ipdb.

Do not complicate things with an IDE, keep it simple

Don’t use heavy IDE, now and later, but keep things simple using basic but powerful editors like vi and/or gedit.

They are very light and still both provide features like syntax highlight and indentation.

You will still be able to debug code in an excellent manner using pdb, or - even better - ipdb together with IPython.

Time for something more challenging

When you will be ready for mastering more challenging stuff in order to become a real Python hacker :), these resources are definitely a must-read:

Some more resources on Python and geospatial software

Other Python resources, related to the geospatial sphere, worth to be mentioned are:

Some best practices you should adopt

This is a quick list of best practices you should follow when developing with Python (but this is the same for other languages as well!):

  • write documentation using reST, and managing and rendering it with tools like docutils and Sphinx
  • write tests
  • use a source control management system like git or mercurial. If you don’t want to create the SCM infrastructure yourself, use the excellent and free services by gitHub and bitbucket

Understand the jargon

Last but not least, please be sure to have a good understanding of the jargon background with these guys :)

Please, if you think I forget anything from this post, send me your feedback and I will be very happy to integrate it with yours suggestion ;) Have fun!

blog comments powered by Disqus