Esri / Esri/arcpy

Enhancement - Pathlib Support for Tools

Open
#4 4 comments 1 reaction 0 assignees View on GitHub
Dominant language
No language data
Stars
57
Forks
5
PR merge metrics
No merged PRs in 30d

Description

Pathlib is a modern Python library for handling filepath/pathing and has been part of the standard Python library since approximately 2014 (Python 3.4). More than a decade later, my hope is that ArcPy be enhanced to accept Paths as inputs.

Currently, as of ArcGIS Pro 3.4, the utilization of Paths creates a runtime error which could be difficult for new ArcPy users to decipher; the workaround is to wrap all paths in a `str()` function. This is doable but clutters up development. The alternative is to do things the old-fashioned way with strings only which is a bummer.

This enhancement request is to provide the necessary functionality for file inputs as `pathlib.Path` type.

[c. 2020 Add support for pathlib.Path objects to arcpy](https://community.esri.com/t5/python-ideas/add-support-for-pathlib-path-objects-to-arcpy/idi-p/933118)
[c. 2021 Using pathlib with SearchCursor](https://community.esri.com/t5/python-questions/using-pathlib-with-searchcursor/td-p/1072120)

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.