GlobSource#

class GlobSource(params=None, **kwargs)#

Bases: MultiFileSource, CachedModule

Find files using glob patterns.

Relies on the function glob.glob(). Glob pattern are Unix shell-style wildcards:

  • * matches everything

  • ? matches a single character

  • [seq] matches any character in seq (once)

  • [!seq] matches any character not in seq

Parameters:
  • params (Any | None)

  • kwargs (Any)

GLOB_KWARGS = {'recursive': True}#

Kwargs passed to glob.glob().

property datafiles: list[str]#

Cached list of files found by using glob.

get_glob_pattern()#

Return the glob pattern matching your files.

If it is defined, the pattern starts from get_root_directory().

Not implemented:

implement in your Source module subclass.

Return type:

str