finds.dev← search

// the find

GeospatialPython/pyshp

★ 1,152 · Python · MIT · updated Jun 2026

This library reads and writes ESRI Shapefiles in pure Python.

PyShp is a pure-Python read/write library for ESRI Shapefiles — the 1998-era GIS format that refuses to die. No GDAL dependency, no C extensions, just Python. It is for anyone who needs to read or write .shp/.dbf/.shx files without pulling in a heavy GIS stack.

Zero dependencies beyond the standard library makes it trivially installable anywhere Python runs, including restricted environments where GDAL is a build nightmare. The file-like object API is genuinely flexible — you can feed it in-memory buffers, zip files, or URLs without any preprocessing. The 3.x refactor added proper static typing with mypy strict and hypothesis-based round-trip tests, which is a meaningful quality improvement over the old doctest-only coverage. Encoding handling has been worked over repeatedly and now actually deals with unicode truncation at code-point boundaries, which is the right way to handle DBF's fixed-width field constraints.

It's a single 3000+ line file (src/shapefile.py), which makes navigating or contributing painful — the 3.0.x changelog entries about 'separation of concerns' are mostly internal class splits that don't change the public API surface. There is no CRS/projection support at all; the library explicitly tells you to go read about map projections elsewhere, meaning you will silently write files with no .prj and then wonder why your coordinates are wrong in QGIS. The DBF format caps field names at 10 characters, a spec limitation the library inherits but can't escape — you will hit this the first time you try to round-trip a real-world dataset with descriptive column names. Performance on large files is workable but not fast; it's pure Python against a binary format, so if you're processing millions of features you'll be waiting.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →