Skip to main content

WebDAVit

WebDAVit is a simple async WebDAV client for Python.

Features

  • Basic file operations: list, upload, download, mkdir, delete, move, copy, lock.
  • Support for authentication.
  • Asynchronous operations using aiohttp for non-blocking I/O.
  • Lightweight and easy to use.

Installation

You can install WebDAVit using pip:

pip install webdavit

Or, if you're using uv, you can add it with:

uv add webdavit

Usage

Here's a quick overview of how to use WebDAVit:

import asyncio
import io
from webdavit import WebDAVClient

async def example():
    async with WebDAVClient(
            'https://webdav.example.com',
            username='user',
            password='pass',
        ) as client:

        # List files in the root directory
        files = await client.list('/')
        print(files)

        # Upload a file
        await client.upload_file('/path/to/local_file.txt', '/remote_file.txt')
        await client.upload_text('Hello, WebDAV!', '/hello.txt')
        await client.upload_bytes(b'Hello, WebDAV in bytes!', '/hello_bytes.txt')
        await client.upload_stream(io.BytesIO(b'Streaming data!'), '/stream.txt')
        await client.upload_json({'key': 'value'}, '/data.json')

        # Download a file
        await client.download_file('/remote_file.txt', '/path/to/local_file.txt')
        text = await client.download_text('/hello.txt')
        print(text)
        jsondata = await client.download_json('/data.json')
        print(jsondata)
        bytesdata = await client.download_bytes('/hello_bytes.txt')
        print(bytesdata)
        async with client.download_stream('/stream.txt')
            print(await stream.read())

        # Delete a file
        await client.delete('/remote_file.txt')

        # Create a directory
        await client.mkdir('/new_directory')

        # Delete a directory
        # Note that this is a recursive delete
        await client.delete('/new_directory')

        # Move or rename a file
        await client.move('/old_name.txt', '/new_name.txt')

        # Copy a file
        await client.copy('/source.txt', '/destination.txt')

        # Check if a file or directory exists
        exists = await client.exists('/some_path')
        print(f'Exists: {exists}')

        # Get file or directory info
        info = await client.get('/some_path')
        print(info)

        # Lock a file
        async with await client.lock('/some_file.txt', timeout=60) as lock:
            print(f'Lock info: {lock}')
            await client.upload_text(
                'Updated content while locked',
                '/some_file.txt',
                lock_token=lock.token
            )
            # Refresh the lock if needed
            await client.refresh_lock(lock)
            print(f'Refreshed lock info: {lock}')
            # The lock will be released automatically when exiting the context

asyncio.run(example())

License

WebDAVit is licensed under the MIT License. See the LICENSE.txt file for details.

Metadata

Release files for webdavit 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for webdavit 0.1.0
File Size Uploaded Provenance Actions
webdavit-0.1.0.tar.gz 12.2 kB With provenance Details for webdavit-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for webdavit 0.1.0
File Interpreter ABI Platform Actions
webdavit-0.1.0-py3-none-any.whl Python 3 none any Details for webdavit-0.1.0-py3-none-any.whl

Total release size: 26.2 kB

Release files / webdavit-0.1.0.tar.gz

Download URL webdavit-0.1.0.tar.gz
Size 12.2 kB
Tags Source
SHA-256 checksum
How to use checksums
1935881c2db9c4f9a5b4bf8ca5bf123cda01c922be25ac937df34b99ac051d5d
BLAKE2b-256 checksum
How to use checksums
83850c05eec49bb20ff9202f54ca5bc2e1f3472d3409a837e176c5c437a94ee9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2025.

Transparency log

Release files / webdavit-0.1.0-py3-none-any.whl

Download URL webdavit-0.1.0-py3-none-any.whl
Size 13.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
de5d929f436d674df99b9d74743c144b5c88e731df9b52032eff433c9bc7048a
BLAKE2b-256 checksum
How to use checksums
ffe65d02592d8b594655dc30d546950b1811b62a48748dbb2454552895c6eb70
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2025.

Transparency log

Security for webdavit 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for webdavit-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Sep 1, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page