A simple Python library for Nextcloud WebDAV operations (List, Upload, Download). Designed to be used within the ESA MAAP Project.
Project description
Using Python to List, Upload and Download files on Nextcloud
With nextcloud_pywebdav you can:
- List all the files and folder within your Nextcloud storage and navigate through them
- Upload files or folders from your local Jupyter environment to your Nextcloud storage
- Download files or folders from Nextcloud to your Jupyter environment
Disclaimer: this module has been developed to be used within the ESA MAAP Project. Please, check the related documentation to assess the needed criteria. We are not responsible for any damages.
Installation
pip install nextcloud_pywebdav
Functions description
def list_remote_path(base_url: str, username: str, app_password: str, remote_path: str, max_depth: int = 3)
Lists files and folders from a Nextcloud WebDAV endpoint recursively (tree view)
- base_url: Nextcloud server URL
- username: Nextcloud username
- app_password: Nextcloud app password
- remote_path: The starting folder relative to the user's files
- max_depth: Limits recursion depth for large directories
def upload_folder_recursive(base_url: str, username: str, app_password: str, remote_parent_folder: str, local_dir: str, max_workers: int = 4)
Upload a local folder (and its contents recursively) to Nextcloud
- base_url: Nextcloud server URL
- username: Nextcloud username
- app_password: Nextcloud app password
- remote_parent_folder: Path of the Nextcloud target folder
- local_dir: Path of the folder to upload
def upload_file(base_url: str, username: str, app_password: str, remote_folder: str, local_file_path: str, retries: int = 3)
Uploads a single local file to a specified remote folder.
- base_url: Nextcloud server URL
- username: Nextcloud username
- app_password: Nextcloud app password
- remote_folder: Path of the Nextcloud target folder
- local_file_path: Path of the single file to upload
def download_resource(base_url: str, username: str, app_password: str, remote_path: str, local_download_base_path: str)
Downloads a single file or an entire folder recursively
- base_url: Nextcloud server URL
- username: Nextcloud username
- app_password: Nextcloud app password
- remote_folder: The path of the resource on Nextcloud (relative to the user's root files)
- local_download_base_path: The local directory where the file/folder will be placed
Examples
You can find some usage examples referring to the official ESA PAL documentation.
Additional Resources
- ESA MAAP Main Portal: https://portal.maap.eo.esa.int/
- ESA PAL Documentation: https://portal.maap.eo.esa.int/ini/kb/books
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nextcloud_pywebdav-1.0.1.tar.gz.
File metadata
- Download URL: nextcloud_pywebdav-1.0.1.tar.gz
- Upload date:
- Size: 7.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7926457f515603779e56a78c52cf645dcb3cd7641244a31e42e9c910412193ac
|
|
| MD5 |
5a43338b400b26d63b40a340fef40004
|
|
| BLAKE2b-256 |
1408098264b4972f8b79c72be76db2b09bb46b6825126473e689d9b185da59e7
|
File details
Details for the file nextcloud_pywebdav-1.0.1-py3-none-any.whl.
File metadata
- Download URL: nextcloud_pywebdav-1.0.1-py3-none-any.whl
- Upload date:
- Size: 7.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e2da62a8cdbf23c3f7b912ae17b64bcc6eda1f4ff21d272c1acfa0b37780727a
|
|
| MD5 |
ba48f3b3849012ef7551917bd054e6dd
|
|
| BLAKE2b-256 |
9ccb4fcfd70de435b0200994ce5272f94bfbbe5f9f6e62b24afa9fb8c71388ed
|