Skip to main content

SHPTOOLS

A collection of Python tools for working with shapefile (ESRI Shapefile) vector files.

GDAL Installation: GDAL is required for this package. For conda environments, use conda install gdal to install GDAL. For non-conda environments, download the appropriate wheel file from https://github.com/cgohlke/geospatial-wheels/releases to install GDAL.

Installation

pip install -e .

Features

  • shpinfo: Check shapefile properties (geometry, projection, extent, fields)
  • shpasprj: Assign a projection to shapefiles without modifying geometry
  • mvshp: Relocate shapefiles by setting a new upper-left (or lower-left) coordinate
  • shpext: Extract the bounding-box extent of shapefiles as new rectangle shapefiles

Usage

Command-line

# List all available commands
shptools-info

# Check properties of all SHP files in the current directory
shpinfo -a

# Check a single file
shpinfo -i parcels.shp

# Assign a projection to all SHP files (metadata only, no geometry change)
shpasprj -a --epsg 3826
shpasprj -a -e 3826

# Relocate a shapefile to a new upper-left coordinate
mvshp -i parcels.shp -x 500000 -y 2500000

# Relocate a shapefile to a new lower-left coordinate
mvshp -i parcels.shp -x 500000 -y 2500000 --lower-left

# Extract the extent of all SHP files as rectangle shapefiles in SHP_EXT/
shpext -a

# Extract the extent of a single file
shpext -i parcels.shp

Python API

from shptools import shpinfo, shpasprj, mvshp, shpext

# Report shapefile properties
shpinfo.check_shp_info("parcels.shp")

# Assign projection metadata without touching geometry
shpasprj.assign_projection("parcels.shp", epsg=3826)

# Relocate a shapefile's geometry to a new upper-left coordinate
mvshp.relocate_shapefile("parcels.shp", x=500000, y=2500000)

# ... or to a new lower-left coordinate
mvshp.relocate_shapefile("parcels.shp", x=500000, y=2500000, corner="lower-left")

# Extract a shapefile's extent as a rectangle shapefile in SHP_EXT/
shpext.extract_extent("parcels.shp")

Notes

  • shpasprj and mvshp automatically create a SHP_BAK/ directory with backup copies before modifying files.
  • shpext saves extracted extent shapefiles into a SHP_EXT/ directory.
  • GDAL must be installed separately via conda or a pre-built wheel; it is not listed in requirements.txt as it cannot be reliably installed via pip on all platforms.

Metadata

Release files for shptools 0.5.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for shptools 0.5.0
File Size Uploaded
shptools-0.5.0.tar.gz 11.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for shptools 0.5.0
File Interpreter ABI Platform
shptools-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 26.4 kB

Release files / shptools-0.5.0.tar.gz

Download URL shptools-0.5.0.tar.gz
Size 11.0 kB
Tags Source
SHA-256 checksum
How to use checksums
562bc7402dbec1eb3ee3f167f675b803ccd1bbe2ab34206b4ba25097949a1c09
BLAKE2b-256 checksum
How to use checksums
5754cd31b47e1ccb7b49b9fa61e3b1a05897b90ca507832121bceb0a973934b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release files / shptools-0.5.0-py3-none-any.whl

Download URL shptools-0.5.0-py3-none-any.whl
Size 15.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
cf5759da5a8770031a2b81986b679d03350e5507c2e6856df6db7b51ae353299
BLAKE2b-256 checksum
How to use checksums
eb170bfa028cc2d69cec0754962dc46878e4e4dca8926159dfbc954efa6a59cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Aug 25, 2026.

Transparency log

Release history Release notifications | RSS feed

0.6.0

2 release files

This release

0.5.0 This release

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page