Skip to content

WebDAV connection

Bases: FileConnection, RenameDirMixin

WebDAV file connection. support hooks

Based on WebdavClient3 library.

Warning

Since onETL v0.7.0 to use WebDAV connector you should install package as follows:

pip install "onetl[webdav]"

# or
pip install "onetl[files]"
See File connections install installation instruction for more details.

Added in 0.6.0

Parameters:

  • host (str) –

    Host of WebDAV source. For example: webdav.domain.com

  • user (str) –

    User, which have access to the file source. For example: someuser

  • password (str) –

    Password for file source connection

  • ssl_verify (Union[Path, bool]) –

    SSL certificates used to verify the identity of requested hosts. Can be any of - True (uses default CA bundle), - a path to an SSL certificate file, - False (disable verification), or - a ssl.SSLContext

  • protocol (str, default: https ) –

    Connection protocol. Allowed values: https or http

  • port (int) –

    Connection port

Examples:

Create and check WebDAV connection:

from onetl.connection import WebDAV

wd = WebDAV(
    host="webdav.domain.com",
    user="someuser",
    password="*****",
    protocol="https",
).check()

path_exists(path)

Check if specified path exists on remote filesystem. support hooks.

Added in 0.8.0

Parameters:

  • path (str | PathLike) –

    Path to check

Returns:

  • bool

    True if path exists, False otherwise.

Examples:

>>> connection.path_exists("/path/to/file.csv")
True
>>> connection.path_exists("/path/to/dir")
True
>>> connection.path_exists("/path/to/missing")
False