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 gdalto 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 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 parcels.shp -x 500000 -y 2500000
# Relocate a shapefile to a new lower-left coordinate
mvshp 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 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
shpasprjandmvshpautomatically create aSHP_BAK/directory with backup copies before modifying files.shpextsaves extracted extent shapefiles into aSHP_EXT/directory.- GDAL must be installed separately via conda or a pre-built wheel; it is not listed in
requirements.txtas it cannot be reliably installed via pip on all platforms.
Metadata
Release files for shptools 0.6.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| shptools-0.6.0.tar.gz | 11.2 kB | With provenance | Details for shptools-0.6.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| shptools-0.6.0-py3-none-any.whl | Python 3 | none | any | Details for shptools-0.6.0-py3-none-any.whl |
Total release size: 27.0 kB
Release files / shptools-0.6.0.tar.gz
| Download URL | shptools-0.6.0.tar.gz |
|---|---|
| Size | 11.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f5d1c8a07221773ee3ed0c8b73607af847673ab4132a10498a6babcc669fbe92
|
|
BLAKE2b-256 checksum How to use checksums |
33239da2b71c0f61d5add60847c914b54fe6fe78e36b8011c392062b5f37b664
|
| 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 Oct 4, 2026.
Transparency logRelease files / shptools-0.6.0-py3-none-any.whl
| Download URL | shptools-0.6.0-py3-none-any.whl |
|---|---|
| Size | 15.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
88a5df9c389a6f3d80493919acd03a61d63d2b3104ff9175e405849d8d47f08e
|
|
BLAKE2b-256 checksum How to use checksums |
d94cbc6aa23e4de650459d879baec2d5b350863c96013d1035136a62c86e835f
|
| 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 Oct 4, 2026.
Transparency logSecurity for shptools 0.6.0
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for shptools-0.6.0.tar.gz
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 Oct 4, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.