A lightweight Python package for extracting data from Esri REST API endpoints.
Project description
ezesri
A lightweight Python package for extracting data from Esri REST API endpoints.
Installation
pip install .
Usage
Python library
You can use ezesri as a library to integrate with your Python scripts.
import ezesri
# URL for a public Esri feature layer
url = "your_esri_layer_url_here"
# Get layer metadata
metadata = ezesri.get_metadata(url)
print(metadata)
# Extract layer to a GeoDataFrame
gdf = ezesri.extract_layer(url)
print(gdf.head())
Command-line interface
ezesri also provides a command-line tool for quick data extraction.
Fetch metadata
ezesri metadata <YOUR_ESRI_LAYER_URL>
Fetch layer data
You can fetch a layer and save it to a file in various formats.
-
GeoJSON
ezesri fetch <YOUR_ESRI_LAYER_URL> --format geojson --out output.geojson
-
Shapefile
ezesri fetch <YOUR_ESRI_LAYER_URL> --format shapefile --out output.shp
-
CSV (geometry is dropped)
ezesri fetch <YOUR_ESRI_LAYER_URL> --format csv --out output.csv
You can also filter by a bounding box (in WGS84 coordinates):
ezesri fetch <URL> --bbox <xmin,ymin,xmax,ymax> --format geojson --out <FILE>
Bulk-fetch all layers from a service
You can discover and export all layers from a MapServer or FeatureServer to a specified directory.
ezesri bulk-fetch <YOUR_ESRI_SERVICE_URL> <YOUR_OUTPUT_DIRECTORY>
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ezesri-0.1.0.tar.gz.
File metadata
- Download URL: ezesri-0.1.0.tar.gz
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fcec505c41be1cbf0dcd332a4e700def4b8007da9a0596266803bde094da3eea
|
|
| MD5 |
bada837999cb6c3715bdef74bbfd393d
|
|
| BLAKE2b-256 |
2b4b5aa417ce458429ad092182a6baf74ef46f4a6351f2b33ff4f5a3272cc96d
|
File details
Details for the file ezesri-0.1.0-py3-none-any.whl.
File metadata
- Download URL: ezesri-0.1.0-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.10.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
257317d74ed9664564591ab7ed3a495721bb7aee1843dec4148b7c872ea30e80
|
|
| MD5 |
8b33e83d67ac90e13fb87f23c7579e42
|
|
| BLAKE2b-256 |
a7d841e83d13ea1fcf4457bfc4dab56c679de98d7f4596e57ea71742ccf3bb79
|