WebDAV connection¶
Bases: FileConnection, RenameDirMixin
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]"
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 - assl.SSLContext -
protocol(str, default:https) –Connection protocol. Allowed values:
httpsorhttp -
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. .
Added in 0.8.0
Parameters:
-
path(str | PathLike) –Path to check
Returns:
-
bool–Trueif path exists,Falseotherwise.
Examples:
>>> connection.path_exists("/path/to/file.csv")
True
>>> connection.path_exists("/path/to/dir")
True
>>> connection.path_exists("/path/to/missing")
False