--- id: pyshp version: "3.1.6" license: MIT license_treatment: permissive maintenance: active --- # pyshp — Pure Python read/write support for ESRI Shapefile format License: permissive · Maintenance: active · Downloads: 8.4M/mo ## What it is and what it does PyShp is a pure-Python library for reading and writing ESRI Shapefiles, the de facto standard vector data format in GIS. It handles the three-file shapefile format (shp, shx, dbf) without requiring compiled geospatial libraries, making it lightweight and portable. The library provides Reader and Writer classes for loading geometry and attribute data from disk, zip files, URLs, or file-like objects, and for creating new shapefiles from scratch. The package supports the full range of shapefile geometry types including points, lines, polygons, and 3D variants with elevation (Z) and measurement (M) values. It handles encoding and decoding of text fields, spatial and attribute filtering for large files, and merging or editing existing shapefiles. Recent versions have improved Unicode support and encoding robustness, with a strict mode for catching data truncation or encoding issues before they corrupt output files. Use it for: - Load census or administrative boundary shapefiles to extract geometry and demographic attributes for mapping or analysis. - Convert tabular geographic data into shapefiles for distribution to GIS software. - Filter or merge multiple shapefiles by spatial extent or attribute values without a full GIS application. - Read shapefile metadata (bounds, geometry type, field definitions) to validate or inspect data before processing. - Programmatically edit existing shapefiles to update coordinates, add records, or correct encoding issues. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. PyShp reads and writes ESRI Shapefiles in pure Python, supporting geometry and attribute data in the standard GIS vector format without external dependencies. Yes. PyShp is a mature, actively maintained library with no dependencies, permissive licensing, and no known vulnerabilities. It is the standard choice for shapefile I/O in pure Python when you do not need full geospatial frameworks. Install it if you work with shapefiles in data pipelines, GIS automation, or geospatial analysis. ## Install pip install pyshp uv add pyshp poetry add pyshp ## Installing pyshp Before you install: Installation is straightforward with no runtime dependencies and a pure-Python wheel distribution. The package is actively maintained with a recent release (20 days old) and has been stable since its initial 2011 release. License in practice: MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal legal friction. Quickstart: import pyshp # Read a shapefile reader = pyshp.Reader('example.shp') for shape in reader.shapes(): print(shape.points) # Write a shapefile writer = pyshp.Writer('output.shp') writer.field('name', 'C') writer.point(0, 0) writer.record('test') writer.close() Requires Python 3.9 or later. Verify before relying: - Whether the package handles very large shapefiles efficiently in memory or requires streaming approaches. - Performance characteristics when reading or writing shapefiles with thousands of records or complex geometries. - Specific memory footprint or scalability limits for production use. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 8.4M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags shapefile read write python, esri shapefile library, gis vector data format, geospatial data python, shapefile parser, geographic information system, dbf shp shx files, gis, geospatial, shapefile [View on SkillFed](https://skillfed.io/packages/pyshp) · [View on PyPI](https://pypi.org/project/pyshp/)