law.target.local#
Local target implementations.
Class LocalFileSystem
#
- class LocalFileSystem(section=None, base=None, **kwargs)[source]#
Bases:
FileSystem
,LocalFileSystem
- exists(path, stat=False, **kwargs)[source]#
Return
True
if file or directory atpath
exist,False
otherwise- Parameters:
path (str) – a path within the FileSystem to check for existence.
- isdir(path, **kwargs)[source]#
Return
True
if the location atpath
is a directory. If not, returnFalse
.- Parameters:
path (str) – a path within the FileSystem to check as a directory.
Note: This method is optional, not all FileSystem subclasses implements it.
- remove(path, recursive=True, silent=True, **kwargs)[source]#
Remove file or directory at location
path
- mkdir(path, perm=None, recursive=True, silent=True, **kwargs)[source]#
Create directory at location
path
Creates the directory at
path
and implicitly create parent directories if they do not already exist.- Parameters:
path (str) – a path within the FileSystem to create as a directory.
parents (bool) – Create parent directories when necessary. When parents=False and the parent directory doesn’t exist, raise luigi.target.MissingParentDirectory
raise_if_exists (bool) – raise luigi.target.FileAlreadyExists if the folder already exists.
- listdir(path, pattern=None, type=None, **kwargs)[source]#
Return a list of files rooted in path.
This returns an iterable of the files rooted at
path
. This is intended to be a recursive listing.- Parameters:
path (str) – a path within the FileSystem to list.
Note: This method is optional, not all FileSystem subclasses implements it.
Class LocalTarget
#
- class LocalTarget(path=None, fs=LocalFileSystem(name=local_fs, 0x7fe157c88eb0), is_tmp=False, tmp_dir=None, **kwargs)[source]#
Bases:
FileSystemTarget
,LocalTarget
- fs = LocalFileSystem(name=local_fs, 0x7fe157c88eb0)#
- directory_class#
alias of
LocalDirectoryTarget
- file_class#
alias of
LocalFileTarget
Class LocalFileTarget
#
- class LocalFileTarget(path=None, fs=LocalFileSystem(name=local_fs, 0x7fe157c88eb0), is_tmp=False, tmp_dir=None, **kwargs)[source]#
Bases:
FileSystemFileTarget
,LocalTarget
Class LocalDirectoryTarget
#
- class LocalDirectoryTarget(path=None, fs=LocalFileSystem(name=local_fs, 0x7fe157c88eb0), is_tmp=False, tmp_dir=None, **kwargs)[source]#
Bases:
FileSystemDirectoryTarget
,LocalTarget