Skip to main content

String with path operations.

Project description

PyPI version. Supported Python versions. Project license. Azure Pipelines build status. Code formatted by Black.

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.


Copyright (C) 2019 H. Turgut Uyar <>

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.

Files for pathstring, version 1.0.0
Filename, size File type Python version Upload date Hashes
Filename, size pathstring-1.0.0.tar.gz (10.9 kB) File type Source Python version None Upload date Hashes View
Filename, size pathstring-1.0.0-py3-none-any.whl (11.9 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page