Skip to main content

Библиотека-клиент REST API Яндекс.Диска / Yandex.Disk REST API client library

Project description

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

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

Установка

pip install yadisk

или

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.8-py3-none-any.whl (29.1 kB view details)

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for yadisk-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 4e1371afb1bfe391cbccddb616f15c0ecdf4d5abdf5d7a9ef8bd024a65c5110c
MD5 0ec96c43351519ed289a9c45cb815ece
BLAKE2b-256 aec518f159cef53a4a920be2ed677393cb798a359a4ef8738605e81e6efc67eb

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