Metadata-Version: 2.0
Name: yadisk
Version: 1.2.2
Summary: Библиотека-клиент REST API Яндекс.Диска / Yandex.Disk REST API client library
Home-page: https://github.com/ivknv/yadisk
Author: Ivan Konovalov
Author-email: rvan.mega@gmail.com
License: GPLv3
Keywords: yandex yandex.disk rest
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: License :: OSI Approved :: GNU General Public License v3 or later (GPLv3+)
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3
Requires-Dist: requests

YaDisk
======

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

.. _Read the Docs (EN): http://yadisk.readthedocs.io
.. _Read the Docs (RU): http://yadisk.readthedocs.io/ru/latest

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

Установка
*********

.. code:: bash

    pip install yadisk

или

.. code:: bash

    python setup.py install

Примеры
*******

.. code:: python

    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"))


