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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for yadisk-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b4e3e1e2dd39942cedf54f2dfb58fc94eca816f27400320558f76551c25ae6f5
MD5 6b74c8efee3afcc0ac9801ce50ea6d21
BLAKE2b-256 fea568c421bb640a2fa7202d82dd7d18d73b0f1c6248f164ad11bfee0efbe771

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