pathlib ~master
Object oriented path manipulation.
To use this package, run the following command in your project's root directory:
Manual usage
Put the following dependency into your project's dependences section:
pathlib
Inspired by the python library pathlib.
Differences to the python library API
+ Addition | - Removal | $ Change
- - There are no
PureXPathbase classes. - - No
PureXPathbase classes. - - No inheritance tree.
- $ Most operations/functions are D module functions but can be called as if they were members (thanks to D's unified function call syntax UFCS).
- $
as_posix()=>posixData(). - +
asPosix()to convert between different paths. - +
asNormalized()to normalize a path, without resolving it. This works for all types of paths, regardless of the current system. as_posix()=>posixData(). Additionally, there is alsowindowsData().- $ Instead of overloading operator
/, the concatenation operator~is overloaded instead:Path("hello") ~ "world" ~ "goodBye// WindowsPath("hello\\world\\goodBye") or PosixPath("hello/world/goodBye") - $ Instead of
suffix()andsuffixes()there areextension(),extensions(), andfullExtension(). - $ While pythons pathlib usually uses '/' as the path segment separator, we try to maintain the separator for the current type of path as much as possible.
- $ Instead of providing
rglob(),glob()accepts an optionalSpanModeparameter. The typeSpanModeis a public import fromstd.file. - +
copyFileTo()To copy one file to some destination andcopyTo()to copy either files or directories (not unlikecp -r).
- ~master released 5 years ago
- Manuzor/pathlib
- MIT
- Copyright © 2015, manuzor
- Authors:
- Sub packages:
- pathlib:lib, pathlib:lib64
- Dependencies:
- none
- Versions:
-
Show all 6 versions0.3.0 2015-Sep-15 0.2.0 2015-Jun-15 0.1.2 2015-May-22 0.1.1 2015-May-22 0.1.0 2015-May-22 - Download Stats:
-
-
0 downloads today
-
2 downloads this week
-
5 downloads this month
-
245 downloads total
-
- Score:
- 0.7
- Short URL:
- pathlib.dub.pm