PyDocs

Nav

File and Directory Access

PurePath.stem

pathlib

attribute of PurePath (source)
The final path component, minus its last suffix.
Changed in 3.14
  • 3.14: A single dot (”.”) is considered a valid suffix.
1 Example
>>> PurePosixPath('my/library.tar.gz').stem
'library.tar'
>>> PurePosixPath('my/library.tar').stem
'library'
>>> PurePosixPath('my/library').stem
'library'
from the Python docs
See Also
No see-alsos for pathlib/PurePath.stem
0 Notes
No notes for PurePath.stem