Skip to main content

New webdav client for Python3+

功能:cwd;cd();ls();mkdir();mkdirs();rmdir();delete();move();copy();upload();download()

使用方法

安装Gkwebdav模块
pip install Gkwebdav

创建Gkwebdav对象

import Gkwebdav

webdav = Gkwebdav.Gkwebdav(url='webdavurl', username='username', password='password')

cwd 当前所在目录

print(webdav.cwd)
#返回当前所在目录位置默认'/'

cd() 进入到目录

webdav.cd(path='dirname')
#无返回值

ls() 遍历文件目录

webdav.ls([path=''])
#成功返回值{'success': True, 'result': [{'path': '路径', 'length': 文件大小 , 'lastmodified': '最后的修改日期', 'type': '文件类型'}]}
#失败返回值{'success': False, 'result': '失败代码'}

mkdir() 创建单层文件夹

webdav.mkdir(path='newdirname')
#返回None,调用ls()查看是否生效

mkdirs() 创建多层目录

webdav.mkdir(path='newdirname/newdirname/...')
#返回None,调用ls()查看是否生效

rmdir() 删除目录

webdav.rmdir(path='dirname')
#返回None,调用ls()查看是否生效

delete() 删除文件

webdav.delete(path='filename')
#返回None,调用ls()查看是否生效

move() 移动文件

webdav.move(path='filename', new_path='newfilename')
#成功返回值{'success': True, 'result': ''}
#失败返回值{'success': False, 'result': '失败代码'}

copy() 复制文件

webdav.copy(path='filename', new_path='newfilename')
#成功返回值{'success': True, 'result': ''}
#失败返回值{'success': False, 'result': '失败代码'}

exists() 检查文件是否存在

webdav.exists(rmote_path='filename')
#返回bool值

upload() 文件上传

webdav.upload(filename='local_filename', rmote_path='target_filename')
#成功返回值{'success': True, 'result': ''}
#失败返回值{'success': False, 'result': '失败代码'}

download() 文件下载

webdav.download(rmote_path='rmote_filename', local_path='save_filename')
#成功返回值{'success': True, 'result': ''}
#失败返回值{'success': False, 'result': '失败代码'}

Metadata

Release files for Gkwebdav 0.0.2

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

Source distribution (sdist)

Source distribution for Gkwebdav 0.0.2
File Size Uploaded
Gkwebdav-0.0.2.tar.gz 3.5 kB Details

Built distribution (wheel)

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

Total release size: 8.2 kB

Release files / Gkwebdav-0.0.2.tar.gz

Download URL Gkwebdav-0.0.2.tar.gz
Size 3.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a7869a6e68c35f693cf538abe570e039b364146c2daa3659c14cc74215004157
BLAKE2b-256 checksum
How to use checksums
ced73ad95920ffc79f4ff8a27298425eee1a497099e02411bbcb933351e700e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

Release files / Gkwebdav-0.0.2-py3-none-any.whl

Download URL Gkwebdav-0.0.2-py3-none-any.whl
Size 4.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5c8611c4176864b5e812f2cf4cdd5c6d954bc555e14e52bf2229c3d4abc40953
BLAKE2b-256 checksum
How to use checksums
baac690a4d18dd2fc7a10a03f3d9966138e5a55f9e5d77150697c1a426ca15b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.13.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/40.8.0 requests-toolbelt/0.9.1 tqdm/4.31.1 CPython/3.7.1

Release history Release notifications | RSS feed

This release

0.0.2 This release

2 release files

0.0.1

2 release files

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