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.

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-1.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

pathstring-1.0.0-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file pathstring-1.0.0.tar.gz.

File metadata

  • Download URL: pathstring-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a3 CPython/3.6.8 Linux/5.0.0-15-generic

File hashes

Hashes for pathstring-1.0.0.tar.gz
Algorithm Hash digest
SHA256 98173829639fcb239ca4c2cc8078854a92c30c57d9307e0ad60fabebc689e11e
MD5 5b2934c0c68dc3c919e4ba95962d42ea
BLAKE2b-256 7cd632d26ab085a1aa9c7a8dbab27b78480b0da6ba4ab75ef25c898a770d8891

See more details on using hashes here.

Provenance

File details

Details for the file pathstring-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pathstring-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.0.0a3 CPython/3.6.8 Linux/5.0.0-15-generic

File hashes

Hashes for pathstring-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 8a89d029d8ccffb4a0c27d393ddae688ba2a5e88a1d5207c02f9902654c7e0d2
MD5 9e550dce81fce1d93e15ef1ae961a768
BLAKE2b-256 a359b45850ded1299fd38465d3d6c88a0e16731ef2eef3edf8ab9c59375c26b4

See more details on using hashes here.

Provenance

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