pyshp
Pure Python read/write support for ESRI Shapefile format
Decision gist · record as of 2026-08-14
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.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Requires Python 3.9 or later.
- 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 · maintenance · safety
MIT (permissive) — MIT license permits unrestricted use, modification, and distribution in both open-source and commercial projects with minimal legal friction.
last release 2026-07-25 (20 days) · last repo commit 2026-08-14 · 1,154 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 8,371,394 downloads/mo, #1,630 on PyPI
Alternatives
Verify before relying
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()- 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.
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 on this page. Verify before relying on it.
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
pyshp on PyPI
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.
Requires Python 3.9 or later.
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()
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 the current Python release >=3.9 |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Actively maintained 20 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 8,371,394 / month, #1,630 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3 :: OnlyTopic :: Scientific/Engineering :: GISTopic :: Software Development :: LibrariesTopic :: Software Development :: Libraries :: Python Modules |
Evidence: pyshp-3.1.6-py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “shapefile read write python”
- pyshpPyShp reads and writes ESRI Shapefiles in pure Python, supporting…
- pyogrioPyogrio provides fast, bulk-oriented read and write access to vector…
- fionaFiona reads and writes vector GIS data (Shapefile, GeoPackage, etc.)…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also pyogrio · arcgis · fiona · pygeoif · plyfile · arcgis2geojson · geojson · lasio · dbf · dbfread