Pathlib Extensions
Overview
The pathlib_extensions
module serves two related purposes:
- Enable use of new filesystem path features on older Python versions. For example,
pathlib.PurePath.with_stem()
is new in Python 3.9, butpathlib_extensions
allows users on Python 3.6 through 3.8 to use it too. - Enable experimentation with new filesystem path features that are not found
in the
pathlib
module.
Included Items
This module currently contains the following:
- Experimental features
Path.is_image_file()
Path.is_audio_file()
Path.is_video_file()
- In
pathlib
since Python 3.9PurePath.with_stem()
PurePath.is_relative_to()
Path.readlink()
- In
pathlib
since Python 3.8Path.link_to()
- In
pathlib
since Python 3.7Path.is_mount()
Running Tests
To run tests, run tests/test_pathlib_extensions.py
. You will also need to install
the latest version of pathlib
if you are using a version of Python that
does not include pathlib
as a part of the standard library.