Shapefile reader in Python?

To use the Python Shapefile Library download shapefile.py: http://code.google.com/p/pyshp/source/browse/trunk/shapefile.py

Place it in your working directory or in your Python site-packages directory and you are ready to go.

Just type "import shapefile" in your interpreter or python script and follow usage examples and documentation at the PyShp project on Google Code.


GDAL includes the OGR library which supports shapefile I/O. However, the installation process for this package in Windows is not very straightforward.


Also PySAL could be of some help. Reads shape files:

import pysal
shp = pysal.open('YOUR_FILE.shp')

And plenty of others geo related formats.


The pyshp library should be good.