Extends the standard library pathlib.Path class.
Project description
pathier
Extends the standard library pathlib.Path class.
Installation
Install with:
pip install pathier
Usage
Functions the same as pathlib.Path, but with added functions and some altered default arguments.
Can dump and load toml and json files:
from pathier import Pathier path = Pathier("some_file.toml") content = path.loads() path.with_suffix(".json").dumps(content, indent=2)
Pathier().mkdir()
creates parent directories and doesn't throw an error if the path already exists by default.
Pathier().write_text()
and Pathier().write_bytes()
will create parent directories by default if they won't exist.
Pathier().write_text()
will also try to cast the data to be written to a string if a TypeError is thrown.
Pathier().delete()
will delete a file or directory, event if that directory isn't empty.
Pathier().copy()
will copy a file or a directory tree to a new destination and return a Pathier object for the new path
By default, files in the destination will not be overwritten.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.