Skip to main content

Clent for Yandex.Disk

Project description

YaDiskClient

https://github.com/TyVik/YaDiskClient/actions/workflows/test.yaml/badge.svg?branch=master https://coveralls.io/repos/github/TyVik/YaDiskClient/badge.svg?branch=master https://img.shields.io/pypi/pyversions/YaDiskClient.svg https://img.shields.io/pypi/v/YaDiskClient.svg https://img.shields.io/pypi/status/YaDiskClient.svg https://img.shields.io/pypi/l/YaDiskClient.svg

Client for Yandex.Disk based on WebDav.

Install

pip install YaDiskClient

Source code

github

explanatory article

Passwords and tokens

You must use application password, not account password! Details - https://yandex.ru/support/id/authorization/app-passwords.html

Also, you can create OAuth-token for your application. Details - https://yandex.ru/dev/disk/doc/dg/concepts/quickstart.html

Both methods are supported. You should use method set_login or set_token before start.

Using API

from YaDiskClient.YaDiskClient import YaDisk
disk = YaDisk()
disk.set_auth(login, password)

"""
Library also supports token authorization via:
disk.set_token(token)
"""

disk.df() # show used and available space

disk.ls(path) # list of files/folder with attributes
disk.mkdir(path) # create directory

disk.rm(path) # remove file or directory
disk.cp(src, dst) # copy from src to dst
disk.mv(src, dst) # move from src to dst

disk.upload(src, dst) # upload local file src to remote file dst
disk.download(src, dst) # download remote file src to local file dst

disk.publish_doc(path) # return public url
disk.hide_doc(path) # remove public url form Yandex Disk

Tests

For run tests:
  1. Set Yandex username and password in file tests/test_YaDiskClient.py

  2. python -m unittest discover -s tests -t tests

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

YaDiskClient-1.0.1.tar.gz (5.5 kB view details)

Uploaded Source

Built Distribution

YaDiskClient-1.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file YaDiskClient-1.0.1.tar.gz.

File metadata

  • Download URL: YaDiskClient-1.0.1.tar.gz
  • Upload date:
  • Size: 5.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.10

File hashes

Hashes for YaDiskClient-1.0.1.tar.gz
Algorithm Hash digest
SHA256 b3c10113f6ab158f4747e5569f5a88e1408bc0c4e8d723d63cda1b5f33efca95
MD5 b6788ada46c88c344034cb6852a2bf22
BLAKE2b-256 e8f59ce466d671379f4f3789b27d1b2bc832162e385a30500fd38edb3377098a

See more details on using hashes here.

File details

Details for the file YaDiskClient-1.0.1-py3-none-any.whl.

File metadata

File hashes

Hashes for YaDiskClient-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff485644a9599aefb625270b0a934a9b0b83fe06f5546448a5d0fd6eace05f4e
MD5 8d11c5f698dbe7e5dcee40f6e46ef2d4
BLAKE2b-256 7a5e39fba7874406bd1915b0406d2fe451c823ef67940b7b5d47aa1bd432a7c0

See more details on using hashes here.

Supported by

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