Skip to main content

String with path operations.

Project description

pathstring is a very small module that provides a string class which supports 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.

  • It adds a path.rmtree() operation which invokes shutil.rmtree. Actually, since paths are strings, shutil.rmtree(path) will also work.

  • It adds a strict parameter to the relative_to operation which, when set to False, will also navigate up in the hierarchy.

  • It doesn’t support the slash operator for joining paths.

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

pathstring-0.2.0.tar.gz (4.9 kB view hashes)

Uploaded Source

Built Distribution

pathstring-0.2.0-py3-none-any.whl (11.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page