Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Will the real path.py please stand up?

There was a good module, path.py, written by Jason Orendorff. If I recall correctly, there was some discussion about adding it to the standard library then it faded away.

It looks now that there are multiple outgrowths of the original one. I can find so far unipath, what looks like a forked path.py, another one, and a few others according to PyPI.

Anyone has experience with any of those options? Is one better than the other in terms of functionality, maintenance or any other criteria? Or should I just pick one at random?

(Apologies for the whimsical title. I first went for "Which path.py?" but it was too short for SO's taste.)

like image 259
Muhammad Alkarouri Avatar asked Oct 10 '10 09:10

Muhammad Alkarouri


2 Answers

I've also been a fan of this module for quite some time. This one seems to have the most recent commits, and also to be true to the original form -- which really, I like best of the different versions I've tried. Installable using pip install path.py

edit: Looks like as of python 3.4 (and backported to 2.7 on PYPI), there's a standard lib path module called pathlib. It's not nearly as extensive as some of the path modules are, but it benefits from the lack of clutter, and it is a well-thought-out path implementation, retaining some of the best base qualities of quite a few of the path libraries that are out there. Particularly of note, it cleanly handles the differences between different OS paths (Windows and Posix), and seems like a good clean tool that's worth a look. Regardless of whether it has every feature one could ever want or not (it doesn't), it's nice that Python finally has a good standard path implementation.

like image 175
Mr. B Avatar answered Nov 12 '22 09:11

Mr. B


All path.py fans stand up!

Since Python 3.4, a module is dealing with paths, module pathlib. It is based on PEP 428, and heavily inspired from our beloved path.py, though seems to take some different approach notably on a strong distinction between Windows path and Unix path.

like image 36
CharlesB Avatar answered Nov 12 '22 10:11

CharlesB