RemoteFolder#

class etl_entities.source.file.remote_folder.RemoteFolder(*, name: AbsolutePath, instance: GenericURL | Cluster)#

Remote folder representation

Parameters:
namestr or pathlib.PosixPath

Folder path

Warning

Only absolute path without .. are allowed

instanceetl_entities.instance.url.generic_url.GenericURL

Instance URL in format "protocol://some.domain[:port]"

Examples

from etl_entities import RemoteFolder

folder1 = RemoteFolder(name="/absolute/folder", instance="rnd-dwh")
folder2 = RemoteFolder(name="/absolute/folder", instance="ftp://some.domain:10000")
Attributes:
qualified_name

Unique name of remote folder

Methods

copy(*[, include, exclude, update, deep])

Duplicate a model, optionally choose which fields to include, exclude and change.

dict(*[, include, exclude, by_alias, ...])

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

json(*[, include, exclude, by_alias, ...])

Generate a JSON representation of the model, include and exclude arguments as per dict().

__str__()#

Returns full process name

__truediv__(path: GenericPath) AbsolutePath#

Returns absolute path for nested file or folder

copy(*, include: AbstractSetIntStr | MappingIntStrAny | None = None, exclude: AbstractSetIntStr | MappingIntStrAny | None = None, update: DictStrAny | None = None, deep: bool = False) Model#

Duplicate a model, optionally choose which fields to include, exclude and change.

Parameters:
  • include – fields to include in new model

  • exclude – fields to exclude from new model, as with values this takes precedence over include

  • update – values to change/add in the new model. Note: the data is not validated before creating the new model: you should trust this data

  • deep – set to True to make a deep copy of the model

Returns:

new model instance

dict(*, include: AbstractSetIntStr | MappingIntStrAny | None = None, exclude: AbstractSetIntStr | MappingIntStrAny | None = None, by_alias: bool = False, skip_defaults: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False) DictStrAny#

Generate a dictionary representation of the model, optionally specifying which fields to include or exclude.

json(*, include: AbstractSetIntStr | MappingIntStrAny | None = None, exclude: AbstractSetIntStr | MappingIntStrAny | None = None, by_alias: bool = False, skip_defaults: bool | None = None, exclude_unset: bool = False, exclude_defaults: bool = False, exclude_none: bool = False, encoder: Callable[[Any], Any] | None = None, models_as_dict: bool = True, **dumps_kwargs: Any) unicode#

Generate a JSON representation of the model, include and exclude arguments as per dict().

encoder is an optional function to supply as default to json.dumps(), other arguments as per json.dumps().

property qualified_name: str#

Unique name of remote folder

Returns:
valuestr

Qualified name

Examples

from etl_entities import RemoteFolder

folder1 = RemoteFolder(name="/absolute/folder", instance="rnd-dwh")
folder2 = RemoteFolder(name="/absolute/folder", instance="ftp://some.domain:10000")

assert folder1.qualified_name == "/absolute/folder@rnd-dwh"
assert folder1.qualified_name == "/absolute/folder@ftp://some.domain:10000"