String with path operations.
Project description
pathstring is a very small module that provides only one class (pathstring.Path) which is a string with support for path operations. Technically, it subclasses str and delegates path related operations to pathlib.Path.
Differences from pathlib paths are:
Paths are strings, no need to cast them to strings.
No distinction between “pure” and “concrete” paths.
No explicit distinction between Posix and Windows paths, but paths are always “native” to their platform.
Adds a Path.rmtree() method which invokes shutil.rmtree() on the path. Actually, since paths are strings, shutil.rmtree(path) will also work.
Adds a strict parameter to the Path.relative_to() method which, when set to False, will also navigate “up” in the hierarchy.
No support for case-insensitive comparisons on Windows.
No Path.replace() method since it would cause confusion with str.replace().
Features are tested extensively against pathlib documentation to guarantee compatibility.
License
Copyright (C) 2019 H. Turgut Uyar <uyar@tekir.org>
pathstring is released under the BSD license. Read the included LICENSE.txt file for details.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for pathstring-1.1.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 610543e7de97198d9eb3f7774ef8f62752e2142e9f321f95125088e3b4329b23 |
|
MD5 | 265e9be6401b2ec32294fb431bea455f |
|
BLAKE2b-256 | d60f05cf53b3d21c517cb319c29f95874e226f3d840a7edd31431d5d79d73883 |