_pathlib_

original._pathlib_

This extends pathlib by allowing a variant of glob, flob, to be patched into the pathlib.Path class

class original._pathlib_.Path[source]

Bases: pathlib.Path

flob(glob='**', depth=[], index=False)

Flob is a variant of glob that returns folders aswell, hence the name.

The usual pattern matching is supported, that is the recursive form ‘**’ is supported. This is possible since glob, and flob, use fnmatch under the hood. Similarly Path.(r)glob is really glob under the hood.

flob returns the folder(s) and files in a sorted depth first search order.

This is probably more closely related to os.walk but uses the pathlib Path API/Objects.

Arguments :

root - This is the root path to start searching from glob - This is the file name pattern that matches the files

in the folder.

depth - This is the tuple which comprises the index later on index - returns an ordered tuple along with the path which

indicates file or folder order e.g. (3,2,5) is the fifth file or folder in teh second folder of the third folder.

Note

Index is redundant and the user should wrap flob within an enumerate call instead if they require unique indices.

original._pathlib_.flob(root=PosixPath('.'), glob='**', depth=[], index=False)[source]

Flob is a variant of glob that returns folders aswell, hence the name.

The usual pattern matching is supported, that is the recursive form ‘**’ is supported. This is possible since glob, and flob, use fnmatch under the hood. Similarly Path.(r)glob is really glob under the hood.

flob returns the folder(s) and files in a sorted depth first search order.

This is probably more closely related to os.walk but uses the pathlib Path API/Objects.

Arguments :

root - This is the root path to start searching from glob - This is the file name pattern that matches the files

in the folder.

depth - This is the tuple which comprises the index later on index - returns an ordered tuple along with the path which

indicates file or folder order e.g. (3,2,5) is the fifth file or folder in teh second folder of the third folder.

Note

Index is redundant and the user should wrap flob within an enumerate call instead if they require unique indices.