Pathlib-style path manipulation API #65
Closed
+376
−57
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request makes significant improvements to the
pathablelibrary, focusing on enhancing its usability, documentation, and compatibility with Python'spathlibinterface. The most important changes are the addition ofFilesystemPathfor filesystem traversal, major enhancements to theBasePathAPI to mimicpathlib, improved documentation and examples inREADME.md, and expanded test coverage for the new and updated features.API and Feature Enhancements:
FilesystemPathclass for traversing filesystem objects, with afrom_pathconstructor and integration with the newPathAccessor. (F27fb04cL352, [1] [2]BasePathwith manypathlib-like methods and properties, includingname,parent,parents,suffix,suffixes,stem,with_name,with_suffix,as_posix,__fspath__,is_relative_to, andrelative_to, for more intuitive and flexible path manipulations.AccessorPathandLookupPathAPIs with newstat()andopen()methods for retrieving metadata and context-managed value access, as well as a publicfrom_lookupconstructor forLookupPath.Documentation Improvements:
README.mdwith clearer descriptions, a new quickstart, usage examples, filesystem usage, and explanations of core concepts and compatibility.Testing and Compatibility:
BasePathandAccessorPathAPIs, including pathlib-like behavior, context management, stat functionality, and correct preservation of accessors across operations.Internal Refactoring:
These changes collectively make
pathablemore powerful, user-friendly, and compatible with familiar Python path-handling idioms.