Giter Club home page Giter Club logo

epicpath's Introduction

โœจ EpicPath โœจ

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 things... ๐Ÿ˜ซ 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 times 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 โค๏ธ So feel free to download it, use it and give feedback about this epic creation. ๐Ÿ‘

Description

You already know Path from the library pathlib. Well, EpicPath is all like Path but in a EPIC way ๐ŸŽ‰ .

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

โš ๏ธ Warnings โš ๏ธ

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 ... ๐Ÿ˜ข 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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.