Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pathier-0.1.0.tar.gz (29.7 kB view details)

Uploaded Source

Built Distribution

pathier-0.1.0-py3-none-any.whl (4.3 kB view details)

Uploaded Python 3

File details

Details for the file pathier-0.1.0.tar.gz.

File metadata

  • Download URL: pathier-0.1.0.tar.gz
  • Upload date:
  • Size: 29.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.0

File hashes

Hashes for pathier-0.1.0.tar.gz
Algorithm Hash digest
SHA256 0f4d22768fbf483ec9fa43f13753689385069ce8c6fc49b031ef9e1807c7c90f
MD5 885c2e9805b0fb162e08917c5843f3f2
BLAKE2b-256 2cad191bc3c0ea99a3eeee1cca7bd1627a9b70e43284c53e26f42d7822f13d02

See more details on using hashes here.

Provenance

File details

Details for the file pathier-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: pathier-0.1.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

Hashes for pathier-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9794194cc39cb1b6c65c4321a56c86b1e9b0f1ef315f459579f3d97e97866204
MD5 97ee15d713f845090deecc2c20657c4d
BLAKE2b-256 03ce5e3dac6549077c38756cbf57b4f8a3528b9623f28810ccec9ec9685bde01

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