Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/jrialland/asgi_dav
ASGI WebDAV application
https://github.com/jrialland/asgi_dav
asgi fastapi webdav webdav-server
Last synced: about 1 month ago
JSON representation
ASGI WebDAV application
- Host: GitHub
- URL: https://github.com/jrialland/asgi_dav
- Owner: jrialland
- License: mit
- Created: 2024-07-03T19:00:58.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-07-11T18:05:52.000Z (5 months ago)
- Last Synced: 2024-07-11T20:25:33.000Z (5 months ago)
- Topics: asgi, fastapi, webdav, webdav-server
- Language: Python
- Homepage:
- Size: 109 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Overview
This project is a minimalistic ASGI module that implements a WebDAV server. The focus is on simplicity rather than completeness, making it an easy-to-use solution for basic WebDAV needs.
# Features
Simplicity over Completeness: Designed to be straightforward and easy to use.
Basic WebDAV Functionality: Supports essential WebDAV operations.
Tested with Windows 11 Client: Ensured compatibility with the built-in WebDAV client in Windows 11.
# Limitations
No Resource Locking: This server does not support resource locking (yet)
# Dependencies
ASGI: The server is implemented as an ASGI module.
fs Module: Utilizes the [pyfilesystem2](https://github.com/PyFilesystem/pyfilesystem2) module for filesystem access.# Installation
```shell
pip install git+https://github.com/jrialland/asgi_dav@main
```# Usage (uvicorn)
```python
from asgi_dav import DAVApp
from fs.osfs import OSFS
import uvicornuvicorn.run(DAVApp(OSFS(".")))
```# Usage (fastapi)
```python
from fastapi import FastAPI
from asgi_dav import DAVApp
from fs.memoryfs import MemoryFS # use an in-RAM filesystem for the exampleapp = FastAPI()
# Mount the DAVApp as a sub-application in FastAPI.
app.mount("/dav", DAVApp(MemoryFS()))```
# Events
your program can be notified of filesystem changes :
```python
from asgi_dav.events import FileUploadEventasync def print_uploaded_file(evt:FileUploadEvent):
print(f"File Uploaded : {evt.path}")davApp = DAVApp(MemoryFS()))
davApp.on('file.uploaded', print_uploaded_file)
#[...]
```
# License
This project is licensed under the MIT License.