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
c. 2021 Using pathlib with SearchCursor
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.Pathtype.c. 2020 Add support for pathlib.Path objects to arcpy
c. 2021 Using pathlib with SearchCursor