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

Uploaded Python 3

File details

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

File metadata

File hashes

Hashes for yadisk-1.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 660c4392ec16c20b410f0cad85456d0731a061bcda05a548664eb5c8c0ca9dad
MD5 e60963e95b0c8ddf6374ad7c46a48df3
BLAKE2b-256 bacccd4ca34cb8164e49a9efe2dabe70332f8eccd00af383fb053534a69cf6c8

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