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.
Source Distribution
Built Distribution
File details
Details for the file pathier-0.0.0.tar.gz
.
File metadata
- Download URL: pathier-0.0.0.tar.gz
- Upload date:
- Size: 29.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f4de8149584af597376168b78299b6a3f0893c338fd8247cf421541018f8485 |
|
MD5 | 28136527c07b2ce1e4b4102f474d6b9b |
|
BLAKE2b-256 | 45bc75b1afa5f7fd7cabc2c777e13236bb4d630cebf6967a24f9d12eb10b39ae |
Provenance
File details
Details for the file pathier-0.0.0-py3-none-any.whl
.
File metadata
- Download URL: pathier-0.0.0-py3-none-any.whl
- Upload date:
- Size: 4.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.0
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f0296e296748dcba7de7a136c0ee4ee14358bf566ab063c3282ba95f1526322 |
|
MD5 | 17e531f5d638c839197c10575cc4401f |
|
BLAKE2b-256 | 00990cd1b7f186eccff6cde1a2435516db4b6b4169da5a1355b26714f8e1dc23 |