Skip to main content

new Webdav Client for Python3+

Project description

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': '失败代码'}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Gkwebdav-0.0.2.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

Gkwebdav-0.0.2-py3-none-any.whl (4.7 kB view details)

Uploaded Python 3

File details

Details for the file Gkwebdav-0.0.2.tar.gz.

File metadata

  • Download URL: Gkwebdav-0.0.2.tar.gz
  • Upload date:
  • Size: 3.5 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for Gkwebdav-0.0.2.tar.gz
Algorithm Hash digest
SHA256 a7869a6e68c35f693cf538abe570e039b364146c2daa3659c14cc74215004157
MD5 967bd968e1be34aca233c6711b482d49
BLAKE2b-256 ced73ad95920ffc79f4ff8a27298425eee1a497099e02411bbcb933351e700e1

See more details on using hashes here.

File details

Details for the file Gkwebdav-0.0.2-py3-none-any.whl.

File metadata

  • Download URL: Gkwebdav-0.0.2-py3-none-any.whl
  • Upload date:
  • Size: 4.7 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for Gkwebdav-0.0.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5c8611c4176864b5e812f2cf4cdd5c6d954bc555e14e52bf2229c3d4abc40953
MD5 10be793cd512450184c1aa07b35dea7e
BLAKE2b-256 baac690a4d18dd2fc7a10a03f3d9966138e5a55f9e5d77150697c1a426ca15b3

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page