Skip to main content

Yandex.Disk REST API client library

Project description

YaDisk - это библиотека-клиент REST API Яндекс.Диска.

Документация доступна на Read the Docs (RU) и Read the Docs (EN).

Установка

Для начала, должен быть установлен requests:

pip install requests
python setup.py install

Примеры

import yadisk

y = yadisk.YaDisk("<id-приложения>", "<secret-приложения>", "<токен>")

# Проверяет, валиден ли токен
print(y.check_token())

# Получает общую информацию о диске
print(y.get_disk_info())

# Выводит содержимое "/some/path"
print(list(y.listdir("/some/path")))

# Загружает "file_to_upload.txt" в "/destination.txt"
y.upload("file_to_upload.txt", "/destination.txt")

# То же самое
with open("file_to_upload.txt", "rb") as f:
    y.upload(f, "/destination.txt")

# Скачивает "/some-file-to-download.txt" в "downloaded.txt"
y.download("/some-file-to-download.txt", "downloaded.txt")

# Безвозвратно удаляет "/file-to-remove"
y.remove("/file-to-remove", permanently=True)

# Создаёт новую папку "/test-dir"
print(y.mkdir("/test-dir"))

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

yadisk-1.0.0-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file yadisk-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for yadisk-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 979ecfc562c93eeb42140e8bdc8839e209f642d8b08e1f13cb1c21920128f4b3
MD5 b5e16bacde11a14d2ba807c3ce565e61
BLAKE2b-256 b08af1aa5d93735740606ea591a58cafc947474776813a5dd6f413ebc14d3a45

See more details on using hashes here.

Supported by

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