Skip to main content

A simple high level library to work with Path

Project description

:sparkles: EpicPath :sparkles:

A high Level Python Library to work with Path

EpicPath is a SubClass of Path from pathlib. This class aims to simplify high level operations with path

Context and history

I'm a Computing Student tired of creating again and again the same functions through all my projects to do the exact same thing... :tired_face: Indeed, in every of my projects I create files, delete them, create folders and delete them blablabla ... To solve this boring problem, I decided to create my own library that I can create one and only one time to use and reuse as many time as I wish to. And because I'm trying to be nice to this cruel world I share this Epic project with all of you :heart: So feel free to download, use and give feedback about this epic creation. :+1:

Description

You already know Path from the library pathlib. Well, EpicPath is all like Path but in a EPIC way :tada: .

It is a pseudo subclass of Path but consider it as a subclass, it supports all the methods and options of the original library. It is also a os.PathLike object which allows you to use as you would want to:

with open(my_epic_path_object, 'w') as f:
    f.write('This is epic !!!')

Use it

Install it

pip install epic-path

Use it

from epicpath import EpicPath as EPath

path = EPath('f1', 'f2')        # EpicPath('f1/f2')
path2 = path / 'f3'             # EpicPath('f1/f2/f3')
path2 += '_0'                   # EpicPath('f1/f2/f3_0')

See the documentation

:warning: Warnings :warning:

Because Path is build-in Python libraries, some other library (like PIL or skopt) can have a specific behavior when the given filename is a str or a Path object. Unfortunately, they don't support an EpicPath object ... :cry: But no worries, it is still possible to give an EpicPath object as a Path object or a str object using the properties .path and .str:

path = EPath('f1', 'f2')        # EpicPath('f1/f2')

weird_function(path.path)       # Gives Path('f1/f2') to the function
weird_function(path.str)        # Gives the string 'f1/f2' to the function

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

epic-path-0.0.5.tar.gz (4.8 kB view details)

Uploaded Source

Built Distribution

epic_path-0.0.5-py3-none-any.whl (5.2 kB view details)

Uploaded Python 3

File details

Details for the file epic-path-0.0.5.tar.gz.

File metadata

  • Download URL: epic-path-0.0.5.tar.gz
  • Upload date:
  • Size: 4.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for epic-path-0.0.5.tar.gz
Algorithm Hash digest
SHA256 907681a713606a4a300bce6d9d9d21c9da2dd4fc1d0461f029b09ced30bf1d42
MD5 9cfaf64dde3dcc8abf90b29a62d5558b
BLAKE2b-256 9382de3b33c68e41c8f1afb1e02e971af60921376fe17e654c8d233b3b9ea95f

See more details on using hashes here.

File details

Details for the file epic_path-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: epic_path-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 5.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.7.3

File hashes

Hashes for epic_path-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 fc55f17fcd6a92af3a80d60ebe9c5e6848113176adcaf1851a8a519597405a8e
MD5 a612992f8be9a8d59f58c1f7c49d184a
BLAKE2b-256 4088c3a9aaa45705ed8be9f7f74e898be014c2b82fd1950aaeccc50d3ba5f51f

See more details on using hashes here.

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