Showing preview only (2,467K chars total). Download the full file or copy to clipboard to get everything.
Repository: ivknv/yadisk
Branch: master
Commit: dec9f27eeb09
Files: 172
Total size: 2.3 MB
Directory structure:
gitextract_wzpapcjd/
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report--english-.md
│ │ ├── bug-report--русский-.md
│ │ ├── feature-request--english-.md
│ │ ├── feature-request--русский-.md
│ │ ├── question--english-.md
│ │ └── question--русский-.md
│ └── workflows/
│ └── lint_and_test.yml
├── .gitignore
├── .readthedocs.yaml
├── CONTRIBUTING.rst
├── CONTRIBUTORS.rst
├── COPYING
├── COPYING.lesser
├── MANIFEST.in
├── README.en.rst
├── README.rst
├── README.ru.rst
├── docs/
│ ├── Makefile
│ ├── api_reference/
│ │ ├── async_api.rst
│ │ ├── exceptions.rst
│ │ ├── index.rst
│ │ ├── response_objects.rst
│ │ ├── session_interface.rst
│ │ ├── sessions.rst
│ │ ├── settings.rst
│ │ ├── sync_api.rst
│ │ ├── types.rst
│ │ └── utilities.rst
│ ├── changelog.rst
│ ├── conf.py
│ ├── index.rst
│ ├── intro.rst
│ ├── known_issues.rst
│ ├── locales/
│ │ └── ru/
│ │ └── LC_MESSAGES/
│ │ ├── api_reference.po
│ │ ├── changelog.po
│ │ ├── index.po
│ │ ├── intro.po
│ │ ├── known_issues.po
│ │ └── migration_guide.po
│ ├── make.bat
│ ├── migration_guide.rst
│ ├── requirements.in
│ └── requirements.txt
├── pyproject.toml
├── requirements-dev.in
├── requirements-dev.txt
├── src/
│ └── yadisk/
│ ├── __init__.py
│ ├── _api/
│ │ ├── __init__.py
│ │ ├── api_request.py
│ │ ├── auth.py
│ │ ├── disk.py
│ │ ├── operations.py
│ │ └── resources.py
│ ├── _async_client.py
│ ├── _async_client.pyi
│ ├── _async_session.py
│ ├── _client.py
│ ├── _client.pyi
│ ├── _client_common.py
│ ├── _common.py
│ ├── _import_session.py
│ ├── _session.py
│ ├── _typing_compat.py
│ ├── exceptions.py
│ ├── objects/
│ │ ├── __init__.py
│ │ ├── _auth.py
│ │ ├── _disk.py
│ │ ├── _error_object.py
│ │ ├── _link_object.py
│ │ ├── _operations.py
│ │ ├── _operations.pyi
│ │ ├── _resources.py
│ │ ├── _resources.pyi
│ │ └── _yadisk_object.py
│ ├── py.typed
│ ├── sessions/
│ │ ├── __init__.py
│ │ ├── _httpx_common.py
│ │ ├── aiohttp_session.py
│ │ ├── async_httpx_session.py
│ │ ├── httpx_session.py
│ │ ├── pycurl_session.py
│ │ └── requests_session.py
│ ├── settings.py
│ ├── types.py
│ └── utils.py
└── tests/
├── __init__.py
├── async_client_test.py
├── auth_test.py
├── auto_retry_test.py
├── client_test.py
├── conftest.py
├── disk_gateway.py
├── import_session_test.py
├── recorded/
│ ├── async/
│ │ ├── test_auth_async.json
│ │ ├── test_check_token.json
│ │ ├── test_copy.json
│ │ ├── test_device_code_auth_async.json
│ │ ├── test_download_by_link_error.json
│ │ ├── test_get_disk_info.json
│ │ ├── test_get_files.json
│ │ ├── test_get_last_uploaded.json
│ │ ├── test_get_meta.json
│ │ ├── test_get_public_resources.json
│ │ ├── test_get_upload_link_object.json
│ │ ├── test_is_file.json
│ │ ├── test_issue7.json
│ │ ├── test_listdir.json
│ │ ├── test_listdir_fields.json
│ │ ├── test_listdir_on_file.json
│ │ ├── test_listdir_with_limits.json
│ │ ├── test_listdir_with_max_items.json
│ │ ├── test_makedirs_with_scheme.json
│ │ ├── test_makedirs_without_scheme.json
│ │ ├── test_mkdir_and_exists.json
│ │ ├── test_move.json
│ │ ├── test_none_args.json
│ │ ├── test_operation_error_triggers_retry.json
│ │ ├── test_patch.json
│ │ ├── test_permanent_remove.json
│ │ ├── test_public_listdir.json
│ │ ├── test_public_settings.json
│ │ ├── test_publish_unpublish.json
│ │ ├── test_remove_trash.json
│ │ ├── test_rename.json
│ │ ├── test_restore_trash.json
│ │ ├── test_save_to_disk.json
│ │ ├── test_streaming_requests.json
│ │ ├── test_upload_and_download.json
│ │ ├── test_upload_and_download_async.json
│ │ ├── test_upload_download_non_seekable.json
│ │ ├── test_upload_url.json
│ │ └── test_wait_for_operation.json
│ └── sync/
│ ├── test_auth.json
│ ├── test_check_token.json
│ ├── test_copy.json
│ ├── test_device_code_auth.json
│ ├── test_download_by_link_error.json
│ ├── test_get_disk_info.json
│ ├── test_get_files.json
│ ├── test_get_last_uploaded.json
│ ├── test_get_meta.json
│ ├── test_get_public_resources.json
│ ├── test_get_upload_link_object.json
│ ├── test_issue7.json
│ ├── test_listdir.json
│ ├── test_listdir_fields.json
│ ├── test_listdir_on_file.json
│ ├── test_listdir_with_limits.json
│ ├── test_listdir_with_max_items.json
│ ├── test_makedirs_with_scheme.json
│ ├── test_makedirs_without_scheme.json
│ ├── test_mkdir_and_exists.json
│ ├── test_move.json
│ ├── test_none_args.json
│ ├── test_operation_error_triggers_retry.json
│ ├── test_patch.json
│ ├── test_permanent_remove.json
│ ├── test_public_listdir.json
│ ├── test_public_settings.json
│ ├── test_publish_unpublish.json
│ ├── test_remove_trash.json
│ ├── test_rename.json
│ ├── test_restore_trash.json
│ ├── test_save_to_disk.json
│ ├── test_streaming_requests.json
│ ├── test_upload_and_download.json
│ ├── test_upload_download_non_seekable.json
│ ├── test_upload_generator.json
│ ├── test_upload_url.json
│ └── test_wait_for_operation.json
└── test_session.py
================================================
FILE CONTENTS
================================================
================================================
FILE: .gitattributes
================================================
*.json binary
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report--english-.md
================================================
---
name: Bug report (English)
about: Create a report to help improve the library
title: "[Bug] <issue title>"
labels: bug, language-english
assignees: ''
---
**Describe the bug**
A clear and concise description of what the bug is.
**To Reproduce**
Steps to reproduce the behavior (preferably, an example code snippet).
**Expected behavior**
A clear and concise description of what you expected to happen.
**System Info (please complete the following information):**
- OS: [e.g. Windows, Linux, Mac OS]
- `yadisk` version: [e.g. 2.0.0]
- Python version: [e.g. 3.12.1]
**Additional context**
Add any other context about the problem here.
================================================
FILE: .github/ISSUE_TEMPLATE/bug-report--русский-.md
================================================
---
name: Bug report (Русский)
about: Создать баг репорт, чтобы помочь улучшить библиотеку
title: "[Bug] <название issue>"
labels: bug, language-russian
assignees: ''
---
**Опишите баг**
Четкое и краткое описание бага.
**Действия по воспроизведению бага**
Действия по воспроизведению: (например, пример кода или просто описание).
**Ожидаемое поведение**
Четкое и краткое описание ожидаемого поведения.
**Информация о вашей системе (заполните следующую информацию):**
- ОС: [например, Windows, Linux, Mac OS]
- Версия библиотеки `yadisk`: [например, 2.0.0]
- Версия Python: [например, 3.12.1]
**Дополнительая информация**
Здесь может быть любая дополнительная информация о проблеме.
================================================
FILE: .github/ISSUE_TEMPLATE/feature-request--english-.md
================================================
---
name: Feature request (English)
about: Suggest an idea for this project
title: "[Feature Request] <issue title>"
labels: enhancement, language-english
assignees: ''
---
**Describe why you want this feature**
A clear and concise description of what the problem is.
**Describe the solution you'd like**
A clear and concise description of what you want to happen.
**Additional context**
Add any other context about the feature request here.
================================================
FILE: .github/ISSUE_TEMPLATE/feature-request--русский-.md
================================================
---
name: Feature request (Русский)
about: Предложить идею
title: "[Feature Request] <название issue>"
labels: enhancement, language-russian
assignees: ''
---
**Опишите проблему**
Четкое и краткое описание проблемы, которую вы предлагаете решить.
**Опишите ваше решение**
Четкое и краткое описание вашего решения.
**Дополнительная информация**
Здесь может быть любая другая дополнительная информация.
================================================
FILE: .github/ISSUE_TEMPLATE/question--english-.md
================================================
---
name: Question (English)
about: Ask a question
title: "[Question] <issue title>"
labels: language-english, question
assignees: ''
---
**Short description of your question**
Your question in detail.
================================================
FILE: .github/ISSUE_TEMPLATE/question--русский-.md
================================================
---
name: Question (Русский)
about: Задать вопрос
title: "[Question] <название issue>"
labels: language-russian, question
assignees: ''
---
**Краткое описание вашего вопроса**
Подробное содержание вопроса.
================================================
FILE: .github/workflows/lint_and_test.yml
================================================
name: Perform linting and run tests
permissions:
contents: read
on:
push:
branches:
- master
- dev
pull_request:
branches:
- master
- dev
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v6
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v6
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Lint with ruff
run: ruff check
- name: Lint with mypy
run: mypy
- name: Build the package
run: python -m build
- name: Install the built wheel
shell: bash
run: |
# Use the wheel to prevent broken releases, instead of the editable install
pip uninstall -y yadisk
pip install dist/yadisk-*.whl
- name: Run pre-recored tests
shell: bash
env:
PYTHON_YADISK_APP_ID: ${{ vars.PYTHON_YADISK_APP_ID }}
PYTHON_YADISK_APP_SECRET: ${{ secrets.PYTHON_YADISK_APP_SECRET }}
PYTHON_YADISK_APP_TOKEN: ${{ secrets.PYTHON_YADISK_APP_TOKEN }}
PYTHON_YADISK_TEST_ROOT: ${{ vars.PYTHON_YADISK_TEST_ROOT }}
PYTHON_YADISK_GATEWAY_HOST: ${{ vars.PYTHON_YADISK_GATEWAY_HOST }}
PYTHON_YADISK_GATEWAY_PORT: ${{ vars.PYTHON_YADISK_GATEWAY_PORT }}
PYTHON_YADISK_REPLAY_ENABLED: 1
run: |
if [[ "${{ matrix.os }}" == "windows-latest" ]]; then
# running with --cov fails on Windows in CI
pytest -v --log-cli-level=WARNING tests
else
source_path=$(python -c 'import importlib.util, os; print(os.path.dirname(importlib.util.find_spec("yadisk").origin))')
pytest --cov="$source_path" -v --log-cli-level=WARNING tests
fi
- name: Upload coverage
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
shell: bash
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]] && [[ "${{ matrix.python-version }}" == "3.14" ]]; then
pip install coveralls
coveralls
fi
================================================
FILE: .gitignore
================================================
.*.sw[a-z]
*.py[co]
dist/
build/
yadisk.egg-info/
docs/_build
.venv/
pyrightconfig.json
.vim/
.coverage
.tool-versions
*.mo
================================================
FILE: .readthedocs.yaml
================================================
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.11"
apt_packages:
- libssl-dev
- libcurl4-openssl-dev
- python3-dev
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/conf.py
# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: docs/requirements.txt
================================================
FILE: CONTRIBUTING.rst
================================================
Contributing
============
.. contents:: Table of contents:
Bug reports, feedback, questions, feature requests, etc.
********************************************************
If you've found a bug, have some questions, a feature request, or some other
form of feedback, feel free to `open an issue
<https://github.com/ivknv/yadisk/issues>`_, use the appropriate template.
Issues are accepted in 2 languages: English or Russian, whichever is more
comfortable.
Pull requests
*************
Pull requests are also welcome, however, be prepared to have your PR rejected,
since some changes might not be appropriate for this project.
If you would like to contribute a PR, keep the following in mind:
#. This is a general-purpose API client library meant for developers, not an end-user
tool
#. The main goal of this library is to provide simple, convenient and reliable
access to the Yandex.Disk's REST API, mostly mirroring it
#. Reliability and correctness are valued above API convenience
#. Some changes may seem useful but may also end up inadvertently creating edge
cases, making the feature unreliable or complicated to use safely. See if
that's the case for your PR.
#. Tests are appreciated but not necessary for the initial PR, they can be
added later by this repository's maintainer
#. There is quite a lot of code duplication, mostly due to implementation of both
sync/async interfaces, beware of that
If you're unsure if your PR can make it into the repository, consider opening
an issue instead.
Here are some PR examples that are likely to be merged:
* Bug fixes
* New/enhanced tests (that cover something that isn't adequately tested at the moment)
* Documentation (e.g, added examples, corrections, additional REST API insight)
* Support for an HTTP library (see Sessions and Session Interface in the documentation)
Pull request workflow
---------------------
The pull request workflow looks as follows:
#. Fork the repository
#. Create a new branch with a unique name, specific to your PR, use the :code:`dev`
branch as the starting point
#. Run linting tools
#. Run tests
#. If everything is good, commit changes
#. Push to your forked repository
#. Submit a pull request, set :code:`dev` as the destination branch
Branch structure
****************
The :code:`master` branch is used for stable releases, while the :code:`dev`
branch is used for work in progress. All changes have to go through the
:code:`dev` branch before being merged into :code:`master`.
Setting up the development environment
**************************************
Assuming you already have the appropriate Python version installed, first,
setup the virtualenv:
.. code:: bash
# Optional: use .venv/$PYTHON_VERSION to manage venvs for multiple Python versions
python3 -m venv .venv
After setting up the virtualenv you can activate it and install all the
development dependencies and tools:
.. code:: bash
# Enter the created virtual environment
source .venv/bin/activate
# Now install development dependencies and tools, including the tools needed
# to build the documentation
pip install -r requirements-dev.txt
Linting
*******
Before committing changes run linting tools and fix reported errors:
.. code:: bash
ruff check
mypy
Both :code:`ruff` and :code:`mypy` are configured in :code:`pyproject.toml`.
Testing
*******
Traffic recording / traffic replay
----------------------------------
Testing the API client has several challenges:
* Sometimes the servers may be unavailable or simply malfunction
* Sending requests takes a very long time
* It is possible to hit a quota for certain functions in the process
* Have to use a real user account
* Cloud storage is persistent, so it has to be repeatedly cleaned up
* There is a risk of data loss due to bugs or misconfiguration
This makes it unsuitable for continuous integration. However, we can record
real traffic and then replay it in tests to solve all of the above problems at
once. An **API gateway** is used for this purpose. It's a simple HTTP server
(see :code:`tests/disk_gateway.py`), that can either **relay** all the requests
to the actual Yandex.Disk servers while **recording** them to a JSON file, or
**replay** them from a recorded JSON file without actually sending them
anywhere. Of course, it is still necessary to occasionally re-record them,
since the actual API behavior may change over time.
Configuration
-------------
In order to run most tests you need to configure a set of environment variables:
.. code:: bash
export PYTHON_YADISK_APP_ID='<your test application ID>'
export PYTHON_YADISK_APP_SECRET='<your test application secret>'
export PYTHON_YADISK_APP_TOKEN='<currently valid access token for your test application>'
export PYTHON_YADISK_TEST_ROOT='<path to the directory where all tests will be contained>'
export PYTHON_YADISK_REPLAY_ENABLED='<0 or 1 (default), 0 disables traffic replay, 1 enables it>'
export PYTHON_YADISK_RECORDING_ENABLED='<0 (default) or 1, 1 enables traffic recording, 0 disables it>'
export PYTHON_YADISK_GATEWAY_HOST='<127.0.0.1 by default, host for the test API gateway>'
export PYTHON_YADISK_GATEWAY_PORT='<8080 by default, port for the test API gateway>'
.. note::
Be very careful with the location of :code:`PYTHON_YADISK_TEST_ROOT`.
Specifing the wrong directory may lead to **permanent loss of data in
that folder**.
.. note::
:code:`PYTHON_YADISK_APP_ID` and :code:`PYTHON_YADISK_APP_SECRET` are only
used in some authentication/authorization tests (see
:code:`tests/test_auth.py`), during replays they **do not have to be
valid**, they only need to be valid at the time of recording of these tests
(although they still **have to match**). In fact, if you ever find yourself
recording tests that use :code:`PYTHON_YADISK_APP_SECRET`, make sure to
**generate a new application secret** afterwards.
Replaying tests
---------------
Testing is done with :code:`pytest`.
To only **replay**, set :code:`PYTHON_YADISK_RECORDING_ENABLED=0` and
:code:`PYTHON_YADISK_REPLAY_ENABLED=1` (this is the default behavior):
.. code:: bash
pytest -vx tests
# or the same thing more explicitly
PYTHON_YADISK_RECORDING_ENABLED=0 PYTHON_YADISK_REPLAY_ENABLED=1 pytest -vx tests
.. note::
Running tests in replay mode will only work if :code:`PYTHON_YADISK_APP_ID`,
:code:`PYTHON_YADISK_APP_SECRET` and :code:`PYTHON_YADISK_TEST_ROOT` all
match with those at the time of recording. :code:`PYTHON_YADISK_APP_TOKEN`
is not stored anywhere and doesn't need to be valid nor match the value at
the time of recording.
Environment variables, necessary for running replays of the recorded tests
are provided in the :code:`tests/.env` file. Note that the secret in that file
is not actually valid.
Recording tests
---------------
To **record** tests, set :code:`PYTHON_YADISK_RECORDING_ENABLED=1` and
:code:`PYTHON_YADISK_REPLAY_ENABLED=0`:
.. code:: bash
PYTHON_YADISK_RECORDING_ENABLED=1 PYTHON_YADISK_REPLAY_ENABLED=0 pytest -vx tests
The recorded JSON files are stored in :code:`tests/recorded/{sync,async}`.
.. note::
Recorded JSON files may contain **personal information**, such as your name
and other account information (see :code:`test_get_disk_info()`), as well as
some information about your files (see :code:`test_get_last_uploaded()`,
:code:`test_get_public_resources()`, :code:`test_get_files()`). Inspect
the files after recording them. Content of requests and responses is compressed
with zlib and encoded with Base64 (see :code:`tests/disk_gateway.py`)
Running tests without either recording or replaying
---------------------------------------------------
It is also possible to run tests without recording or replay:
.. code:: bash
PYTHON_YADISK_RECORDING_ENABLED=0 PYTHON_YADISK_REPLAY_ENABLED=0 pytest -vx tests
Documentation
*************
.. _Read the Docs (en): https://yadisk.readthedocs.io/en/latest/
.. _Read the Docs (ru): https://yadisk.readthedocs.io/ru/latest/
All documentation is written in English and then additionally localized to Russian.
Documentation is built with :code:`sphinx` and reSructuredText (:code:`.rst` files).
It is published at `Read the Docs (en)`_ and `Read the Docs (ru)`_
Building documentation
----------------------
To build the documentation in HTML
format, go the :code:`docs/` directory and run the following command:
.. code:: bash
make html
This will build the documentation in English. The resulting files can be found
in the :code:`docs/_build/html` directory.
To build documentation in Russian, run the following command:
.. code:: bash
make -e SPHINXOPTS='-D language=ru' html
Translation
-----------
.. _Sphinx/Internationalization: https://www.sphinx-doc.org/en/master/usage/advanced/intl.html
The translation workflow looks something like this:
#. Extract translatable messages with
:code:`make gettext`
#. Generate :code:`.po` files with :code:`sphinx-intl update -p _build/gettext -l ru`
(can be found in :code:`locales/ru/LC_MESSAGES`)
#. Translate :code:`.po` files
#. Build translated documentation with :code:`make -e SPHINXOPTS='-D language=ru' html`
See `Sphinx/Internationalization`_ for more instructions.
Building the package
********************
To build the wheel (:code:`.whl` file) and the source archive, use the following
command:
.. code:: bash
python -m build
Afterwards you should have the built wheel and source archive in the :code:`dist/`
directory.
New release workflow
**********************
.. _Read the Docs (dev, en): https://yadisk.readthedocs.io/en/dev/
.. _Read the Docs (dev, ru): https://yadisk.readthedocs.io/ru/dev/
This is the general workflow for publishing a new release:
#. Commit changes to the :code:`dev` branch
#. Update documentation
#. Run tests and linting
#. Update translations
#. Push changes
#. Run tests and linting with Github Actions, ensure there are no errors
#. Check that the documentation is not broken at `Read the Docs (dev, en)`_ and `Read the Docs (dev, ru)`_
#. Bump version number in several files (follow semantic versioning):
#. :code:`__version__` in :code:`src/yadisk/__init__.py`
#. :code:`version` in :code:`docs/conf.py`
#. Write the release notes and translate them, put them in the following files:
#. :code:`docs/changelog.rst`
#. :code:`README.rst`
#. :code:`README.en.rst`
#. :code:`README.ru.rst`
#. Push the changes
#. Run tests and linting with Github Actions, ensure there are no errors
#. Check that the documentation is not broken at `Read the Docs (dev, en)`_ and `Read the Docs (dev, ru)`_
#. Create a PR and merge changes to :code:`master`
#. Build the package (wheel and source archive)
#. Upload the built package to PyPI
#. Add a new release on Github
================================================
FILE: CONTRIBUTORS.rst
================================================
Contributors
============
- Ivan Konovalov (`@ivknv <https://github.com/ivknv>`_) (author, maintainer)
- Yuri Kobets (`@tordex <https://github.com/tordex>`_)
- Vladislav (`@Omnivanitate <https://github.com/Omnivanitate>`_)
- `@unix3dgforce <https://github.com/unix3dgforce>`_
- Nikita Kolesov (`@NikitaKolesov <https://github.com/NikitaKolesov>`_)
- Katant Savelev (`@KatantDev <https://github.com/KatantDev>`_)
================================================
FILE: COPYING
================================================
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
================================================
FILE: COPYING.lesser
================================================
GNU LESSER GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
This version of the GNU Lesser General Public License incorporates
the terms and conditions of version 3 of the GNU General Public
License, supplemented by the additional permissions listed below.
0. Additional Definitions.
As used herein, "this License" refers to version 3 of the GNU Lesser
General Public License, and the "GNU GPL" refers to version 3 of the GNU
General Public License.
"The Library" refers to a covered work governed by this License,
other than an Application or a Combined Work as defined below.
An "Application" is any work that makes use of an interface provided
by the Library, but which is not otherwise based on the Library.
Defining a subclass of a class defined by the Library is deemed a mode
of using an interface provided by the Library.
A "Combined Work" is a work produced by combining or linking an
Application with the Library. The particular version of the Library
with which the Combined Work was made is also called the "Linked
Version".
The "Minimal Corresponding Source" for a Combined Work means the
Corresponding Source for the Combined Work, excluding any source code
for portions of the Combined Work that, considered in isolation, are
based on the Application, and not on the Linked Version.
The "Corresponding Application Code" for a Combined Work means the
object code and/or source code for the Application, including any data
and utility programs needed for reproducing the Combined Work from the
Application, but excluding the System Libraries of the Combined Work.
1. Exception to Section 3 of the GNU GPL.
You may convey a covered work under sections 3 and 4 of this License
without being bound by section 3 of the GNU GPL.
2. Conveying Modified Versions.
If you modify a copy of the Library, and, in your modifications, a
facility refers to a function or data to be supplied by an Application
that uses the facility (other than as an argument passed when the
facility is invoked), then you may convey a copy of the modified
version:
a) under this License, provided that you make a good faith effort to
ensure that, in the event an Application does not supply the
function or data, the facility still operates, and performs
whatever part of its purpose remains meaningful, or
b) under the GNU GPL, with none of the additional permissions of
this License applicable to that copy.
3. Object Code Incorporating Material from Library Header Files.
The object code form of an Application may incorporate material from
a header file that is part of the Library. You may convey such object
code under terms of your choice, provided that, if the incorporated
material is not limited to numerical parameters, data structure
layouts and accessors, or small macros, inline functions and templates
(ten or fewer lines in length), you do both of the following:
a) Give prominent notice with each copy of the object code that the
Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the object code with a copy of the GNU GPL and this license
document.
4. Combined Works.
You may convey a Combined Work under terms of your choice that,
taken together, effectively do not restrict modification of the
portions of the Library contained in the Combined Work and reverse
engineering for debugging such modifications, if you also do each of
the following:
a) Give prominent notice with each copy of the Combined Work that
the Library is used in it and that the Library and its use are
covered by this License.
b) Accompany the Combined Work with a copy of the GNU GPL and this license
document.
c) For a Combined Work that displays copyright notices during
execution, include the copyright notice for the Library among
these notices, as well as a reference directing the user to the
copies of the GNU GPL and this license document.
d) Do one of the following:
0) Convey the Minimal Corresponding Source under the terms of this
License, and the Corresponding Application Code in a form
suitable for, and under terms that permit, the user to
recombine or relink the Application with a modified version of
the Linked Version to produce a modified Combined Work, in the
manner specified by section 6 of the GNU GPL for conveying
Corresponding Source.
1) Use a suitable shared library mechanism for linking with the
Library. A suitable mechanism is one that (a) uses at run time
a copy of the Library already present on the user's computer
system, and (b) will operate properly with a modified version
of the Library that is interface-compatible with the Linked
Version.
e) Provide Installation Information, but only if you would otherwise
be required to provide such information under section 6 of the
GNU GPL, and only to the extent that such information is
necessary to install and execute a modified version of the
Combined Work produced by recombining or relinking the
Application with a modified version of the Linked Version. (If
you use option 4d0, the Installation Information must accompany
the Minimal Corresponding Source and Corresponding Application
Code. If you use option 4d1, you must provide the Installation
Information in the manner specified by section 6 of the GNU GPL
for conveying Corresponding Source.)
5. Combined Libraries.
You may place library facilities that are a work based on the
Library side by side in a single library together with other library
facilities that are not Applications and are not covered by this
License, and convey such a combined library under terms of your
choice, if you do both of the following:
a) Accompany the combined library with a copy of the same work based
on the Library, uncombined with any other library facilities,
conveyed under the terms of this License.
b) Give prominent notice with the combined library that part of it
is a work based on the Library, and explaining where to find the
accompanying uncombined form of the same work.
6. Revised Versions of the GNU Lesser General Public License.
The Free Software Foundation may publish revised and/or new versions
of the GNU Lesser General Public License from time to time. Such new
versions will be similar in spirit to the present version, but may
differ in detail to address new problems or concerns.
Each version is given a distinguishing version number. If the
Library as you received it specifies that a certain numbered version
of the GNU Lesser General Public License "or any later version"
applies to it, you have the option of following the terms and
conditions either of that published version or of any later version
published by the Free Software Foundation. If the Library as you
received it does not specify a version number of the GNU Lesser
General Public License, you may choose any version of the GNU Lesser
General Public License ever published by the Free Software Foundation.
If the Library as you received it specifies that a proxy can decide
whether future versions of the GNU Lesser General Public License shall
apply, that proxy's public statement of acceptance of any version is
permanent authorization for you to choose that version for the
Library.
================================================
FILE: MANIFEST.in
================================================
include COPYING
include COPYING.lesser
include CONTRIBUTORS.rst
include README.rst
include README.en.rst
include README.ru.rst
include src/yadisk/py.typed
================================================
FILE: README.en.rst
================================================
YaDisk
======
.. |RTD Badge| image:: https://img.shields.io/readthedocs/yadisk.svg
:alt: Read the Docs
:target: https://yadisk.readthedocs.io/en/latest/
.. |CI Badge| image:: https://img.shields.io/github/actions/workflow/status/ivknv/yadisk/lint_and_test.yml
:alt: GitHub Actions Workflow Status
.. |PyPI Badge| image:: https://img.shields.io/pypi/v/yadisk.svg
:alt: PyPI
:target: https://pypi.org/project/yadisk
.. |Python Version Badge| image:: https://img.shields.io/pypi/pyversions/yadisk
:alt: PyPI - Python Version
.. |Coverage Badge| image:: https://coveralls.io/repos/github/ivknv/yadisk/badge.svg?branch=master
:alt: Coverage
:target: https://coveralls.io/github/ivknv/yadisk
|RTD Badge| |CI Badge| |PyPI Badge| |Python Version Badge| |Coverage Badge|
YaDisk is a Yandex.Disk REST API client library.
.. _Read the Docs (EN): https://yadisk.readthedocs.io
.. _Read the Docs (RU): https://yadisk.readthedocs.io/ru/latest
Documentation is available at `Read the Docs (EN)`_ and `Read the Docs (RU)`_.
.. contents:: Table of contents:
Installation
************
:code:`yadisk` supports multiple HTTP client libraries and has both synchronous and
asynchronous API.
The following HTTP client libraries are currently supported:
* :code:`requests` (used by default for synchronous API)
* :code:`httpx` (both synchronous and asynchronous, used by default for asynchronous API)
* :code:`aiohttp` (asynchronous only)
* :code:`pycurl` (synchronous only)
For synchronous API (installs :code:`requests`):
.. code:: bash
pip install yadisk[sync-defaults]
For asynchronous API (installs :code:`aiofiles` and :code:`httpx`):
.. code:: bash
pip install yadisk[async-defaults]
Alternatively, you can manually choose which optional libraries to install:
.. code:: bash
# For use with pycurl
pip install yadisk[pycurl]
# For use with aiohttp, will also install aiofiles
pip install yadisk[async-files,aiofiles]
Examples
********
Synchronous API
---------------
.. code:: python
import yadisk
client = yadisk.Client(token="<token>")
# or
# client = yadisk.Client("<application-id>", "<application-secret>", "<token>")
# You can either use the with statement or manually call client.close() later
with client:
# Check if the token is valid
print(client.check_token())
# Get disk information
print(client.get_disk_info())
# Print files and directories at "/some/path"
print(list(client.listdir("/some/path")))
# Upload "file_to_upload.txt" to "/destination.txt"
client.upload("file_to_upload.txt", "/destination.txt")
# Same thing
with open("file_to_upload.txt", "rb") as f:
client.upload(f, "/destination.txt")
# Download "/some-file-to-download.txt" to "downloaded.txt"
client.download("/some-file-to-download.txt", "downloaded.txt")
# Permanently remove "/file-to-remove"
client.remove("/file-to-remove", permanently=True)
# Create a new directory at "/test-dir"
print(client.mkdir("/test-dir"))
Asynchronous API
----------------
.. code:: python
import yadisk
import aiofiles
client = yadisk.AsyncClient(token="<token>")
# or
# client = yadisk.AsyncClient("<application-id>", "<application-secret>", "<token>")
# You can either use the with statement or manually call client.close() later
async with client:
# Check if the token is valid
print(await client.check_token())
# Get disk information
print(await client.get_disk_info())
# Print files and directories at "/some/path"
print([i async for i in client.listdir("/some/path")])
# Upload "file_to_upload.txt" to "/destination.txt"
await client.upload("file_to_upload.txt", "/destination.txt")
# Same thing
async with aiofiles.open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# Same thing but with regular files
with open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# Download "/some-file-to-download.txt" to "downloaded.txt"
await client.download("/some-file-to-download.txt", "downloaded.txt")
# Same thing
async with aiofiles.open("downloaded.txt", "wb") as f:
await client.download("/some-file-to-download.txt", f)
# Permanently remove "/file-to-remove"
await client.remove("/file-to-remove", permanently=True)
# Create a new directory at "/test-dir"
print(await client.mkdir("/test-dir"))
Contributing
************
If you would like to contribute to this project, see
`CONTRIBUTING.rst <https://github.com/ivknv/yadisk/blob/master/CONTRIBUTING.rst>`_.
Changelog
*********
.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7
.. _issue #23: https://github.com/ivknv/yadisk/issues/23
.. _issue #26: https://github.com/ivknv/yadisk/issues/26
.. _issue #28: https://github.com/ivknv/yadisk/issues/28
.. _issue #29: https://github.com/ivknv/yadisk/issues/29
.. _PR #31: https://github.com/ivknv/yadisk/pull/31
.. _issue #43: https://github.com/ivknv/yadisk/issues/43
.. _issue #45: https://github.com/ivknv/yadisk/issues/45
.. _issue #49: https://github.com/ivknv/yadisk/issues/49
.. _issue #53: https://github.com/ivknv/yadisk/issues/53
.. _Introduction: https://yadisk.readthedocs.io/en/latest/intro.html
.. _API Reference: https://yadisk.readthedocs.io/en/latest/api_reference/index.html
.. _Available Session Implementations: https://yadisk.readthedocs.io/en/latest/api_reference/sessions.html
.. _Session Interface: https://yadisk.readthedocs.io/en/latest/api_reference/session_interface.html
.. _requests: https://pypi.org/project/requests
.. _Migration Guide: https://yadisk.readthedocs.io/en/latest/migration_guide.html
.. _PR #57: https://github.com/ivknv/yadisk/pull/57
.. _issue #62: https://github.com/ivknv/yadisk/issues/62
* **Release 3.4.1 (2026-04-16)**
* Bug fixes:
* Fixed a :code:`TypeError` when passing a file path to
:code:`AsyncClient.download()` or :code:`AsyncClient.upload()` while not
having :code:`aiofiles` installed (see `issue #62`_)
* Work around Yandex.Disk ignoring request body for :code:`Client.patch()` and
:code:`Client.update_public_settings()` when using :code:`pycurl` due to
setting :code:`Transfer-Encoding: chunked` by default
* **Release 3.4.0 (2025-07-10)**
* New features:
* Added methods for managing public settings of resources:
* :code:`Client.update_public_settings()`
* :code:`Client.get_public_settings()`
* :code:`Client.get_public_available_settings()`
Note, it appears that these API endpoints do not fully conform to the
official REST API documentation, their functionality is limited in
practice.
* Added new exception class :code:`PasswordRequiredError`
* Added several new fields for :code:`DiskInfoObject`:
* :code:`deletion_restricion_days`
* :code:`hide_screenshots_in_photoslice`
* :code:`is_legal_entity`
* Implemented the :code:`__dir__()` method for response objects
* Improvements:
* :code:`repr()` of API response objects now only shows the keys that are
actually present (instead of displaying them as :code:`None` like before)
* **Release 3.3.0 (2025-04-29)**
* New features:
* User-Agent spoofing to bypass Yandex.Disk's upload speed limit (see `PR #57`_).
:code:`Client.upload()` and related methods (including :code:`AsyncClient`)
have a new optional parameter :code:`spoof_user_agent`, which is set to
:code:`True` by default. This parameter can be used to disable User-Agent
spoofing if necessary.
* Added IPython's pretty printing support for :code:`YaDiskObject` and
derived classes
* Bug fixes:
* :code:`Client.wait_for_operation()` now uses :code:`time.monotonic()`
instead of :code:`time.time()`
* Improvements:
* REST API error messages are now clearly divided into four parts (message,
description, error code and HTTP status code)
* **Release 3.2.0 (2025-02-03)**
* New features:
* Added new method: :code:`Client.makedirs()` / :code:`AsyncClient.makedirs()`
(see `issue #53`_)
* Added several missing fields for :code:`DiskInfoObject`:
* :code:`photounlim_size`
* :code:`will_be_overdrawn`
* :code:`free_photounlim_end_date`
* :code:`payment_flow`
* Added missing field :code:`sizes` for :code:`ResourceObject` and related
objects
* Bug fixes:
* :code:`Client.rename()` / :code:`AsyncClient.rename()` now raises
:code:`ValueError` on attempt to rename the root directory
* Automatic retry attempt numbers were logged off by one, now they are
logged correctly
* **Release 3.1.0 (2024-07-12)**
* New features:
* Added new exception classes: :code:`GoneError` and
:code:`ResourceDownloadLimitExceededError`
* Added a new method: :code:`Client.get_all_public_resources()` and
:code:`AsyncClient.get_all_public_resources()`
* Bug fixes:
* Fixed setting :code:`headers` and session arguments to :code:`None` causing
errors
* Fixed incorrect handling of empty filename in :code:`Client.rename()` and
:code:`AsyncClient.rename()`
* Fixed several typos in async convenience method implementations
(:code:`listdir()` and related)
* Fixed :code:`PublicResourceListObject` having the wrong type for its
:code:`items` member
* Fixed API requests not working with :code:`PycURLSession` when
:code:`stream=True` is set
* No data will be written to the output file by :code:`Client.download()`,
:code:`Client.download_by_link()`, :code:`AsyncClient.download()` and
:code:`AsyncClient.download_by_link()` if the server returns a bad status
code
* **Release 3.0.1 (2024-07-09)**
* Fixed broken :code:`pyproject.toml` that did not include full package
contents (see `issue #49`_)
* **Release 3.0.0 (2024-07-09)**
* Breaking changes:
- See `Migration Guide`_ for full details
- All methods wait for asynchronous operations to complete by default
(see the new :code:`wait=<bool>` parameter)
- Iterating over the result of :code:`AsyncClient.listdir()` no longer
requires the additional await keyword.
- Number of returned items of :code:`Client.get_files()` /
:code:`AsyncClient.get_files()` is now controlled by the :code:`max_items`
parameter, rather than :code:`limit`
- Methods :code:`set_token()`, :code:`set_headers()` of :code:`Session` and
:code:`AsyncSession` were removed
- Some methods no longer accept the :code:`fields` parameter
- :code:`Client.get_last_uploaded()` / :code:`AsyncClient.get_last_uploaded()`
now return a list instead of a generator
- :code:`yadisk.api` is now a private module
- All private modules were renamed to have names that start with :code:`_`
(e.g, :code:`yadisk._api`)
* New features:
- Added methods to wait until an asynchronous operation completes
(see :code:`Client.wait_for_operation()` / :code:`AsyncClient.wait_for_operation()`)
- Methods that may start an asynchronous operation now accept additional
parameters: :code:`wait: bool = True`,
:code:`poll_interval: float = 1.0` and
:code:`poll_timeout: Optional[float] = None`
- :code:`Client.listdir()`, :code:`Client.get_files()` and their async
variants now accept a new parameter
:code:`max_items: Optional[int] = None`, which can be used to limit
the maximum number of returned items
- Most :code:`Client` and :code:`AsyncClient` methods now accept an optional
parameter :code:`retry_on: Optional[Tuple[Type[Exception], ...]] = None`,
which lets you specify a tuple of additional exceptions that can trigger
an automatic retry
- :code:`yadisk.types` module is now public
- Added basic logging of outgoing API requests and automatic retries
- The logger instance for the library can be accessed as
:code:`yadisk.settings.logger`
- Added :code:`YaDiskObject.field()` and the :code:`@` operator
(:code:`YaDiskObject.__matmul__()`) which verify that the given field is
not :code:`None`
- Added :code:`Client.get_upload_link_object()`,
:code:`AsyncClient.get_upload_link_object()` whose return values
additionally contain :code:`operation_id`
- :code:`utils.auto_retry()` now accepts more parameters
- Added a few missing fields for :code:`DiskInfoObject`
- :code:`EXIFObject` now contains GPS coordinates
- :code:`CaseInsensitiveDict` is now part of :code:`yadisk.utils`
* Improvements:
- Added full type hints for :code:`Client`, :code:`AsyncClient` through
:code:`.pyi` stub files
- Docstrings for :code:`Client` / :code:`AsyncClient` now include more
parameters
- Errors during JSON processing (e.g. :code:`InvalidResponseError`) also
trigger automatic retries
- Error message when the default session module is not available is now
less confusing (see `issue #43`_)
- Reduced :code:`Client.listdir()`'s default :code:`limit` to :code:`500`
from :code:`10000` to avoid timeouts on large directories (see `issue #45`_)
- Reduced :code:`Client.get_files()`'s default :code:`limit` to :code:`200`
from :code:`1000` to avoid timeouts
- :code:`Client.download()` and similar methods no longer set
:code:`Connection: close` header, since it's not necessary (unlike with
:code:`Client.upload()`)
- :code:`UnknownYaDiskError` now includes status code in the error message
* Bug fixes:
- Fixed :code:`httpx`- and :code:`aiohttp`-based session implementations
not converting their exceptions to :code:`RequestError` in their
:code:`Response.json()` / :code:`AsyncResponse.json()` implementations
- Fixed :code:`stream=True` not being set by default in
:code:`AsyncClient.download()`, :code:`AsyncClient.download_public()`
* Other changes:
- :code:`typing_extensions` is now required for Python < 3.10
* **Release 2.1.0 (2024-01-03)**
* Fixed a bug where POST request parameters were not encoded correctly
* Fixed a bug in :code:`PycURLSession.send_request()` that made it ignore passed headers
* :code:`RequestsSession.close()` now closes all underlying session
instances, instead of only the current thread-local one
* All methods of :code:`Client` and :code:`AsyncClient` now use existing session
* Removed :code:`session_factory` attribute and :code:`make_session()` method
of :code:`Client` and :code:`AsyncClient`
* Session class can now be specified as a string
* Added :code:`Client.get_device_code()`/:code:`AsyncClient.get_device_code()` methods
* Added :code:`Client.get_token_from_device_code()`/:code:`AsyncClient.get_token_from_device_code()` methods
* Added missing :code:`redirect_uri` parameter for :code:`Client.get_auth_url()`/:code:`AsyncClient.get_auth_url()`
and :code:`Client.get_code_url()`/:code:`AsyncClient.get_code_url()`
* Added support for PKCE parameters for :code:`Client.get_auth_url()`/:code:`AsyncClient.get_auth_url()`,
:code:`Client.get_code_url()`/:code:`AsyncClient.get_code_url()` and
:code:`Client.get_token()`/:code:`AsyncClient.get_token()`
* Added :code:`scope` attribute for :code:`TokenObject`
* Added new exception classes: :code:`InvalidClientError`, :code:`InvalidGrantError`,
:code:`AuthorizationPendingError`, :code:`BadVerificationCodeError` and
:code:`UnsupportedTokenTypeError`
* **Release 2.0.0 (2023-12-12)**
* The library now provides both synchronous and asynchronous APIs (see
`Introduction`_ and `API Reference`_)
* Multiple HTTP libraries are supported by default (see
`Available Session Implementations`_ for the full list)
* It is now possible to add support for any HTTP library (see
`Session Interface`_)
* `requests`_ is now an optional dependency (although it's still used by
default for synchronous API)
* Note that now requests-specific arguments must be passed differently
(see `Available Session Implementations`_)
* Preferred HTTP client libraries must be explicitly installed now
(see `Introduction`_)
* :code:`Client.upload()` and :code:`Client.upload_by_link()` can now accept
a function that returns an iterator (or a generator) as a payload
* **Release 1.3.4 (2023-10-15)**
* :code:`upload()` and :code:`download()` (and related) methods can now
upload/download non-seekable file-like objects (e.g. :code:`stdin` or :code:`stdout`
when open in binary mode), see `PR #31`_
* **Release 1.3.3 (2023-04-22)**
* :code:`app:/` paths now work correctly (see `issue #26`_)
* **Release 1.3.2 (2023-03-20)**
* Fixed `issue #29`_: TypeError: 'type' object is not subscriptable
* **Release 1.3.1 (2023-02-28)**
* Fixed `issue #28`_: calling :code:`download_public()` with :code:`path` keyword argument raises :code:`TypeError`
* Fixed :code:`AttributeError` raised when calling :code:`ResourceLinkObject.public_listdir()`
* **Release 1.3.0 (2023-01-30)**
* Added convenience methods to :code:`...Object` objects (e.g. see :code:`ResourceObject` in docs)
* Added type hints
* Improved error checking and response validation
* Added :code:`InvalidResponseError`, :code:`PayloadTooLargeError`, :code:`UploadTrafficLimitExceededError`
* Added a few missing fields to :code:`DiskInfoObject` and :code:`SystemFoldersObject`
* Added :code:`rename()`, :code:`upload_by_link()` and :code:`download_by_link()` methods
* Added :code:`default_args` field for :code:`YaDisk` object
* :code:`download()` and :code:`upload()` now return :code:`ResourceLinkObject`
* Returned :code:`LinkObject` instances have been replaced by more specific subclasses
* :code:`ConnectionError` now also triggers a retry
* **Release 1.2.19 (2023-01-20)**
* Fixed incorrect behavior of the fix from 1.2.18 for paths :code:`disk:`
and :code:`trash:` (only these two).
* **Release 1.2.18 (2023-01-20)**
* Fixed `issue #26`_: ':' character in filenames causes :code:`BadRequestError`.
This is due the behavior of Yandex.Disk's REST API itself but is avoided
on the library level with this fix.
* **Release 1.2.17 (2022-12-11)**
* Fixed a minor bug which could cause a :code:`ReferenceError`
(which would not cause a crash, but still show an error message). The bug
involved using :code:`__del__()` method in :code:`SelfDestructingSession`
to automatically close the sessions it seems to affect primarily old Python
versions (such as 3.4).
* **Release 1.2.16 (2022-08-17)**
* Fixed a bug in :code:`check_token()`: could throw :code:`ForbiddenError` if
the application lacks necessary permissions (`issue #23`_).
* **Release 1.2.15 (2021-12-31)**
* Fixed an issue where :code:`http://` links were not recognized as operation links
(they were assumed to always be :code:`https://`, since all the other
requests are always HTTPS).
Occasionally, Yandex.Disk can for some reason return an :code:`http://` link
to an asynchronous operation instead of :code:`https://`.
Both links are now recognized correctly and an :code:`https://` version will
always be used by :code:`get_operation_status()`, regardless of which one
Yandex.Disk returned.
* **Release 1.2.14 (2019-03-26)**
* Fixed a :code:`TypeError` in :code:`get_public_*` functions when passing :code:`path` parameter
(see `issue #7`_)
* Added :code:`unlimited_autoupload_enabled` attribute for :code:`DiskInfoObject`
* **Release 1.2.13 (2019-02-23)**
* Added :code:`md5` parameter for :code:`remove()`
* Added :code:`UserPublicInfoObject`
* Added :code:`country` attribute for :code:`UserObject`
* Added :code:`photoslice_time` attribute for :code:`ResourceObject`, :code:`PublicResourceObject`
and :code:`TrashResourceObject`
* **Release 1.2.13 (2019-02-23)**
* Added :code:`md5` parameter for :code:`remove()`
* Added :code:`UserPublicInfoObject`
* Added :code:`country` attribute for :code:`UserObject`
* Added :code:`photoslice_time` attribute for :code:`ResourceObject`, :code:`PublicResourceObject`
and :code:`TrashResourceObject`
* **Release 1.2.12 (2018-10-11)**
* Fixed `fields` parameter not working properly in `listdir()` (`issue #4`_)
* **Release 1.2.11 (2018-06-30)**
* Added the missing parameter :code:`sort` for :code:`get_meta()`
* Added :code:`file` and :code:`antivirus_status` attributes for :code:`ResourceObject`,
:code:`PublicResourceObject` and :code:`TrashResourceObject`
* Added :code:`headers` parameter
* Fixed a typo in :code:`download()` and :code:`download_public()` (`issue #2`_)
* Removed :code:`*args` parameter everywhere
* **Release 1.2.10 (2018-06-14)**
* Fixed :code:`timeout=None` behavior. :code:`None` is supposed to mean 'no timeout' but
in the older versions it was synonymous with the default timeout.
* **Release 1.2.9 (2018-04-28)**
* Changed the license to LGPLv3 (see :code:`COPYING` and :code:`COPYING.lesser`)
* Other package info updates
* **Release 1.2.8 (2018-04-17)**
* Fixed a couple of typos: :code:`PublicResourceListObject.items` and
:code:`TrashResourceListObject.items` had wrong types
* Substitute field aliases in :code:`fields` parameter when performing
API requests (e.g. :code:`embedded` -> :code:`_embedded`)
* **Release 1.2.7 (2018-04-15)**
* Fixed a file rewinding bug when uploading/downloading files after a retry
* **Release 1.2.6 (2018-04-13)**
* Now caching :code:`requests` sessions so that open connections
can be reused (which can significantly speed things up sometimes)
* Disable :code:`keep-alive` when uploading/downloading files by default
* **Release 1.2.5 (2018-03-31)**
* Fixed an off-by-one bug in :code:`utils.auto_retry()`
(which could sometimes result in :code:`AttributeError`)
* Retry the whole request for :code:`upload()`, :code:`download()` and :code:`download_public()`
* Set :code:`stream=True` for :code:`download()` and :code:`download_public()`
* Other minor fixes
* **Release 1.2.4 (2018-02-19)**
* Fixed :code:`TokenObject` having :code:`exprires_in` instead of :code:`expires_in` (fixed a typo)
* **Release 1.2.3 (2018-01-20)**
* Fixed a :code:`TypeError` when :code:`WrongResourceTypeError` is raised
* **Release 1.2.2 (2018-01-19)**
* :code:`refresh_token()` no longer requires a valid or empty token.
* **Release 1.2.1 (2018-01-14)**
* Fixed auto retries not working. Whoops.
* **Release 1.2.0 (2018-01-14)**
* Fixed passing :code:`n_retries=0` to :code:`upload()`,
:code:`download()` and :code:`download_public()`
* :code:`upload()`, :code:`download()` and :code:`download_public()`
no longer return anything (see the docs)
* Added :code:`utils` module (see the docs)
* Added :code:`RetriableYaDiskError`, :code:`WrongResourceTypeError`,
:code:`BadGatewayError` and :code:`GatewayTimeoutError`
* :code:`listdir()` now raises :code:`WrongResourceTypeError`
instead of :code:`NotADirectoryError`
* **Release 1.1.1 (2017-12-29)**
* Fixed argument handling in :code:`upload()`, :code:`download()` and :code:`download_public()`.
Previously, passing :code:`n_retries` and :code:`retry_interval` would raise an exception (:code:`TypeError`).
* **Release 1.1.0 (2017-12-27)**
* Better exceptions (see the docs)
* Added support for :code:`force_async` parameter
* Minor bug fixes
* **Release 1.0.8 (2017-11-29)**
* Fixed yet another :code:`listdir()` bug
* **Release 1.0.7 (2017-11-04)**
* Added :code:`install_requires` argument to :code:`setup.py`
* **Release 1.0.6 (2017-11-04)**
* Return :code:`OperationLinkObject` in some functions
* **Release 1.0.5 (2017-10-29)**
* Fixed :code:`setup.py` to exclude tests
* **Release 1.0.4 (2017-10-23)**
* Fixed bugs in :code:`upload`, :code:`download` and :code:`listdir` functions
* Set default :code:`listdir` :code:`limit` to :code:`10000`
* **Release 1.0.3 (2017-10-22)**
* Added settings
* **Release 1.0.2 (2017-10-19)**
* Fixed :code:`get_code_url` function (added missing parameters)
* **Release 1.0.1 (2017-10-18)**
* Fixed a major bug in :code:`GetTokenRequest` (added missing parameter)
* **Release 1.0.0 (2017-10-18)**
* Initial release
================================================
FILE: README.rst
================================================
YaDisk
======
.. |RTD Badge| image:: https://img.shields.io/readthedocs/yadisk.svg
:alt: Read the Docs
:target: https://yadisk.readthedocs.io/ru/latest/
.. |CI Badge| image:: https://img.shields.io/github/actions/workflow/status/ivknv/yadisk/lint_and_test.yml
:alt: GitHub Actions Workflow Status
.. |PyPI Badge| image:: https://img.shields.io/pypi/v/yadisk.svg
:alt: PyPI
:target: https://pypi.org/project/yadisk
.. |Python Version Badge| image:: https://img.shields.io/pypi/pyversions/yadisk
:alt: PyPI - Python Version
.. |Coverage Badge| image:: https://coveralls.io/repos/github/ivknv/yadisk/badge.svg?branch=master
:alt: Coverage
:target: https://coveralls.io/github/ivknv/yadisk
|RTD Badge| |CI Badge| |PyPI Badge| |Python Version Badge| |Coverage Badge|
.. _English version of this document: https://github.com/ivknv/yadisk/blob/master/README.en.rst
`English version of this document`_
YaDisk - это библиотека-клиент REST API Яндекс.Диска.
.. _Read the Docs (EN): https://yadisk.readthedocs.io
.. _Read the Docs (RU): https://yadisk.readthedocs.io/ru/latest
Документация доступна на `Read the Docs (RU)`_ и `Read the Docs (EN)`_.
.. contents:: Содержание:
Установка
*********
:code:`yadisk` поддерживает несколько HTTP библиотек и реализует одновременно как синхронный,
так и асинхронный API.
На данный момент поддерживаются следующие HTTP библиотеки:
* :code:`requests` (используется по умолчанию для синхронного API)
* :code:`httpx` (синхронный и асинхронный API, используется по умолчанию для асинхронного API)
* :code:`aiohttp` (асинхронный API)
* :code:`pycurl` (синхронный API)
Для синхронного API (устанавливает :code:`requests`):
.. code:: bash
pip install yadisk[sync-defaults]
Для асинхронного API (устанавливает :code:`httpx` и :code:`aiofiles`):
.. code:: bash
pip install yadisk[async-defaults]
Вы можете также вручную установить нужные библиотеки:
.. code:: bash
# Для использования совместно с pycurl
pip install yadisk[pycurl]
# Для использования совместно с aiohttp, также установит aiofiles
pip install yadisk[async-files,aiohttp]
Примеры
*******
Синхронный API
--------------
.. code:: python
import yadisk
client = yadisk.Client(token="<токен>")
# или
# client = yadisk.Client("<id-приложения>", "<secret-приложения>", "<токен>")
# Вы можете использовать либо конструкцию with, либо вручную вызвать client.close() в конце
with client:
# Проверяет, валиден ли токен
print(client.check_token())
# Получает общую информацию о диске
print(client.get_disk_info())
# Выводит содержимое "/some/path"
print(list(client.listdir("/some/path")))
# Загружает "file_to_upload.txt" в "/destination.txt"
client.upload("file_to_upload.txt", "/destination.txt")
# То же самое
with open("file_to_upload.txt", "rb") as f:
client.upload(f, "/destination.txt")
# Скачивает "/some-file-to-download.txt" в "downloaded.txt"
client.download("/some-file-to-download.txt", "downloaded.txt")
# Безвозвратно удаляет "/file-to-remove"
client.remove("/file-to-remove", permanently=True)
# Создаёт новую папку "/test-dir"
print(client.mkdir("/test-dir"))
Асинхронный API
---------------
.. code:: python
import yadisk
import aiofiles
client = yadisk.AsyncClient(token="<token>")
# или
# client = yadisk.AsyncClient("<application-id>", "<application-secret>", "<token>")
# Вы можете использовать либо конструкцию with, либо вручную вызвать client.close() в конце
async with client:
# Проверяет, валиден ли токен
print(await client.check_token())
# Получает общую информацию о диске
print(await client.get_disk_info())
# Выводит содержимое "/some/path"
print([i async for i in client.listdir("/some/path")])
# Загружает "file_to_upload.txt" в "/destination.txt"
await client.upload("file_to_upload.txt", "/destination.txt")
# То же самое
async with aiofiles.open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# То же самое, но с обычными файлами
with open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# Скачивает "/some-file-to-download.txt" в "downloaded.txt"
await client.download("/some-file-to-download.txt", "downloaded.txt")
# То же самое
async with aiofiles.open("downloaded.txt", "wb") as f:
await client.download("/some-file-to-download.txt", f)
# Безвозвратно удаляет "/file-to-remove"
await client.remove("/file-to-remove", permanently=True)
# Создаёт новую папку "/test-dir"
print(await client.mkdir("/test-dir"))
Участие в разработке
********************
Если вы хотите поучаствовать в разработке, см.
`CONTRIBUTING.rst <https://github.com/ivknv/yadisk/blob/master/CONTRIBUTING.rst>`_.
История изменений
*****************
.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7
.. _issue #23: https://github.com/ivknv/yadisk/issues/23
.. _issue #26: https://github.com/ivknv/yadisk/issues/26
.. _issue #28: https://github.com/ivknv/yadisk/issues/28
.. _issue #29: https://github.com/ivknv/yadisk/issues/29
.. _PR #31: https://github.com/ivknv/yadisk/pull/31
.. _issue #43: https://github.com/ivknv/yadisk/issues/43
.. _issue #45: https://github.com/ivknv/yadisk/issues/45
.. _issue #49: https://github.com/ivknv/yadisk/issues/49
.. _issue #53: https://github.com/ivknv/yadisk/issues/53
.. _Введение: https://yadisk.readthedocs.io/ru/latest/intro.html
.. _Справочник API: https://yadisk.readthedocs.io/ru/latest/api_reference/index.html
.. _Доступные реализации сессий: https://yadisk.readthedocs.io/ru/latest/api_reference/sessions.html
.. _Интерфейс Session: https://yadisk.readthedocs.io/ru/latest/api_reference/session_interface.html
.. _requests: https://pypi.org/project/requests
.. _Руководство по миграции: https://yadisk.readthedocs.io/ru/latest/migration_guide.html
.. _PR #57: https://github.com/ivknv/yadisk/pull/57
.. _issue #62: https://github.com/ivknv/yadisk/issues/62
* **Release 3.4.1 (2026-04-16)**
* Исправления:
* Исправлена ошибка :code:`TypeError` при передаче пути к файлу в
:code:`AsyncClient.download()` или :code:`AsyncClient.upload()` без
установленного :code:`aiofiles` (см. `issue #62`_)
* Обход проблемы, когда Яндекс.Диск игнорирует тело запроса для
:code:`Client.patch()` и :code:`Client.update_public_settings()` при
использовании :code:`pycurl` из-за задания заголовка :code:`Transfer-Encoding: chunked`
по умолчанию
* **Release 3.4.0 (2025-07-10)**
* Нововведения:
* Добавлены методы для управления настройками публичного доступа к ресурсам:
* :code:`Client.update_public_settings()`
* :code:`Client.get_public_settings()`
* :code:`Client.get_public_available_settings()`
Внимание: похоже, что эти эндпоинты не полностью соответствуют
официальной документации REST API, их функциональность на практике
ограничена.
* Добавлен новый класс исключений :code:`PasswordRequiredError`
* Добавлено несколько новых полей :code:`DiskInfoObject`:
* :code:`deletion_restricion_days`
* :code:`hide_screenshots_in_photoslice`
* :code:`is_legal_entity`
* Реализован метод :code:`__dir__()` для объектов ответов сервера
* Улучшения:
* :code:`repr()` объектов ответов API теперь показывает только те ключи,
которые фактически присутствуют (вместо отображения их значений как
:code:`None`, как раньше)
* **Release 3.3.0 (2025-04-29)**
* Нововведения:
* Спуфинг User-Agent для обхода ограничения скорости загрузки файлов на
Диск (см. `PR #57`_). :code:`Client.upload()` и связанные с ним методы
(включая :code:`AsyncClient`) имеют новый опциональный параметр
:code:`spoof_user_agent`, который по умолчанию имеет значение
:code:`True`. Этот параметр можно использовать для отключения спуфинга,
если это необходимо.
* Добавлена поддержка pretty-printing в IPython для :code:`YaDiskObject` и
производных классов
* Исправления:
* :code:`Client.wait_for_operation()` теперь использует
:code:`time.monotonic()` вместо :code:`time.time()`
* Улучшения:
* Сообщения об ошибках REST API теперь чётко разделены на четыре части
(сообщение, описание, код ошибки и код состояния HTTP)
* **Release 3.2.0 (2025-02-03)**
* Нововведения:
* Добавлен новый метод: :code:`Client.makedirs()` и
:code:`AsyncClient.makedirs()` (см. `issue #53`_)
* Добавлено несколько недостающих полей :code:`DiskInfoObject`
* :code:`photounlim_size`
* :code:`will_be_overdrawn`
* :code:`free_photounlim_end_date`
* :code:`payment_flow`
* Добавлено недостающее поле :code:`sizes` для :code:`ResourceObject` и
связанных с ним объектов
* Исправления:
* :code:`Client.rename()` / :code:`AsyncClient.rename()` теперь вызывает
:code:`ValueError` при попытке переименовать корневую папку
* Номера автоматических повторных попыток логировались с ошибкой на
единицу, теперь они логируются правильно
* **Release 3.1.0 (2024-07-12)**
* Нововведения:
* Добавлены новые исключения: :code:`GoneError` и
:code:`ResourceDownloadLimitExceededError`
* Добавлен новый метод: :code:`Client.get_all_public_resources()` и
:code:`AsyncClient.get_all_public_resources()`
* Исправления:
* Задание :code:`headers` и других опциональных параметров сессии как
:code:`None` больше не вызывает ошибок
* Исправлено неправильное поведение :code:`Client.rename()` и
:code:`AsyncClient.rename()` при указании пустого имени файла
* Исправлено несколько опечаток в асинхронных реализациях
convenience-методов (:code:`listdir()` и аналогичных)
* Исправлен неправильный тип данных у атрибута :code:`items` класса
:code:`PublicResourceListObject`
* Исправлены ошибки при отправке запросов API с помощью
:code:`PycURLSession` при задании :code:`stream=True`
* Данные не будут записаны в файл методами :code:`Client.download()`,
:code:`Client.download_by_link()`, :code:`AsyncClient.download()` и
:code:`AsyncClient.download_by_link()`, если сервер вернул ошибочный код
состояния
* **Release 3.0.1 (2024-07-09)**
* Исправлен сломанный :code:`pyproject.toml`, который не включал в сборку
полное содержимое пакета (см. `issue #49`_)
* **Release 3.0.0 (2024-07-09)**
* Несовместимые изменения:
- См. `Руководство по миграции`_ для подробностей
- Все методы теперь ожидают завершения асинхронных операций по умолчанию
(см. новый параметр :code:`wait=<bool>`)
- Итерация по результату :code:`AsyncClient.listdir()` больше не требует
дополнительного ключевого слова await
- Число возвращаемых файлов :code:`Client.get_files()` /
:code:`AsyncClient.get_files()` теперь контролируется параметром
:code:`max_items`, вместо :code:`limit`
- Методы :code:`set_token()`, :code:`set_headers()` интерфейсов
:code:`Session` и :code:`AsyncSession` были удалены
- Некоторые методы больше не принимают параметр :code:`fields`
- :code:`Client.get_last_uploaded()` /
:code:`AsyncClient.get_last_uploaded()` теперь возвращает список вместо
генератора
- :code:`yadisk.api` - теперь скрытый модуль
- Все скрытые модули были переименованы, их имена начинаются с :code:`_`
(например, :code:`yadisk._api`)
* Нововведения:
- Добавлены методы для ожидания завершения асинхронной операции (см.
:code:`Client.wait_for_operation()` /
:code:`AsyncClient.wait_for_operation()`)
- Методы, которые могут запускать асинхронную операцию, теперь принимают
дополнительные параметры: :code:`wait: bool = True`,
:code:`poll_interval: float = 1.0` и
:code:`poll_timeout: Optional[float] = None`
- :code:`Client.listdir()`, :code:`Client.get_files()` и их асинхронные
вариации теперь принимают новый параметр :code:`max_items: Optional[int] =
None`, который может быть использован, чтобы ограничить максимальное число
возвращаемых файлов
- Большинство методов :code:`Client` и :code:`AsyncClient` теперь принимает
:code:`retry_on: Optional[Tuple[Type[Exception], ...]] = None`, который
позволяет указывать кортеж из дополнительных исключений, которые могут вызвать
автоматическую повторную попытку
- Модуль :code:`yadisk.types` - теперь публичный
- Добавлено логирование исходящих запросов к API и автоматических
повторных попыток
- Объект логгера библиотеки доступен как :code:`yadisk.settings.logger`
- Добавлен метод :code:`YaDiskObject.field()` и оператор :code:`@`
(:code:`YaDiskObject.__matmul__()`), который удостоверяется, что указанное
поле объекта не является :code:`None`
- Добавлены методы :code:`Client.get_upload_link_object()`,
:code:`AsyncClient.get_upload_link_object()`, возвращаемые значения которых
дополнительно содержат :code:`operation_id`
- :code:`utils.auto_retry()` теперь принимает больше параметров
- Добавлено несколько недостающих полей :code:`DiskInfoObject`
- :code:`EXIFObject` теперь содержит GPS-координаты
- :code:`CaseInsensitiveDict` - теперь часть :code:`yadisk.utils`
* Улучшения:
- Добавлены полные подсказки типов для :code:`Client` и :code:`AsyncClient` с
помощью файлов :code:`.pyi`
- Строки документации для :code:`Client` / :code:`AsyncClient` теперь
включают в себя больше параметров
- Ошибки во время обработки JSON (например, :code:`InvalidResponseError`)
также вызывают автоматические повторные попытки
- Сообщение об ошибке в случае, когда модуль сессии по умолчанию
недоступен, теперь не вводит в заблуждение (см. `issue #43`_)
- Уменьшено значение :code:`limit` до :code:`500` (было :code:`10000`)
для :code:`Client.listdir()` для избежания таймаутов при больших папках
(см. `issue #45`_)
- Уменьшено значение :code:`limit` до :code:`200` (было :code:`1000`)
для :code:`Client.get_files()` для избежания таймаутов
- :code:`Client.download()` и подобные методы больше не задают заголовок
:code:`Connection: close` т.к. в этом нет необходимости (в отличие от
:code:`Client.upload()`)
- :code:`UnknownYaDiskError` теперь включает код статуса в сообщение об
ошибке
* Исправления:
- Исправлены реализации на основе :code:`httpx` и :code:`aiohttp`:
реализации методов :code:`Response.json()` / :code:`AsyncResponse.json()`
не преобразовывали свои исключения в :code:`RequestError`
- Исправлено: параметр :code:`stream=True` был не задан по умолчанию в
:code:`AsyncClient.download()`, :code:`AsyncClient.download_public()`
* Другие изменения:
- :code:`typing_extensions` теперь требуется для Python < 3.10
* **Release 2.1.0 (2024-01-03)**
* Исправлен баг, из-за которого параметры в теле POST-запроса неправильно кодировались
* Исправлен баг в :code:`PycURLSession.send_request()`, из-за которого
переданные заголовки игнорировались
* :code:`RequestsSession.close()` теперь закрывает сессию для всех потоков
* Все методы :code:`Client` и :code:`AsyncClient` теперь используют
существующую сессию
* Удалены аттрибут :code:`session_factory` и метод :code:`make_session()`
классов :code:`Client` и :code:`AsyncClient`
* Класс сессии теперь может быть указан в качестве строки
(см. :code:`Client`/:code:`AsyncClient`)
* Добавлены методы :code:`Client.get_device_code()`/:code:`AsyncClient.get_device_code()`
* Добавлены методы :code:`Client.get_token_from_device_code()`/:code:`AsyncClient.get_token_from_device_code()`
* Добавлен недостающий параметр :code:`redirect_uri` для
:code:`Client.get_auth_url()`/:code:`AsyncClient.get_auth_url()` и
:code:`Client.get_code_url()`/:code:`AsyncClient.get_code_url()`
* Добавлена поддержка параметров PKCE для
:code:`Client.get_auth_url()`/:code:`AsyncClient.get_auth_url()`,
:code:`Client.get_code_url()`/:code:`AsyncClient.get_code_url()` и
:code:`Client.get_token()`/:code:`AsyncClient.get_token()`
* Добавлен аттрибут :code:`scope` для :code:`TokenObject`
* Добавлены новые классы исключений: :code:`InvalidClientError`,
:code:`InvalidGrantError`, :code:`AuthorizationPendingError`,
:code:`BadVerificationCodeError` и :code:`UnsupportedTokenTypeError`
* **Release 2.0.0 (2023-12-12)**
* Библиотека теперь предоставляет как синхронный, так и асинхронный API
(см. `Введение`_ и `Справочник API`_)
* Теперь поддерживается несколько HTTP библиотек (см.
`Доступные реализации сессий`_ для полного списка)
* Теперь возможно добавить поддержку любой HTTP библиотеки
(см. `Интерфейс Session`_)
* `requests`_ - теперь опциональная зависимость (хотя всё ещё используется
по умолчанию для синхронного API)
* Обратите внимание, что аргументы, специфичные для requests теперь передаются
по другому (см. `Доступные реализации сессий`_)
* Предпочитаемые HTTP библиотеки теперь должны быть установлены явным образом
(см. `Введение`_)
* :code:`Client.upload()` и :code:`Client.upload_by_link()` теперь могут
принимать функцию, возвращающую итератор (или генератор) в качестве полезной
нагрузки
* **Release 1.3.4 (2023-10-15)**
* Методы :code:`upload()` и :code:`download()` (и связянные с ними) теперь
могут загружать/скачивать файлы, не поддерживающие операцию :code:`seek()`
(например, :code:`stdin` и :code:`stdout`, при условии, что они открыты в
режиме :code:`"rb"` или :code:`"wb"`), см. `PR #31`_
* **Release 1.3.3 (2023-04-22)**
* Пути вида :code:`app:/` теперь работают правильно (см. `issue #26`_)
* **Release 1.3.2 (2023-03-20)**
* Исправлено `issue #29`_: TypeError: 'type' object is not subscriptable
* **Release 1.3.1 (2023-02-28)**
* Исправлено `issue #28`_: :code:`TypeError` при вызове :code:`download_public()` с параметром :code:`path`
* Исправлено :code:`AttributeError` при вызове :code:`ResourceLinkObject.public_listdir()`
* **Release 1.3.0 (2023-01-30)**
* Добавлены convenience-методы для объектов :code:`...Object` (например, см. :code:`ResourceObject`)
* Добавлены подсказки типов (type hints)
* Улучшены проверки ошибок и проверка ответа
* Добавлены :code:`InvalidResponseError`, :code:`PayloadTooLargeError`, :code:`UploadTrafficLimitExceededError`
* Добавлено несколько недостающих полей объектов :code:`DiskInfoObject` и :code:`SystemFoldersObject`
* Добавлены методы :code:`rename()`, :code:`upload_by_link()` и :code:`download_by_link()`
* Добавлен аттрибут :code:`default_args` объекта :code:`YaDisk`
* :code:`download()` и :code:`upload()` теперь возвращают :code:`ResourceLinkObject`
* До этого возвращаемые объекты :code:`LinkObject` были заменены более конкретными подклассами
* :code:`ConnectionError` теперь тоже вызывает повторную попытку
* **Release 1.2.19 (2023-01-20)**
* Исправлено неправильное поведение фикса из 1.2.18 для путей :code:`disk:`
и :code:`trash:`.
* **Release 1.2.18 (2023-01-20)**
* Исправлено `issue #26`_: символ ':' в именах файлов приводит к
:code:`BadRequestError`. Это поведение вызвано работой самого REST API
Яндекс.Диска, но было исправлено на уровне библиотеки.
* **Release 1.2.17 (2022-12-11)**
* Исправлен баг, связанный с автоматическим закрытием сессии. Использование
метода :code:`__del__()` приводило в некоторых случаях к ошибке
:code:`ReferenceError` (ошибка игнорировалась, но сообщение выводилось).
Баг проявляется по большей части в старых версиях Python (например 3.4).
* **Release 1.2.16 (2022-08-17)**
* Исправлен баг в :code:`check_token()`: функция могла вызвать :code:`ForbiddenError`,
если у приложения недостатчно прав (`issue #23`_).
* **Release 1.2.15 (2021-12-31)**
* Исправлено: не распознавались ссылки на асинхронные операции, если они
использовали :code:`http://` (вместо :code:`https://`).
Иногда Яндекс.Диск может вернуть :code:`http://` ссылку на асинхронную
операцию. Теперь обе версии ссылок распознаются правильно, при этом,
при получении информации об операции (через :code:`get_operation_status()`)
всегда используется :code:`https://` версия ссылки, даже если Яндекс.Диск
вернул :code:`http://`.
* **Release 1.2.14 (2019-03-26)**
* Исправлена ошибка :code:`TypeError` в функциях :code:`get_public_*` при
использовании с параметром :code:`path` (`issue #7`_)
* Добавлен аттрибут :code:`unlimited_autoupload_enabled` для :code:`DiskInfoObject`
* **Release 1.2.13 (2019-02-23)**
* Добавлен :code:`md5` параметр для :code:`remove()`
* Добавлен :code:`UserPublicInfoObject`
* Добавлен аттрибут :code:`country` для :code:`UserObject`
* Добавлен аттрибут :code:`photoslice_time` для :code:`ResourceObject`, :code:`PublicResourceObject`
и :code:`TrashResourceObject`
* **Release 1.2.12 (2018-10-11)**
* Исправлен баг: не работает параметр `fields` в `listdir()` (`issue #4`_)
* **Release 1.2.11 (2018-06-30)**
* Добавлен недостающий параметр :code:`sort` для :code:`get_meta()`
* Добавлены аттрибуты :code:`file` и :code:`antivirus_status` для :code:`ResourceObject`,
:code:`PublicResourceObject` и :code:`TrashResourceObject`
* Добавлен параметр :code:`headers`
* Исправлена опечатка в :code:`download()` и :code:`download_public()` (`issue #2`_)
* Убран параметр :code:`*args`
* **Release 1.2.10 (2018-06-14)**
* Исправлено поведение :code:`timeout=None`. :code:`None` должен означать „без таймаута“,
но в предыдущих версиях значение :code:`None` было синонимично со стандартным таймаутом.
* **Release 1.2.9 (2018-04-28)**
* Изменена лицензия на LGPLv3 (см. :code:`COPYING` и :code:`COPYING.lesser`)
* Другие изменения информации о пакете
* **Release 1.2.8 (2018-04-17)**
* Исправлено несколько опечаток: у :code:`PublicResourceListObject.items` и
:code:`TrashResourceListObject.items` были неправильные типы данных
* Псевдонимы полей в параметре :code:`fields` заменяются при выполнении
запросов API (например, :code:`embedded` -> :code:`_embedded`)
* **Release 1.2.7 (2018-04-15)**
* Исправлен баг перемотки файла при загрузке/скачивании после повторной попытки
* **Release 1.2.6 (2018-04-13)**
* Теперь объекты сессий :code:`requests` кэшируются, чтобы их можно
было переиспользовать (иногда может существенно ускорить выполнение запросов)
* :code:`keep-alive` отключается при загрузке/скачивании файлов по умолчанию
* **Release 1.2.5 (2018-03-31)**
* Исправлен баг (ошибка на единицу) в :code:`utils.auto_retry()` (иногда мог вызвать :code:`AttributeError`)
* Повторные попытки применяются для :code:`upload()`, :code:`download()` и :code:`download_public()` целиком
* Задано :code:`stream=True` для :code:`download()` и :code:`download_public()`
* Другие мелкие исправления
* **Release 1.2.4 (2018-02-19)**
* Исправлена опечатка (:code:`TokenObject.exprires_in` -> :code:`TokenObject.expires_in`)
* **Release 1.2.3 (2018-01-20)**
* Исправлено :code:`TypeError` при вызове :code:`WrongResourceTypeError`
* **Release 1.2.2 (2018-01-19)**
* :code:`refresh_token()` больше не требует валидный или пустой токен.
* **Release 1.2.1 (2018-01-14)**
* Исправлена неработоспособность повторных попыток.
* **Release 1.2.0 (2018-01-14)**
* Исправлено использование :code:`n_retries=0` в :code:`upload()`, :code:`download()` и :code:`download_public()`
* :code:`upload()`, :code:`download()` и :code:`download_public()` больше не возвращают ничего (см. документацию)
* Добавлен модуль :code:`utils` (см. документацию)
* Добавлены :code:`RetriableYaDiskError`, :code:`WrongResourceTypeError`, :code:`BadGatewayError` и :code:`GatewayTimeoutError`
* :code:`listdir()` теперь вызывает :code:`WrongResourceTypeError` вместо :code:`NotADirectoryError`
* **Release 1.1.1 (2017-12-29)**
* Исправлена обработка аргументов в :code:`upload()`, :code:`download()` и :code:`download_public()`.
До этого использование :code:`n_retries` и :code:`retry_interval` вызывало исключение (:code:`TypeError`).
* **Release 1.1.0 (2017-12-27)**
* Усовершенствованные исключения (см. документацию)
* Добавлена поддержка параметра :code:`force_async`
* Мелкие исправления багов
* **Release 1.0.8 (2017-11-29)**
* Исправлен ещё один баг в :code:`listdir()`
* **Release 1.0.7 (2017-11-04)**
* Добавлен :code:`install_requires` в :code:`setup.py`
* **Release 1.0.6 (2017-11-04)**
* Некоторые функции теперь возвращают :code:`OperationLinkObject`
* **Release 1.0.5 (2017-10-29)**
* Исправлен :code:`setup.py`, теперь исключает тесты
* **Release 1.0.4 (2017-10-23)**
* Исправлены баги в :code:`upload`, :code:`download` и :code:`listdir`
* Значение по-умолчанию :code:`limit` в :code:`listdir` установлено в :code:`10000`
* **Release 1.0.3 (2017-10-22)**
* Добавлен модуль :code:`settings`
* **Release 1.0.2 (2017-10-19)**
* Исправлена функция :code:`get_code_url` (добавлены недостающие параметры)
* **Release 1.0.1 (2017-10-18)**
* Исправлен серьёзный баг в :code:`GetTokenRequest` (добавлен недостающий параметр)
* **Release 1.0.0 (2017-10-18)**
* Первый релиз
================================================
FILE: README.ru.rst
================================================
YaDisk
======
.. |RTD Badge| image:: https://img.shields.io/readthedocs/yadisk.svg
:alt: Read the Docs
:target: https://yadisk.readthedocs.io/ru/latest/
.. |CI Badge| image:: https://img.shields.io/github/actions/workflow/status/ivknv/yadisk/lint_and_test.yml
:alt: GitHub Actions Workflow Status
.. |PyPI Badge| image:: https://img.shields.io/pypi/v/yadisk.svg
:alt: PyPI
:target: https://pypi.org/project/yadisk
.. |Python Version Badge| image:: https://img.shields.io/pypi/pyversions/yadisk
:alt: PyPI - Python Version
.. |Coverage Badge| image:: https://coveralls.io/repos/github/ivknv/yadisk/badge.svg?branch=master
:alt: Coverage
:target: https://coveralls.io/github/ivknv/yadisk
|RTD Badge| |CI Badge| |PyPI Badge| |Python Version Badge| |Coverage Badge|
.. _English version of this document: https://github.com/ivknv/yadisk/blob/master/README.en.rst
`English version of this document`_
YaDisk - это библиотека-клиент REST API Яндекс.Диска.
.. _Read the Docs (EN): https://yadisk.readthedocs.io
.. _Read the Docs (RU): https://yadisk.readthedocs.io/ru/latest
Документация доступна на `Read the Docs (RU)`_ и `Read the Docs (EN)`_.
.. contents:: Содержание:
Установка
*********
:code:`yadisk` поддерживает несколько HTTP библиотек и реализует одновременно как синхронный,
так и асинхронный API.
На данный момент поддерживаются следующие HTTP библиотеки:
* :code:`requests` (используется по умолчанию для синхронного API)
* :code:`httpx` (синхронный и асинхронный API, используется по умолчанию для асинхронного API)
* :code:`aiohttp` (асинхронный API)
* :code:`pycurl` (синхронный API)
Для синхронного API (устанавливает :code:`requests`):
.. code:: bash
pip install yadisk[sync-defaults]
Для асинхронного API (устанавливает :code:`httpx` и :code:`aiofiles`):
.. code:: bash
pip install yadisk[async-defaults]
Вы можете также вручную установить нужные библиотеки:
.. code:: bash
# Для использования совместно с pycurl
pip install yadisk[pycurl]
# Для использования совместно с aiohttp, также установит aiofiles
pip install yadisk[async-files,aiohttp]
Примеры
*******
Синхронный API
--------------
.. code:: python
import yadisk
client = yadisk.Client(token="<токен>")
# или
# client = yadisk.Client("<id-приложения>", "<secret-приложения>", "<токен>")
# Вы можете использовать либо конструкцию with, либо вручную вызвать client.close() в конце
with client:
# Проверяет, валиден ли токен
print(client.check_token())
# Получает общую информацию о диске
print(client.get_disk_info())
# Выводит содержимое "/some/path"
print(list(client.listdir("/some/path")))
# Загружает "file_to_upload.txt" в "/destination.txt"
client.upload("file_to_upload.txt", "/destination.txt")
# То же самое
with open("file_to_upload.txt", "rb") as f:
client.upload(f, "/destination.txt")
# Скачивает "/some-file-to-download.txt" в "downloaded.txt"
client.download("/some-file-to-download.txt", "downloaded.txt")
# Безвозвратно удаляет "/file-to-remove"
client.remove("/file-to-remove", permanently=True)
# Создаёт новую папку "/test-dir"
print(client.mkdir("/test-dir"))
Асинхронный API
---------------
.. code:: python
import yadisk
import aiofiles
client = yadisk.AsyncClient(token="<token>")
# или
# client = yadisk.AsyncClient("<application-id>", "<application-secret>", "<token>")
# Вы можете использовать либо конструкцию with, либо вручную вызвать client.close() в конце
async with client:
# Проверяет, валиден ли токен
print(await client.check_token())
# Получает общую информацию о диске
print(await client.get_disk_info())
# Выводит содержимое "/some/path"
print([i async for i in client.listdir("/some/path")])
# Загружает "file_to_upload.txt" в "/destination.txt"
await client.upload("file_to_upload.txt", "/destination.txt")
# То же самое
async with aiofiles.open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# То же самое, но с обычными файлами
with open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# Скачивает "/some-file-to-download.txt" в "downloaded.txt"
await client.download("/some-file-to-download.txt", "downloaded.txt")
# То же самое
async with aiofiles.open("downloaded.txt", "wb") as f:
await client.download("/some-file-to-download.txt", f)
# Безвозвратно удаляет "/file-to-remove"
await client.remove("/file-to-remove", permanently=True)
# Создаёт новую папку "/test-dir"
print(await client.mkdir("/test-dir"))
Участие в разработке
********************
Если вы хотите поучаствовать в разработке, см.
`CONTRIBUTING.rst <https://github.com/ivknv/yadisk/blob/master/CONTRIBUTING.rst>`_.
История изменений
*****************
.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7
.. _issue #23: https://github.com/ivknv/yadisk/issues/23
.. _issue #26: https://github.com/ivknv/yadisk/issues/26
.. _issue #28: https://github.com/ivknv/yadisk/issues/28
.. _issue #29: https://github.com/ivknv/yadisk/issues/29
.. _PR #31: https://github.com/ivknv/yadisk/pull/31
.. _issue #43: https://github.com/ivknv/yadisk/issues/43
.. _issue #45: https://github.com/ivknv/yadisk/issues/45
.. _issue #49: https://github.com/ivknv/yadisk/issues/49
.. _issue #53: https://github.com/ivknv/yadisk/issues/53
.. _Введение: https://yadisk.readthedocs.io/ru/latest/intro.html
.. _Справочник API: https://yadisk.readthedocs.io/ru/latest/api_reference/index.html
.. _Доступные реализации сессий: https://yadisk.readthedocs.io/ru/latest/api_reference/sessions.html
.. _Интерфейс Session: https://yadisk.readthedocs.io/ru/latest/api_reference/session_interface.html
.. _requests: https://pypi.org/project/requests
.. _Руководство по миграции: https://yadisk.readthedocs.io/ru/latest/migration_guide.html
.. _PR #57: https://github.com/ivknv/yadisk/pull/57
.. _issue #62: https://github.com/ivknv/yadisk/issues/62
* **Release 3.4.1 (2026-04-16)**
* Исправления:
* Исправлена ошибка :code:`TypeError` при передаче пути к файлу в
:code:`AsyncClient.download()` или :code:`AsyncClient.upload()` без
установленного :code:`aiofiles` (см. `issue #62`_)
* Обход проблемы, когда Яндекс.Диск игнорирует тело запроса для
:code:`Client.patch()` и :code:`Client.update_public_settings()` при
использовании :code:`pycurl` из-за задания заголовка :code:`Transfer-Encoding: chunked`
по умолчанию
* **Release 3.4.0 (2025-07-10)**
* Нововведения:
* Добавлены методы для управления настройками публичного доступа к ресурсам:
* :code:`Client.update_public_settings()`
* :code:`Client.get_public_settings()`
* :code:`Client.get_public_available_settings()`
Внимание: похоже, что эти эндпоинты не полностью соответствуют
официальной документации REST API, их функциональность на практике
ограничена.
* Добавлен новый класс исключений :code:`PasswordRequiredError`
* Добавлено несколько новых полей :code:`DiskInfoObject`:
* :code:`deletion_restricion_days`
* :code:`hide_screenshots_in_photoslice`
* :code:`is_legal_entity`
* Реализован метод :code:`__dir__()` для объектов ответов сервера
* Улучшения:
* :code:`repr()` объектов ответов API теперь показывает только те ключи,
которые фактически присутствуют (вместо отображения их значений как
:code:`None`, как раньше)
* **Release 3.3.0 (2025-04-29)**
* Нововведения:
* Спуфинг User-Agent для обхода ограничения скорости загрузки файлов на
Диск (см. `PR #57`_). :code:`Client.upload()` и связанные с ним методы
(включая :code:`AsyncClient`) имеют новый опциональный параметр
:code:`spoof_user_agent`, который по умолчанию имеет значение
:code:`True`. Этот параметр можно использовать для отключения спуфинга,
если это необходимо.
* Добавлена поддержка pretty-printing в IPython для :code:`YaDiskObject` и
производных классов
* Исправления:
* :code:`Client.wait_for_operation()` теперь использует
:code:`time.monotonic()` вместо :code:`time.time()`
* Улучшения:
* Сообщения об ошибках REST API теперь чётко разделены на четыре части
(сообщение, описание, код ошибки и код состояния HTTP)
* **Release 3.2.0 (2025-02-03)**
* Нововведения:
* Добавлен новый метод: :code:`Client.makedirs()` и
:code:`AsyncClient.makedirs()` (см. `issue #53`_)
* Добавлено несколько недостающих полей :code:`DiskInfoObject`
* :code:`photounlim_size`
* :code:`will_be_overdrawn`
* :code:`free_photounlim_end_date`
* :code:`payment_flow`
* Добавлено недостающее поле :code:`sizes` для :code:`ResourceObject` и
связанных с ним объектов
* Исправления:
* :code:`Client.rename()` / :code:`AsyncClient.rename()` теперь вызывает
:code:`ValueError` при попытке переименовать корневую папку
* Номера автоматических повторных попыток логировались с ошибкой на
единицу, теперь они логируются правильно
* **Release 3.1.0 (2024-07-12)**
* Нововведения:
* Добавлены новые исключения: :code:`GoneError` и
:code:`ResourceDownloadLimitExceededError`
* Добавлен новый метод: :code:`Client.get_all_public_resources()` и
:code:`AsyncClient.get_all_public_resources()`
* Исправления:
* Задание :code:`headers` и других опциональных параметров сессии как
:code:`None` больше не вызывает ошибок
* Исправлено неправильное поведение :code:`Client.rename()` и
:code:`AsyncClient.rename()` при указании пустого имени файла
* Исправлено несколько опечаток в асинхронных реализациях
convenience-методов (:code:`listdir()` и аналогичных)
* Исправлен неправильный тип данных у атрибута :code:`items` класса
:code:`PublicResourceListObject`
* Исправлены ошибки при отправке запросов API с помощью
:code:`PycURLSession` при задании :code:`stream=True`
* Данные не будут записаны в файл методами :code:`Client.download()`,
:code:`Client.download_by_link()`, :code:`AsyncClient.download()` и
:code:`AsyncClient.download_by_link()`, если сервер вернул ошибочный код
состояния
* **Release 3.0.1 (2024-07-09)**
* Исправлен сломанный :code:`pyproject.toml`, который не включал в сборку
полное содержимое пакета (см. `issue #49`_)
* **Release 3.0.0 (2024-07-09)**
* Несовместимые изменения:
- См. `Руководство по миграции`_ для подробностей
- Все методы теперь ожидают завершения асинхронных операций по умолчанию
(см. новый параметр :code:`wait=<bool>`)
- Итерация по результату :code:`AsyncClient.listdir()` больше не требует
дополнительного ключевого слова await
- Число возвращаемых файлов :code:`Client.get_files()` /
:code:`AsyncClient.get_files()` теперь контролируется параметром
:code:`max_items`, вместо :code:`limit`
- Методы :code:`set_token()`, :code:`set_headers()` интерфейсов
:code:`Session` и :code:`AsyncSession` были удалены
- Некоторые методы больше не принимают параметр :code:`fields`
- :code:`Client.get_last_uploaded()` /
:code:`AsyncClient.get_last_uploaded()` теперь возвращает список вместо
генератора
- :code:`yadisk.api` - теперь скрытый модуль
- Все скрытые модули были переименованы, их имена начинаются с :code:`_`
(например, :code:`yadisk._api`)
* Нововведения:
- Добавлены методы для ожидания завершения асинхронной операции (см.
:code:`Client.wait_for_operation()` /
:code:`AsyncClient.wait_for_operation()`)
- Методы, которые могут запускать асинхронную операцию, теперь принимают
дополнительные параметры: :code:`wait: bool = True`,
:code:`poll_interval: float = 1.0` и
:code:`poll_timeout: Optional[float] = None`
- :code:`Client.listdir()`, :code:`Client.get_files()` и их асинхронные
вариации теперь принимают новый параметр :code:`max_items: Optional[int] =
None`, который может быть использован, чтобы ограничить максимальное число
возвращаемых файлов
- Большинство методов :code:`Client` и :code:`AsyncClient` теперь принимает
:code:`retry_on: Optional[Tuple[Type[Exception], ...]] = None`, который
позволяет указывать кортеж из дополнительных исключений, которые могут вызвать
автоматическую повторную попытку
- Модуль :code:`yadisk.types` - теперь публичный
- Добавлено логирование исходящих запросов к API и автоматических
повторных попыток
- Объект логгера библиотеки доступен как :code:`yadisk.settings.logger`
- Добавлен метод :code:`YaDiskObject.field()` и оператор :code:`@`
(:code:`YaDiskObject.__matmul__()`), который удостоверяется, что указанное
поле объекта не является :code:`None`
- Добавлены методы :code:`Client.get_upload_link_object()`,
:code:`AsyncClient.get_upload_link_object()`, возвращаемые значения которых
дополнительно содержат :code:`operation_id`
- :code:`utils.auto_retry()` теперь принимает больше параметров
- Добавлено несколько недостающих полей :code:`DiskInfoObject`
- :code:`EXIFObject` теперь содержит GPS-координаты
- :code:`CaseInsensitiveDict` - теперь часть :code:`yadisk.utils`
* Улучшения:
- Добавлены полные подсказки типов для :code:`Client` и :code:`AsyncClient` с
помощью файлов :code:`.pyi`
- Строки документации для :code:`Client` / :code:`AsyncClient` теперь
включают в себя больше параметров
- Ошибки во время обработки JSON (например, :code:`InvalidResponseError`)
также вызывают автоматические повторные попытки
- Сообщение об ошибке в случае, когда модуль сессии по умолчанию
недоступен, теперь не вводит в заблуждение (см. `issue #43`_)
- Уменьшено значение :code:`limit` до :code:`500` (было :code:`10000`)
для :code:`Client.listdir()` для избежания таймаутов при больших папках
(см. `issue #45`_)
- Уменьшено значение :code:`limit` до :code:`200` (было :code:`1000`)
для :code:`Client.get_files()` для избежания таймаутов
- :code:`Client.download()` и подобные методы больше не задают заголовок
:code:`Connection: close` т.к. в этом нет необходимости (в отличие от
:code:`Client.upload()`)
- :code:`UnknownYaDiskError` теперь включает код статуса в сообщение об
ошибке
* Исправления:
- Исправлены реализации на основе :code:`httpx` и :code:`aiohttp`:
реализации методов :code:`Response.json()` / :code:`AsyncResponse.json()`
не преобразовывали свои исключения в :code:`RequestError`
- Исправлено: параметр :code:`stream=True` был не задан по умолчанию в
:code:`AsyncClient.download()`, :code:`AsyncClient.download_public()`
* Другие изменения:
- :code:`typing_extensions` теперь требуется для Python < 3.10
* **Release 2.1.0 (2024-01-03)**
* Исправлен баг, из-за которого параметры в теле POST-запроса неправильно кодировались
* Исправлен баг в :code:`PycURLSession.send_request()`, из-за которого
переданные заголовки игнорировались
* :code:`RequestsSession.close()` теперь закрывает сессию для всех потоков
* Все методы :code:`Client` и :code:`AsyncClient` теперь используют
существующую сессию
* Удалены аттрибут :code:`session_factory` и метод :code:`make_session()`
классов :code:`Client` и :code:`AsyncClient`
* Класс сессии теперь может быть указан в качестве строки
(см. :code:`Client`/:code:`AsyncClient`)
* Добавлены методы :code:`Client.get_device_code()`/:code:`AsyncClient.get_device_code()`
* Добавлены методы :code:`Client.get_token_from_device_code()`/:code:`AsyncClient.get_token_from_device_code()`
* Добавлен недостающий параметр :code:`redirect_uri` для
:code:`Client.get_auth_url()`/:code:`AsyncClient.get_auth_url()` и
:code:`Client.get_code_url()`/:code:`AsyncClient.get_code_url()`
* Добавлена поддержка параметров PKCE для
:code:`Client.get_auth_url()`/:code:`AsyncClient.get_auth_url()`,
:code:`Client.get_code_url()`/:code:`AsyncClient.get_code_url()` и
:code:`Client.get_token()`/:code:`AsyncClient.get_token()`
* Добавлен аттрибут :code:`scope` для :code:`TokenObject`
* Добавлены новые классы исключений: :code:`InvalidClientError`,
:code:`InvalidGrantError`, :code:`AuthorizationPendingError`,
:code:`BadVerificationCodeError` и :code:`UnsupportedTokenTypeError`
* **Release 2.0.0 (2023-12-12)**
* Библиотека теперь предоставляет как синхронный, так и асинхронный API
(см. `Введение`_ и `Справочник API`_)
* Теперь поддерживается несколько HTTP библиотек (см.
`Доступные реализации сессий`_ для полного списка)
* Теперь возможно добавить поддержку любой HTTP библиотеки
(см. `Интерфейс Session`_)
* `requests`_ - теперь опциональная зависимость (хотя всё ещё используется
по умолчанию для синхронного API)
* Обратите внимание, что аргументы, специфичные для requests теперь передаются
по другому (см. `Доступные реализации сессий`_)
* Предпочитаемые HTTP библиотеки теперь должны быть установлены явным образом
(см. `Введение`_)
* :code:`Client.upload()` и :code:`Client.upload_by_link()` теперь могут
принимать функцию, возвращающую итератор (или генератор) в качестве полезной
нагрузки
* **Release 1.3.4 (2023-10-15)**
* Методы :code:`upload()` и :code:`download()` (и связянные с ними) теперь
могут загружать/скачивать файлы, не поддерживающие операцию :code:`seek()`
(например, :code:`stdin` и :code:`stdout`, при условии, что они открыты в
режиме :code:`"rb"` или :code:`"wb"`), см. `PR #31`_
* **Release 1.3.3 (2023-04-22)**
* Пути вида :code:`app:/` теперь работают правильно (см. `issue #26`_)
* **Release 1.3.2 (2023-03-20)**
* Исправлено `issue #29`_: TypeError: 'type' object is not subscriptable
* **Release 1.3.1 (2023-02-28)**
* Исправлено `issue #28`_: :code:`TypeError` при вызове :code:`download_public()` с параметром :code:`path`
* Исправлено :code:`AttributeError` при вызове :code:`ResourceLinkObject.public_listdir()`
* **Release 1.3.0 (2023-01-30)**
* Добавлены convenience-методы для объектов :code:`...Object` (например, см. :code:`ResourceObject`)
* Добавлены подсказки типов (type hints)
* Улучшены проверки ошибок и проверка ответа
* Добавлены :code:`InvalidResponseError`, :code:`PayloadTooLargeError`, :code:`UploadTrafficLimitExceededError`
* Добавлено несколько недостающих полей объектов :code:`DiskInfoObject` и :code:`SystemFoldersObject`
* Добавлены методы :code:`rename()`, :code:`upload_by_link()` и :code:`download_by_link()`
* Добавлен аттрибут :code:`default_args` объекта :code:`YaDisk`
* :code:`download()` и :code:`upload()` теперь возвращают :code:`ResourceLinkObject`
* До этого возвращаемые объекты :code:`LinkObject` были заменены более конкретными подклассами
* :code:`ConnectionError` теперь тоже вызывает повторную попытку
* **Release 1.2.19 (2023-01-20)**
* Исправлено неправильное поведение фикса из 1.2.18 для путей :code:`disk:`
и :code:`trash:`.
* **Release 1.2.18 (2023-01-20)**
* Исправлено `issue #26`_: символ ':' в именах файлов приводит к
:code:`BadRequestError`. Это поведение вызвано работой самого REST API
Яндекс.Диска, но было исправлено на уровне библиотеки.
* **Release 1.2.17 (2022-12-11)**
* Исправлен баг, связанный с автоматическим закрытием сессии. Использование
метода :code:`__del__()` приводило в некоторых случаях к ошибке
:code:`ReferenceError` (ошибка игнорировалась, но сообщение выводилось).
Баг проявляется по большей части в старых версиях Python (например 3.4).
* **Release 1.2.16 (2022-08-17)**
* Исправлен баг в :code:`check_token()`: функция могла вызвать :code:`ForbiddenError`,
если у приложения недостатчно прав (`issue #23`_).
* **Release 1.2.15 (2021-12-31)**
* Исправлено: не распознавались ссылки на асинхронные операции, если они
использовали :code:`http://` (вместо :code:`https://`).
Иногда Яндекс.Диск может вернуть :code:`http://` ссылку на асинхронную
операцию. Теперь обе версии ссылок распознаются правильно, при этом,
при получении информации об операции (через :code:`get_operation_status()`)
всегда используется :code:`https://` версия ссылки, даже если Яндекс.Диск
вернул :code:`http://`.
* **Release 1.2.14 (2019-03-26)**
* Исправлена ошибка :code:`TypeError` в функциях :code:`get_public_*` при
использовании с параметром :code:`path` (`issue #7`_)
* Добавлен аттрибут :code:`unlimited_autoupload_enabled` для :code:`DiskInfoObject`
* **Release 1.2.13 (2019-02-23)**
* Добавлен :code:`md5` параметр для :code:`remove()`
* Добавлен :code:`UserPublicInfoObject`
* Добавлен аттрибут :code:`country` для :code:`UserObject`
* Добавлен аттрибут :code:`photoslice_time` для :code:`ResourceObject`, :code:`PublicResourceObject`
и :code:`TrashResourceObject`
* **Release 1.2.12 (2018-10-11)**
* Исправлен баг: не работает параметр `fields` в `listdir()` (`issue #4`_)
* **Release 1.2.11 (2018-06-30)**
* Добавлен недостающий параметр :code:`sort` для :code:`get_meta()`
* Добавлены аттрибуты :code:`file` и :code:`antivirus_status` для :code:`ResourceObject`,
:code:`PublicResourceObject` и :code:`TrashResourceObject`
* Добавлен параметр :code:`headers`
* Исправлена опечатка в :code:`download()` и :code:`download_public()` (`issue #2`_)
* Убран параметр :code:`*args`
* **Release 1.2.10 (2018-06-14)**
* Исправлено поведение :code:`timeout=None`. :code:`None` должен означать „без таймаута“,
но в предыдущих версиях значение :code:`None` было синонимично со стандартным таймаутом.
* **Release 1.2.9 (2018-04-28)**
* Изменена лицензия на LGPLv3 (см. :code:`COPYING` и :code:`COPYING.lesser`)
* Другие изменения информации о пакете
* **Release 1.2.8 (2018-04-17)**
* Исправлено несколько опечаток: у :code:`PublicResourceListObject.items` и
:code:`TrashResourceListObject.items` были неправильные типы данных
* Псевдонимы полей в параметре :code:`fields` заменяются при выполнении
запросов API (например, :code:`embedded` -> :code:`_embedded`)
* **Release 1.2.7 (2018-04-15)**
* Исправлен баг перемотки файла при загрузке/скачивании после повторной попытки
* **Release 1.2.6 (2018-04-13)**
* Теперь объекты сессий :code:`requests` кэшируются, чтобы их можно
было переиспользовать (иногда может существенно ускорить выполнение запросов)
* :code:`keep-alive` отключается при загрузке/скачивании файлов по умолчанию
* **Release 1.2.5 (2018-03-31)**
* Исправлен баг (ошибка на единицу) в :code:`utils.auto_retry()` (иногда мог вызвать :code:`AttributeError`)
* Повторные попытки применяются для :code:`upload()`, :code:`download()` и :code:`download_public()` целиком
* Задано :code:`stream=True` для :code:`download()` и :code:`download_public()`
* Другие мелкие исправления
* **Release 1.2.4 (2018-02-19)**
* Исправлена опечатка (:code:`TokenObject.exprires_in` -> :code:`TokenObject.expires_in`)
* **Release 1.2.3 (2018-01-20)**
* Исправлено :code:`TypeError` при вызове :code:`WrongResourceTypeError`
* **Release 1.2.2 (2018-01-19)**
* :code:`refresh_token()` больше не требует валидный или пустой токен.
* **Release 1.2.1 (2018-01-14)**
* Исправлена неработоспособность повторных попыток.
* **Release 1.2.0 (2018-01-14)**
* Исправлено использование :code:`n_retries=0` в :code:`upload()`, :code:`download()` и :code:`download_public()`
* :code:`upload()`, :code:`download()` и :code:`download_public()` больше не возвращают ничего (см. документацию)
* Добавлен модуль :code:`utils` (см. документацию)
* Добавлены :code:`RetriableYaDiskError`, :code:`WrongResourceTypeError`, :code:`BadGatewayError` и :code:`GatewayTimeoutError`
* :code:`listdir()` теперь вызывает :code:`WrongResourceTypeError` вместо :code:`NotADirectoryError`
* **Release 1.1.1 (2017-12-29)**
* Исправлена обработка аргументов в :code:`upload()`, :code:`download()` и :code:`download_public()`.
До этого использование :code:`n_retries` и :code:`retry_interval` вызывало исключение (:code:`TypeError`).
* **Release 1.1.0 (2017-12-27)**
* Усовершенствованные исключения (см. документацию)
* Добавлена поддержка параметра :code:`force_async`
* Мелкие исправления багов
* **Release 1.0.8 (2017-11-29)**
* Исправлен ещё один баг в :code:`listdir()`
* **Release 1.0.7 (2017-11-04)**
* Добавлен :code:`install_requires` в :code:`setup.py`
* **Release 1.0.6 (2017-11-04)**
* Некоторые функции теперь возвращают :code:`OperationLinkObject`
* **Release 1.0.5 (2017-10-29)**
* Исправлен :code:`setup.py`, теперь исключает тесты
* **Release 1.0.4 (2017-10-23)**
* Исправлены баги в :code:`upload`, :code:`download` и :code:`listdir`
* Значение по-умолчанию :code:`limit` в :code:`listdir` установлено в :code:`10000`
* **Release 1.0.3 (2017-10-22)**
* Добавлен модуль :code:`settings`
* **Release 1.0.2 (2017-10-19)**
* Исправлена функция :code:`get_code_url` (добавлены недостающие параметры)
* **Release 1.0.1 (2017-10-18)**
* Исправлен серьёзный баг в :code:`GetTokenRequest` (добавлен недостающий параметр)
* **Release 1.0.0 (2017-10-18)**
* Первый релиз
================================================
FILE: docs/Makefile
================================================
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = YaDisk
SOURCEDIR = .
BUILDDIR = _build
# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
.PHONY: help Makefile
# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
================================================
FILE: docs/api_reference/async_api.rst
================================================
Asynchronous API
================
.. autoclass:: yadisk.AsyncClient
.. automethod:: close
.. autoclass:: yadisk.AsyncYaDisk
Authentication
--------------
.. automethod:: yadisk.AsyncClient.check_token
.. automethod:: yadisk.AsyncClient.get_auth_url
.. automethod:: yadisk.AsyncClient.get_code_url
.. automethod:: yadisk.AsyncClient.get_device_code
.. automethod:: yadisk.AsyncClient.get_token
.. automethod:: yadisk.AsyncClient.get_token_from_device_code
.. automethod:: yadisk.AsyncClient.refresh_token
.. automethod:: yadisk.AsyncClient.revoke_token
Disk Info
---------
.. automethod:: yadisk.AsyncClient.get_disk_info
Metadata About Files
--------------------
.. automethod:: yadisk.AsyncClient.get_meta
.. automethod:: yadisk.AsyncClient.listdir
.. automethod:: yadisk.AsyncClient.exists
.. automethod:: yadisk.AsyncClient.get_type
.. automethod:: yadisk.AsyncClient.is_file
.. automethod:: yadisk.AsyncClient.is_dir
.. automethod:: yadisk.AsyncClient.get_files
.. automethod:: yadisk.AsyncClient.get_last_uploaded
Uploading Files
---------------
.. automethod:: yadisk.AsyncClient.upload
.. automethod:: yadisk.AsyncClient.get_upload_link
.. automethod:: yadisk.AsyncClient.get_upload_link_object
.. automethod:: yadisk.AsyncClient.upload_by_link
.. automethod:: yadisk.AsyncClient.upload_url
Downloading Files
-----------------
.. automethod:: yadisk.AsyncClient.download
.. automethod:: yadisk.AsyncClient.get_download_link
.. automethod:: yadisk.AsyncClient.download_by_link
File Operations
---------------
Creating Directories
^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.mkdir
.. automethod:: yadisk.AsyncClient.makedirs
Removing Files
^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.remove
Copying Files
^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.copy
Moving Files
^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.move
.. automethod:: yadisk.AsyncClient.rename
Setting Custom Properties
^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.patch
Public Files
------------
Publishing/Unpublishing Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.publish
.. automethod:: yadisk.AsyncClient.unpublish
Metadata About Public Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.get_public_meta
.. automethod:: yadisk.AsyncClient.get_public_type
.. automethod:: yadisk.AsyncClient.is_public_dir
.. automethod:: yadisk.AsyncClient.is_public_file
.. automethod:: yadisk.AsyncClient.public_exists
Downloading Public Files
^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.get_public_download_link
.. automethod:: yadisk.AsyncClient.download_public
Saving Public Resources to Disk
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.save_to_disk
Listing Public Files
^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.AsyncClient.get_public_resources
.. automethod:: yadisk.AsyncClient.get_all_public_resources
Public Access Settings
----------------------
.. automethod:: yadisk.AsyncClient.get_public_settings
.. automethod:: yadisk.AsyncClient.get_public_available_settings
.. automethod:: yadisk.AsyncClient.update_public_settings
Trash
-----
.. automethod:: yadisk.AsyncClient.get_trash_meta
.. automethod:: yadisk.AsyncClient.trash_exists
.. automethod:: yadisk.AsyncClient.restore_trash
.. automethod:: yadisk.AsyncClient.remove_trash
.. automethod:: yadisk.AsyncClient.trash_listdir
.. automethod:: yadisk.AsyncClient.get_trash_type
.. automethod:: yadisk.AsyncClient.is_trash_dir
.. automethod:: yadisk.AsyncClient.is_trash_file
Checking Operation Status
-------------------------
.. automethod:: yadisk.AsyncClient.get_operation_status
.. automethod:: yadisk.AsyncClient.wait_for_operation
================================================
FILE: docs/api_reference/exceptions.rst
================================================
Exceptions
==========
.. automodule:: yadisk.exceptions
:members:
:show-inheritance:
================================================
FILE: docs/api_reference/index.rst
================================================
API Reference
=============
.. toctree::
:maxdepth: 1
:caption: Contents:
sync_api
async_api
types
sessions
settings
exceptions
response_objects
session_interface
utilities
================================================
FILE: docs/api_reference/response_objects.rst
================================================
Response Objects
================
.. automodule:: yadisk.objects
:members:
:special-members: __matmul__
:show-inheritance:
================================================
FILE: docs/api_reference/session_interface.rst
================================================
Session Interface
=================
The :any:`Session` and :any:`AsyncSession` are abstract classes that act as adapters
to underlying HTTP client libraries. A session instance is used by :any:`Client`
or :any:`AsyncClient` to perform all the HTTP requests to the Yandex.Disk API.
These interfaces can be implemented to add support for any HTTP library.
For a concrete example, see the source code of any existing implementation
(e.g. :any:`HTTPXSession`).
Synchronous
###########
.. autoclass:: yadisk.Session
:members:
.. autoclass:: yadisk.Response
:members:
Asynchronous
############
.. autoclass:: yadisk.AsyncSession
:members:
.. autoclass:: yadisk.AsyncResponse
:members:
================================================
FILE: docs/api_reference/sessions.rst
================================================
Available Session Implementations
=================================
You can choose which HTTP library will be used by :any:`Client` and :any:`AsyncClient`
by specifying the :code:`session` parameter.
Below you can see the list of session implementations that are shipped with the :code:`yadisk` library.
Alternatively, you can make your own :any:`Session`/:any:`AsyncSession` implementation.
For a concrete example, take a look at the source code of any existing implementations (e.g. :any:`HTTPXSession`).
Synchronous Implementations
###########################
.. autoclass:: yadisk.sessions.requests_session.RequestsSession
:show-inheritance:
.. autoclass:: yadisk.sessions.httpx_session.HTTPXSession
:show-inheritance:
.. autoclass:: yadisk.sessions.pycurl_session.PycURLSession
:show-inheritance:
Asynchronous Implementations
############################
.. autoclass:: yadisk.sessions.aiohttp_session.AIOHTTPSession
:show-inheritance:
.. autoclass:: yadisk.sessions.async_httpx_session.AsyncHTTPXSession
:show-inheritance:
Importing Session Classes
#########################
You can use the following functions to import a session class by name:
.. autofunction:: yadisk.import_session
.. autofunction:: yadisk.import_async_session
================================================
FILE: docs/api_reference/settings.rst
================================================
Settings
========
The following settings can be accessed and changed at runtime in `yadisk.settings` module:
.. automodule:: yadisk.settings
:members:
:show-inheritance:
================================================
FILE: docs/api_reference/sync_api.rst
================================================
Synchronous API
===============
.. autoclass:: yadisk.Client
.. automethod:: close
.. autoclass:: yadisk.YaDisk
Authentication
--------------
.. automethod:: yadisk.Client.check_token
.. automethod:: yadisk.Client.get_auth_url
.. automethod:: yadisk.Client.get_code_url
.. automethod:: yadisk.Client.get_device_code
.. automethod:: yadisk.Client.get_token
.. automethod:: yadisk.Client.get_token_from_device_code
.. automethod:: yadisk.Client.refresh_token
.. automethod:: yadisk.Client.revoke_token
Disk Info
---------
.. automethod:: yadisk.Client.get_disk_info
Metadata About Files
--------------------
.. automethod:: yadisk.Client.get_meta
.. automethod:: yadisk.Client.listdir
.. automethod:: yadisk.Client.exists
.. automethod:: yadisk.Client.get_type
.. automethod:: yadisk.Client.is_file
.. automethod:: yadisk.Client.is_dir
.. automethod:: yadisk.Client.get_files
.. automethod:: yadisk.Client.get_last_uploaded
Uploading Files
---------------
.. automethod:: yadisk.Client.upload
.. automethod:: yadisk.Client.get_upload_link
.. automethod:: yadisk.Client.get_upload_link_object
.. automethod:: yadisk.Client.upload_by_link
.. automethod:: yadisk.Client.upload_url
Downloading Files
-----------------
.. automethod:: yadisk.Client.download
.. automethod:: yadisk.Client.get_download_link
.. automethod:: yadisk.Client.download_by_link
File Operations
---------------
Creating Directories
^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.mkdir
.. automethod:: yadisk.Client.makedirs
Removing Files
^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.remove
Copying Files
^^^^^^^^^^^^^
.. automethod:: yadisk.Client.copy
Moving Files
^^^^^^^^^^^^
.. automethod:: yadisk.Client.move
.. automethod:: yadisk.Client.rename
Setting Custom Properties
^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.patch
Public Files
------------
Publishing/Unpublishing Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.publish
.. automethod:: yadisk.Client.unpublish
Metadata About Public Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.get_public_meta
.. automethod:: yadisk.Client.get_public_type
.. automethod:: yadisk.Client.is_public_dir
.. automethod:: yadisk.Client.is_public_file
.. automethod:: yadisk.Client.public_exists
Downloading Public Files
^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.get_public_download_link
.. automethod:: yadisk.Client.download_public
Saving Public Resources to Disk
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.save_to_disk
Listing Public Files
^^^^^^^^^^^^^^^^^^^^
.. automethod:: yadisk.Client.get_public_resources
.. automethod:: yadisk.Client.get_all_public_resources
Public Access Settings
----------------------
.. automethod:: yadisk.Client.get_public_settings
.. automethod:: yadisk.Client.get_public_available_settings
.. automethod:: yadisk.Client.update_public_settings
Trash
-----
.. automethod:: yadisk.Client.get_trash_meta
.. automethod:: yadisk.Client.trash_exists
.. automethod:: yadisk.Client.restore_trash
.. automethod:: yadisk.Client.remove_trash
.. automethod:: yadisk.Client.trash_listdir
.. automethod:: yadisk.Client.get_trash_type
.. automethod:: yadisk.Client.is_trash_dir
.. automethod:: yadisk.Client.is_trash_file
Checking Operation Status
-------------------------
.. automethod:: yadisk.Client.get_operation_status
.. automethod:: yadisk.Client.wait_for_operation
================================================
FILE: docs/api_reference/types.rst
================================================
Types
=====
.. automodule:: yadisk.types
:members:
:show-inheritance:
================================================
FILE: docs/api_reference/utilities.rst
================================================
Utilities
=========
.. automodule:: yadisk.utils
:members:
================================================
FILE: docs/changelog.rst
================================================
Changelog
=========
.. _issue #2: https://github.com/ivknv/yadisk/issues/2
.. _issue #4: https://github.com/ivknv/yadisk/issues/4
.. _issue #7: https://github.com/ivknv/yadisk/issues/7
.. _issue #23: https://github.com/ivknv/yadisk/issues/23
.. _issue #26: https://github.com/ivknv/yadisk/issues/26
.. _issue #28: https://github.com/ivknv/yadisk/issues/28
.. _issue #29: https://github.com/ivknv/yadisk/issues/29
.. _PR #31: https://github.com/ivknv/yadisk/pull/31
.. _issue #43: https://github.com/ivknv/yadisk/issues/43
.. _issue #45: https://github.com/ivknv/yadisk/issues/45
.. _issue #49: https://github.com/ivknv/yadisk/issues/49
.. _issue #53: https://github.com/ivknv/yadisk/issues/53
.. _requests: https://pypi.org/project/requests
.. _PR #57: https://github.com/ivknv/yadisk/pull/57
.. _issue #62: https://github.com/ivknv/yadisk/issues/62
.. role:: python(code)
:language: python
* **Release 3.4.1 (2026-04-16)**
* Bug fixes:
* Fixed a :code:`TypeError` when passing a file path to
:any:`AsyncClient.download()` or :any:`AsyncClient.upload()` while not
having :code:`aiofiles` installed (see `issue #62`_)
* Work around Yandex.Disk ignoring request body for :any:`Client.patch()` and
:any:`Client.update_public_settings()` when using :code:`pycurl` due to
setting :code:`Transfer-Encoding: chunked` by default
* **Release 3.4.0 (2025-07-10)**
* New features:
* Added methods for managing public settings of resources:
* :any:`Client.update_public_settings()`
* :any:`Client.get_public_settings()`
* :any:`Client.get_public_available_settings()`
Note, it appears that these API endpoints do not fully conform to the
official REST API documentation, their functionality is limited in
practice.
* Added new exception class :any:`PasswordRequiredError`
* Added several new fields for :any:`DiskInfoObject`:
* :code:`deletion_restricion_days`
* :code:`hide_screenshots_in_photoslice`
* :code:`is_legal_entity`
* Implemented the :code:`__dir__()` method for response objects
* Improvements:
* :code:`repr()` of API response objects now only shows the keys that are
actually present (instead of displaying them as :code:`None` like before)
* **Release 3.3.0 (2025-04-29)**
* New features:
* User-Agent spoofing to bypass Yandex.Disk's upload speed limit (see `PR #57`_).
:any:`Client.upload()` and related methods (including :any:`AsyncClient`)
have a new optional parameter :code:`spoof_user_agent`, which is set to
:code:`True` by default. This parameter can be used to disable User-Agent
spoofing if necessary.
* Added IPython's pretty printing support for :any:`YaDiskObject` and
derived classes
* Bug fixes:
* :any:`Client.wait_for_operation()` now uses :code:`time.monotonic()`
instead of :code:`time.time()`
* Improvements:
* REST API error messages are now clearly divided into four parts (message,
description, error code and HTTP status code)
* **Release 3.2.0 (2025-02-03)**
* New features:
* Added new method: :any:`Client.makedirs()` / :any:`AsyncClient.makedirs()`
(see `issue #53`_)
* Added several missing fields for :any:`DiskInfoObject`:
* :code:`photounlim_size`
* :code:`will_be_overdrawn`
* :code:`free_photounlim_end_date`
* :code:`payment_flow`
* Added missing field :code:`sizes` for :any:`ResourceObject` and related
objects
* Bug fixes:
* :any:`Client.rename()` / :any:`AsyncClient.rename()` now raises
:any:`ValueError` on attempt to rename the root directory
* Automatic retry attempt numbers were logged off by one, now they are
logged correctly
* **Release 3.1.0 (2024-07-12)**
* New features:
* Added new exception classes: :any:`GoneError` and
:any:`ResourceDownloadLimitExceededError`
* Added a new method: :any:`Client.get_all_public_resources()` and
:any:`AsyncClient.get_all_public_resources()`
* Bug fixes:
* Fixed setting :code:`headers` and session arguments to :code:`None` causing
errors
* Fixed incorrect handling of empty filename in :any:`Client.rename()` and
:any:`AsyncClient.rename()`
* Fixed several typos in async convenience method implementations
(:code:`listdir()` and related)
* Fixed :any:`PublicResourceListObject` having the wrong type for its
:code:`items` member
* Fixed API requests not working with :any:`PycURLSession` when
:code:`stream=True` is set
* No data will be written to the output file by :any:`Client.download()`,
:any:`Client.download_by_link()`, :any:`AsyncClient.download()` and
:any:`AsyncClient.download_by_link()` if the server returns a bad status
code
* **Release 3.0.1 (2024-07-09)**
* Fixed broken :code:`pyproject.toml` that did not include full package
contents (see `issue #49`_)
* **Release 3.0.0 (2024-07-09)**
* Breaking changes:
- See :doc:`/migration_guide` for full details
- All methods wait for asynchronous operations to complete by default
(see the new :code:`wait=<bool>` parameter)
- Iterating over the result of :any:`AsyncClient.listdir()` no longer
requires the additional await keyword.
- Number of returned items of :any:`Client.get_files()` /
:any:`AsyncClient.get_files()` is now controlled by the :code:`max_items`
parameter, rather than :code:`limit`
- Methods :code:`set_token()`, :code:`set_headers()` of :any:`Session` and
:any:`AsyncSession` were removed
- Some methods no longer accept the :code:`fields` parameter
- :any:`Client.get_last_uploaded()` / :any:`AsyncClient.get_last_uploaded()`
now return a list instead of a generator
- :code:`yadisk.api` is now a private module
- All private modules were renamed to have names that start with :code:`_`
(e.g, :code:`yadisk._api`)
* New features:
- Added methods to wait until an asynchronous operation completes
(see :any:`Client.wait_for_operation()` / :any:`AsyncClient.wait_for_operation()`)
- Methods that may start an asynchronous operation now accept additional
parameters: :python:`wait: bool = True`,
:python:`poll_interval: float = 1.0` and
:python:`poll_timeout: Optional[float] = None`
- :any:`Client.listdir()`, :any:`Client.get_files()` and their async
variants now accept a new parameter
:python:`max_items: Optional[int] = None`, which can be used to limit
the maximum number of returned items
- Most :any:`Client` and :any:`AsyncClient` methods now accept an optional
parameter :python:`retry_on: Optional[Tuple[Type[Exception], ...]] = None`,
which lets you specify a tuple of additional exceptions that can trigger
an automatic retry
- :any:`yadisk.types` module is now public
- Added basic logging of outgoing API requests and automatic retries
- The logger instance for the library can be accessed as
:any:`yadisk.settings.logger`
- Added :any:`YaDiskObject.field()` and the :code:`@` operator
(:any:`YaDiskObject.__matmul__()`) which verify that the given field is
not :code:`None`
- Added :any:`Client.get_upload_link_object()`,
:any:`AsyncClient.get_upload_link_object()` whose return values
additionally contain :code:`operation_id`
- :any:`utils.auto_retry()` now accepts more parameters
- Added a few missing fields for :any:`DiskInfoObject`
- :any:`EXIFObject` now contains GPS coordinates
- :any:`CaseInsensitiveDict` is now part of :any:`yadisk.utils`
* Improvements:
- Added full type hints for :any:`Client`, :any:`AsyncClient` through
:code:`.pyi` stub files
- Docstrings for :any:`Client` / :any:`AsyncClient` now include more
parameters
- Errors during JSON processing (e.g. :any:`InvalidResponseError`) also
trigger automatic retries
- Error message when the default session module is not available is now
less confusing (see `issue #43`_)
- Reduced :any:`Client.listdir()`'s default :code:`limit` to :code:`500`
from :code:`10000` to avoid timeouts on large directories (see `issue #45`_)
- Reduced :any:`Client.get_files()`'s default :code:`limit` to :code:`200`
from :code:`1000` to avoid timeouts
- :any:`Client.download()` and similar methods no longer set
:code:`Connection: close` header, since it's not necessary (unlike with
:any:`Client.upload()`)
- :any:`UnknownYaDiskError` now includes status code in the error message
* Bug fixes:
- Fixed :code:`httpx`- and :code:`aiohttp`-based session implementations
not converting their exceptions to :any:`RequestError` in their
:any:`Response.json()` / :any:`AsyncResponse.json()` implementations
- Fixed :python:`stream=True` not being set by default in
:any:`AsyncClient.download()`, :any:`AsyncClient.download_public()`
* Other changes:
- :code:`typing_extensions` is now required for Python < 3.10
* **Release 2.1.0 (2024-01-03)**
* Fixed a bug where POST request parameters were not encoded correctly
* Fixed a bug in :code:`PycURLSession.send_request()` that made it ignore passed headers
* :code:`RequestsSession.close()` now closes all underlying session
instances, instead of only the current thread-local one
* All methods of :any:`Client` and :any:`AsyncClient` now use existing session
* Removed :code:`session_factory` attribute and :code:`make_session()` method
of :any:`Client` and :any:`AsyncClient`
* Session class can now be specified as a string (see :any:`Client`/:any:`AsyncClient`)
* Added :any:`Client.get_device_code()`/:any:`AsyncClient.get_device_code()` methods
* Added :any:`Client.get_token_from_device_code()`/:any:`AsyncClient.get_token_from_device_code()` methods
* Added missing :code:`redirect_uri` parameter for :any:`Client.get_auth_url()`/:any:`AsyncClient.get_auth_url()`
and :any:`Client.get_code_url()`/:any:`AsyncClient.get_code_url()`
* Added support for PKCE parameters for :any:`Client.get_auth_url()`/:any:`AsyncClient.get_auth_url()`,
:any:`Client.get_code_url()`/:any:`AsyncClient.get_code_url()` and
:any:`Client.get_token()`/:any:`AsyncClient.get_token()`
* Added :code:`scope` attribute for :any:`TokenObject`
* Added new exception classes: :any:`InvalidClientError`, :any:`InvalidGrantError`,
:any:`AuthorizationPendingError`, :any:`BadVerificationCodeError` and
:any:`UnsupportedTokenTypeError`
* **Release 2.0.0 (2023-12-12)**
* The library now provides both synchronous and asynchronous APIs (see
:doc:`/intro` and :doc:`/api_reference/index`)
* Multiple HTTP libraries are supported by default (see
:doc:`/api_reference/sessions` for the full list)
* It is now possible to add support for any HTTP library (see
:doc:`/api_reference/session_interface`)
* `requests`_ is now an optional dependency (although it's still used by
default for synchronous API)
* Note that now requests-specific arguments must be passed differently (see :doc:`/api_reference/sessions`)
* Preferred HTTP client libraries must be explicitly installed now (see :doc:`/intro`)
* :any:`Client.upload()` and :any:`Client.upload_by_link()` can now accept
a function that returns an iterator (or a generator) as a payload
* **Release 1.3.4 (2023-10-15)**
* `upload()` and `download()` (and related) methods can now
upload/download non-seekable file-like objects (e.g. `stdin` or `stdout`
when open in binary mode), see `PR #31`_
* **Release 1.3.3 (2023-04-22)**
* `app:/` paths now work correctly (see `issue #26`_)
* **Release 1.3.2 (2023-03-20)**
* Fixed `issue #29`_: TypeError: 'type' object is not subscriptable
* **Release 1.3.1 (2023-02-28)**
* Fixed `issue #28`_: calling `download_public()` with `path` keyword argument raises `TypeError`
* Fixed `AttributeError` raised when calling `ResourceLinkObject.public_listdir()`
* **Release 1.3.0 (2023-01-30)**
* Added convenience methods to `...Object` objects (e.g. see `ResourceObject`)
* Added type hints
* Improved error checking and response validation
* Added `InvalidResponseError`, `PayloadTooLargeError`, `UploadTrafficLimitExceededError`
* Added a few missing fields to `DiskInfoObject` and `SystemFoldersObject`
* Added `rename()`, `upload_by_link()` and `download_by_link()` methods
* Added `default_args` field for `YaDisk` object
* `download()` and `upload()` now return `ResourceLinkObject`
* Returned `LinkObject` instances have been replaced by more specific subclasses
* :any:`ConnectionError` now also triggers a retry
* **Release 1.2.19 (2023-01-20)**
* Fixed incorrect behavior of the fix from 1.2.18 for paths `disk:`
and `trash:` (only these two).
* **Release 1.2.18 (2023-01-20)**
* Fixed `issue #26`_: ':' character in filenames causes `BadRequestError`.
This is due the behavior of Yandex.Disk's REST API itself but is avoided
on the library level with this fix.
* **Release 1.2.17 (2022-12-11)**
* Fixed a minor bug which could cause a `ReferenceError`
(which would not cause a crash, but still show an error message). The bug
involved using `__del__()` method in `SelfDestructingSession`
to automatically close the sessions it seems to affect primarily old Python
versions (such as 3.4).
* **Release 1.2.16 (2022-08-17)**
* Fixed a bug in `check_token()`: could throw `ForbiddenError` if
the application lacks necessary permissions (`issue #23`_).
* **Release 1.2.15 (2021-12-31)**
* Fixed an issue where `http://` links were not recognized as operation links
(they were assumed to always be `https://`, since all the other
requests are always HTTPS).
Occasionally, Yandex.Disk can for some reason return an `http://` link
to an asynchronous operation instead of `https://`.
Both links are now recognized correctly and an `https://` version will
always be used by `get_operation_status()`, regardless of which one
Yandex.Disk returned.
* **Release 1.2.14 (2019-03-26)**
* Fixed a `TypeError` in `get_public_*` functions when passing `path` parameter
(see `issue #7`_)
* Added `unlimited_autoupload_enabled` attribute for `DiskInfoObject`
* **Release 1.2.13 (2019-02-23)**
* Added `md5` parameter for `remove()`
* Added `UserPublicInfoObject`
* Added `country` attribute for `UserObject`
* Added `photoslice_time` attribute for `ResourceObject`, `PublicResourceObject`
and `TrashResourceObject`
* **Release 1.2.12 (2018-10-11)**
* Fixed `fields` parameter not working properly in `listdir()` (`issue #4`_)
* **Release 1.2.11 (2018-06-30)**
* Added the missing parameter `sort` for `get_meta()`
* Added `file` and `antivirus_status` attributes for `ResourceObject`,
`PublicResourceObject` and `TrashResourceObject`
* Added `headers` parameter
* Fixed a typo in `download()` and `download_public()` (`issue #2`_)
* Removed `*args` parameter everywhere
* **Release 1.2.10 (2018-06-14)**
* Fixed `timeout=None` behavior. `None` is supposed to mean 'no timeout' but
in the older versions it was synonymous with the default timeout.
* **Release 1.2.9 (2018-04-28)**
* Changed the license to LGPLv3 (see `COPYING` and `COPYING.lesser`)
* Other package info updates
* **Release 1.2.8 (2018-04-17)**
* Fixed a couple of typos: `PublicResourceListObject.items` and
`TrashResourceListObject.items` had wrong types
* Substitute field aliases in `fields` parameter when performing
API requests (e.g. `embedded` -> `_embedded`)
* **Release 1.2.7 (2018-04-15)**
* Fixed a file rewinding bug when uploading/downloading files after a retry
* **Release 1.2.6 (2018-04-13)**
* Now caching `requests` sessions so that open connections
can be reused (which can significantly speed things up sometimes)
* Disable `keep-alive` when uploading/downloading files by default
* **Release 1.2.5 (2018-03-31)**
* Fixed an off-by-one bug in `utils.auto_retry()`
(which could sometimes result in `AttributeError`)
* Retry the whole request for `upload()`, `download()` and `download_public()`
* Set `stream=True` for `download()` and `download_public()`
* Other minor fixes
* **Release 1.2.4 (2018-02-19)**
* Fixed `TokenObject` having `exprires_in` instead of `expires_in` (fixed a typo)
* **Release 1.2.3 (2018-01-20)**
* Fixed a `TypeError` when `WrongResourceTypeError` is raised
* **Release 1.2.2 (2018-01-19)**
* `refresh_token()` no longer requires a valid or empty token.
* **Release 1.2.1 (2018-01-14)**
* Fixed auto retries not working. Whoops.
* **Release 1.2.0 (2018-01-14)**
* Fixed passing `n_retries=0` to `upload()`,
`download()` and `download_public()`
* `upload()`, `download()` and `download_public()`
no longer return anything (see the docs)
* Added `utils` module (see the docs)
* Added `RetriableYaDiskError`, `WrongResourceTypeError`,
`BadGatewayError` and `GatewayTimeoutError`
* `listdir()` now raises `WrongResourceTypeError`
instead of `NotADirectoryError`
* **Release 1.1.1 (2017-12-29)**
* Fixed argument handling in `upload()`, `download()` and `download_public()`.
Previously, passing `n_retries` and `retry_interval` would raise an exception (`TypeError`).
* **Release 1.1.0 (2017-12-27)**
* Better exceptions (see the docs)
* Added support for `force_async` parameter
* Minor bug fixes
* **Release 1.0.8 (2017-11-29)**
* Fixed yet another `listdir()` bug
* **Release 1.0.7 (2017-11-04)**
* Added `install_requires` argument to `setup.py`
* **Release 1.0.6 (2017-11-04)**
* Return `OperationLinkObject` in some functions
* **Release 1.0.5 (2017-10-29)**
* Fixed `setup.py` to exclude tests
* **Release 1.0.4 (2017-10-23)**
* Fixed bugs in `upload`, `download` and `listdir` functions
* Set default `listdir` `limit` to `10000`
* **Release 1.0.3 (2017-10-22)**
* Added settings
* **Release 1.0.2 (2017-10-19)**
* Fixed `get_code_url` function (added missing parameters)
* **Release 1.0.1 (2017-10-18)**
* Fixed a major bug in `GetTokenRequest` (added missing parameter)
* **Release 1.0.0 (2017-10-18)**
* Initial release
================================================
FILE: docs/conf.py
================================================
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# YaDisk documentation build configuration file, created by
# sphinx-quickstart on Sun Oct 1 19:06:55 2017.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated file.
#
# All configuration values have a default; values that are commented out
# serve to show the default.
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
import os
import sys
sys.path.insert(0, os.path.abspath('..'))
# -- General configuration ------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
#
# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom
# ones.
extensions = ['sphinx.ext.autodoc',
'sphinx.ext.coverage',
'sphinx.ext.viewcode',
'sphinx.ext.intersphinx']
intersphinx_mapping = {"python": ("https://docs.python.org/3", None),
"requests": ("https://requests.readthedocs.io/en/latest", None),
"aiohttp": ("https://docs.aiohttp.org/en/stable", None),
"pycurl": ("http://pycurl.io/docs/latest", None)}
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix as a list of string:
#
# source_suffix = ['.rst', '.md']
source_suffix = '.rst'
# The master toctree document.
master_doc = 'index'
# General information about the project.
project = 'YaDisk'
copyright = '2026, Ivan Konovalov'
author = 'Ivan Konovalov'
# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.
#
# The short X.Y version.
version = '3.4.1'
# The full version, including alpha/beta/rc tags.
release = version
# The language for content autogenerated by Sphinx. Refer to documentation
# for a list of supported languages.
#
# This is also used if you do content translation via gettext catalogs.
# Usually you set "language" from the command line for these cases.
language = 'en'
# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
# This patterns also effect to html_static_path and html_extra_path
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
# The name of the Pygments (syntax highlighting) style to use.
pygments_style = 'sphinx'
# If true, `todo` and `todoList` produce output, else they produce nothing.
todo_include_todos = False
# -- Options for HTML output ----------------------------------------------
# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes.
#
html_theme = 'sphinx_rtd_theme'
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
#
# html_theme_options = {}
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
html_static_path = ['_static']
# Custom sidebar templates, must be a dictionary that maps document names
# to template names.
#
# This is required for the alabaster theme
# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars
html_sidebars = {
'**': [
'about.html',
'navigation.html',
'relations.html', # needs 'show_related': True theme option to display
'searchbox.html',
'donate.html',
]
}
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.
htmlhelp_basename = 'YaDiskdoc'
# -- Options for LaTeX output ---------------------------------------------
latex_elements = {
# The paper size ('letterpaper' or 'a4paper').
#
# 'papersize': 'letterpaper',
# The font size ('10pt', '11pt' or '12pt').
#
# 'pointsize': '10pt',
# Additional stuff for the LaTeX preamble.
#
# 'preamble': '',
# Latex figure (float) alignment
#
# 'figure_align': 'htbp',
}
# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
(master_doc, 'YaDisk.tex', 'YaDisk Documentation',
'Ivan Konovalov', 'manual'),
]
# -- Options for manual page output ---------------------------------------
# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [
(master_doc, 'yadisk', 'YaDisk Documentation',
[author], 1)
]
# -- Options for Texinfo output -------------------------------------------
# Grouping the document tree into Texinfo files. List of tuples
# (source start file, target name, title, author,
# dir menu entry, description, category)
texinfo_documents = [
(master_doc, 'YaDisk', 'YaDisk Documentation',
author, 'YaDisk', 'One line description of project.',
'Miscellaneous'),
]
================================================
FILE: docs/index.rst
================================================
.. YaDisk documentation master file, created by
sphinx-quickstart on Sun Oct 1 19:06:55 2017.
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to YaDisk's documentation!
==================================
.. toctree::
:maxdepth: 2
:caption: Contents:
intro
known_issues
migration_guide
api_reference/index
changelog
Indices and tables
==================
* :ref:`genindex`
* :ref:`modindex`
* :ref:`search`
================================================
FILE: docs/intro.rst
================================================
Introduction
============
YaDisk is a Yandex.Disk REST API client library.
Installation
************
:code:`yadisk` supports multiple HTTP client libraries and has both synchronous and
asynchronous API.
The following HTTP client libraries are currently supported:
* :code:`requests` (used by default for synchronous API)
* :code:`httpx` (both synchronous and asynchronous, used by default for asynchronous API)
* :code:`aiohttp` (asynchronous only)
* :code:`pycurl` (synchronous only)
For synchronous API (installs :code:`requests`):
.. code:: bash
pip install yadisk[sync-defaults]
For asynchronous API (installs :code:`aiofiles` and :code:`httpx`):
.. code:: bash
pip install yadisk[async-defaults]
Alternatively, you can manually choose which optional libraries to install:
.. code:: bash
# For use with pycurl
pip install yadisk[pycurl]
# For use with aiohttp, will also install aiofiles
pip install yadisk[async-files,aiohttp]
Links to Official Yandex.Disk REST API Docs
*******************************************
| `Official Yandex.Disk REST API Docs <https://yandex.com/dev/disk/rest/>`__
| `Polygon <https://yandex.com/dev/disk/poligon>`__
Examples
********
Synchronous API
---------------
.. code:: python
import yadisk
client = yadisk.Client(token="<token>")
# or
# client = yadisk.Client("<application-id>", "<application-secret>", "<token>")
# You can either use the with statement or manually call client.close() later
with client:
# Check if the token is valid
print(client.check_token())
# Get disk information
print(client.get_disk_info())
# Print files and directories at "/some/path"
print(list(client.listdir("/some/path")))
# Upload "file_to_upload.txt" to "/destination.txt"
client.upload("file_to_upload.txt", "/destination.txt")
# Same thing
with open("file_to_upload.txt", "rb") as f:
client.upload(f, "/destination.txt")
# Download "/some-file-to-download.txt" to "downloaded.txt"
client.download("/some-file-to-download.txt", "downloaded.txt")
# Permanently remove "/file-to-remove"
client.remove("/file-to-remove", permanently=True)
# Create a new directory at "/test-dir"
print(client.mkdir("/test-dir"))
Receiving token with confirmation code
######################################
.. code:: python
import sys
import yadisk
def main():
with yadisk.Client("application-id>", "<application-secret>") as client:
url = client.get_code_url()
print(f"Go to the following url: {url}")
code = input("Enter the confirmation code: ")
try:
response = client.get_token(code)
except yadisk.exceptions.BadRequestError:
print("Bad code")
return
client.token = response.access_token
if client.check_token():
print("Sucessfully received token!")
else:
print("Something went wrong. Not sure how though...")
main()
Recursive upload
################
.. code:: python
import posixpath
import os
import yadisk
def recursive_upload(client: yadisk.Client, from_dir: str, to_dir: str):
for root, dirs, files in os.walk(from_dir):
p = root.split(from_dir)[1].strip(os.path.sep)
dir_path = posixpath.join(to_dir, p)
try:
client.mkdir(dir_path)
except yadisk.exceptions.PathExistsError:
pass
for file in files:
file_path = posixpath.join(dir_path, file)
p_sys = p.replace("/", os.path.sep)
in_path = os.path.join(from_dir, p_sys, file)
try:
client.upload(in_path, file_path)
except yadisk.exceptions.PathExistsError:
pass
client = yadisk.Client(token="<application-token>")
to_dir = "/test"
from_dir = "/home/ubuntu"
recursive_upload(client, from_dir, to_dir)
Setting custom properties of files
##################################
.. code:: python
import yadisk
def main():
with yadisk.Client(token="<application-token>") as client:
path = input("Enter a path to patch: ")
properties = {"speed_of_light": 299792458,
"speed_of_light_units": "meters per second",
"message_for_owner": "MWAHAHA! Your file has been patched by an evil script!"}
meta = client.patch(path, properties)
print("\nNew properties: ")
for k, v in meta.custom_properties.items():
print(f"{k}: {repr(v)}")
answer = input("\nWant to get rid of them? (y/[n]) ")
if answer.lower() in ("y", "yes"):
properties = {k: None for k in properties}
client.patch(path, properties)
print("Everything's back as usual")
main()
Emptying the trash bin
######################
.. code:: python
import sys
import yadisk
def main():
answer = input("Are you sure about this? (y/[n]) ")
if answer.lower() not in ("y", "yes"):
print("Not going to do anything")
return
with yadisk.Client(token="<application-token>") as client:
print("Emptying the trash bin...")
print("It might take a while...")
client.remove_trash("/")
print("Success!")
main()
Specifying HTTP client library
##############################
.. code:: python
import yadisk
# Will use httpx for making requests
with yadisk.Client(token="<token>", session="httpx") as client:
print(client.check_token())
Asynchronous API
----------------
.. code:: python
import yadisk
import aiofiles
client = yadisk.AsyncClient(token="<token>")
# or
# client = yadisk.AsyncClient("<application-id>", "<application-secret>", "<token>")
# You can either use the with statement or manually call client.close() later
async with client:
# Check if the token is valid
print(await client.check_token())
# Get disk information
print(await client.get_disk_info())
# Print files and directories at "/some/path"
print([i async for i in client.listdir("/some/path")])
# Upload "file_to_upload.txt" to "/destination.txt"
await client.upload("file_to_upload.txt", "/destination.txt")
# Same thing
async with aiofiles.open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# Same thing but with regular files
with open("file_to_upload.txt", "rb") as f:
await client.upload(f, "/destination.txt")
# Download "/some-file-to-download.txt" to "downloaded.txt"
await client.download("/some-file-to-download.txt", "downloaded.txt")
# Same thing
async with aiofiles.open("downloaded.txt", "wb") as f:
await client.download("/some-file-to-download.txt", f)
# Permanently remove "/file-to-remove"
await client.remove("/file-to-remove", permanently=True)
# Create a new directory at "/test-dir"
print(await client.mkdir("/test-dir"))
Receiving token with confirmation code
######################################
.. code:: python
import asyncio
import sys
import yadisk
async def main():
async with yadisk.AsyncClient("application-id>", "<application-secret>") as client:
url = client.get_code_url()
print(f"Go to the following url: {url}")
code = input("Enter the confirmation code: ")
try:
response = await client.get_token(code)
except yadisk.exceptions.BadRequestError:
print("Bad code")
return
client.token = response.access_token
if await client.check_token():
print("Sucessfully received token!")
else:
print("Something went wrong. Not sure how though...")
asyncio.run(main())
Recursive upload
################
.. code:: python
import asyncio
import posixpath
import os
import yadisk
async def recursive_upload(from_dir: str, to_dir: str, n_parallel_requests: int = 5):
async with yadisk.AsyncClient(token="<application-token>") as client:
async def upload_files(queue):
while queue:
in_path, out_path = queue.pop(0)
print(f"Uploading {in_path} -> {out_path}")
try:
await client.upload(in_path, out_path)
except yadisk.exceptions.PathExistsError:
print(f"{out_path} already exists")
async def create_dirs(queue):
while queue:
path = queue.pop(0)
print(f"Creating directory {path}")
try:
await client.mkdir(path)
except yadisk.exceptions.PathExistsError:
print(f"{path} already exists")
mkdir_queue = []
upload_queue = []
print(f"Creating directory {to_dir}")
try:
await client.mkdir(to_dir)
except yadisk.exceptions.PathExistsError:
print(f"{to_dir} already exists")
for root, dirs, files in os.walk(from_dir):
rel_dir_path = root.split(from_dir)[1].strip(os.path.sep)
rel_dir_path = rel_dir_path.replace(os.path.sep, "/")
dir_path = posixpath.join(to_dir, rel_dir_path)
for dirname in dirs:
mkdir_queue.append(posixpath.join(dir_path, dirname))
for filename in files:
out_path = posixpath.join(dir_path, filename)
rel_dir_path_sys = rel_dir_path.replace("/", os.path.sep)
in_path = os.path.join(from_dir, rel_dir_path_sys, filename)
upload_queue.append((in_path, out_path))
tasks = [upload_files(upload_queue) for i in range(n_parallel_requests)]
tasks.extend(create_dirs(mkdir_queue) for i in range(n_parallel_requests))
await asyncio.gather(*tasks)
from_dir = input("Directory to upload: ")
to_dir = input("Destination directory: ")
asyncio.run(recursive_upload(from_dir, to_dir, 5))
Setting custom properties of files
##################################
.. code:: python
import asyncio
import yadisk
async def main():
async with yadisk.AsyncClient(token="<application-token>") as client:
path = input("Enter a path to patch: ")
properties = {"speed_of_light": 299792458,
"speed_of_light_units": "meters per second",
"message_for_owner": "MWAHAHA! Your file has been patched by an evil script!"}
meta = await client.patch(path, properties)
print("\nNew properties: ")
for k, v in meta.custom_properties.items():
print(f"{k}: {repr(v)}")
answer = input("\nWant to get rid of them? (y/[n]) ")
if answer.lower() in ("y", "yes"):
properties = {k: None for k in properties}
await client.patch(path, properties)
print("Everything's back as usual")
asyncio.run(main())
Emptying the trash bin
######################
.. code:: python
import asyncio
import sys
import yadisk
async def main():
answer = input("Are you sure about this? (y/[n]) ")
if answer not in ("y", "yes"):
print("Not going to do anything")
return
async with yadisk.AsyncClient(token="<application-token>") as client:
print("Emptying the trash bin...")
print("It might take a while...")
await client.remove_trash("/")
print("Success!")
asyncio.run(main())
Specifying HTTP client library
##############################
.. code:: python
import yadisk
# Will use aiohttp for making requests
async with yadisk.AsyncClient(token="<token>", session="aiohttp") as client:
print(await client.check_token())
================================================
FILE: docs/known_issues.rst
================================================
Known Issues
============
Very Slow Upload of Certain Types of Files
##########################################
Yandex.Disk's REST API limits upload speeds up to 128 KiB/s for certain MIME types of files.
More specifically, throttling takes place based on value of :code:`media_type`
(see :any:`yadisk.Client.get_meta`).
It appears there are 3 types of media types that are throttled:
1) :code:`data` (.db, .dat, etc.)
2) :code:`compressed` (.zip, .gz, .tgz, .rar, .etc)
3) :code:`video` (.3gp, .mp4, .avi, etc.)
This behavior of throttling is predetermined at the moment of requesting an
upload link (with :any:`yadisk.Client.get_upload_link`). The content of the
uploaded file does not matter.
The reason why this problem cannot be observed when uploading through the
official website, is that this throttling does not apply to internal services
(the Yandex.Disk website uses an intermediate internal API to obtain upload links).
While it is not clear what the purpose of this throttling is, it is certain at
this point that this is not a bug.
One workaround is to upload files with changed filename extensions (or without them entirely).
For example, if you want to upload a file named :code:`"my_database.db"`, you can initially
upload it under the name :code:`"my_database.some_other_extension"` and then rename it back
to :code:`"my_database.db"`.
Another workaround is to spoof user agent (see `PR#57 <https://github.com/ivknv/yadisk/pull/57>`_).
Starting with version :code:`3.3.0`, the user agent is spoofed by default (see
:any:`yadisk.Client.get_upload_link()`'s :code:`spoof_user_agent` parameter).
Low Upload Speed on Windows When Using requests
###############################################
.. _requests: https://pypi.org/project/requests
.. _httpx: https://pypi.org/project/httpx
If you use `requests`_ and experience low upload speeds on Windows, the reason
might be due to Python's standard library internally using :code:`select()` to
wait for sockets. The best way around it is to use a different HTTP library
(e.g. `httpx`_, see :doc:`/api_reference/sessions`)
================================================
FILE: docs/locales/ru/LC_MESSAGES/api_reference.po
================================================
# api_reference/*.rst translations.
# Copyright (C) 2025, Ivan Konovalov
# This file is distributed under the same license as the YaDisk package.
# Ivan Konovalov <ivknv0@gmail.com>, 2025.
#
msgid ""
msgstr ""
"Project-Id-Version: YaDisk 3.4.0\n"
"Report-Msgid-Bugs-To: ivknv0@gmail.com\n"
"POT-Creation-Date: 2025-07-10 18:15+0500\n"
"PO-Revision-Date: 2025-07-10 18:19+0500\n"
"Last-Translator: Ivan Konovalov <ivknv0@gmail.com>\n"
"Language-Team: Russian\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Generated-By: Babel 2.17.0\n"
#: ../../api_reference/async_api.rst:2
msgid "Asynchronous API"
msgstr "Асинхронный API"
#: of yadisk._async_client.AsyncClient:1
msgid "Implements access to Yandex.Disk REST API (provides asynchronous API)."
msgstr "Реализует доступ к REST API Яндекс.Диска (реализует асинхронный API)."
#: of yadisk._async_client.AsyncClient:3
msgid ""
"HTTP client implementation can be specified using the :code:`session` "
"parameter. :any:`AsyncHTTPXSession` is used by default. For other "
"options, see :doc:`/api_reference/sessions`."
msgstr ""
"Реализация HTTP-клиента может быть указана с помощью параметра "
":code:`session`. По умолчанию используется :any:`AsyncHTTPXSession`. см. "
":doc:`/api_reference/sessions` для других списка других доступных "
"вариантов."
#: of yadisk._async_client.AsyncClient:7
msgid ""
"Almost all methods of :any:`AsyncClient` (the ones that accept "
"`**kwargs`) accept some additional arguments:"
msgstr ""
"Почти все методы :any:`AsyncClient` (те, которые принимают `**kwargs`) "
"принимают некоторые дополнительные параметры:"
#: of yadisk._async_client.AsyncClient:10 yadisk._client.Client:10
msgid "**n_retries** - `int`, maximum number of retries for a request"
msgstr "**n_retries** - `int`, максимальное число повторных попыток запроса"
#: of yadisk._async_client.AsyncClient:11 yadisk._client.Client:11
msgid "**retry_interval** - `float`, delay between retries (in seconds)"
msgstr ""
"**retry_interval** - `float`, задержка между повторными попытками (в "
"секундах)"
#: of yadisk._async_client.AsyncClient:12 yadisk._client.Client:12
msgid "**headers** - `dict` or `None`, additional request headers"
msgstr "**headers** - `dict` или `None`, дополнительные заголовки запроса"
#: of yadisk._async_client.AsyncClient:13 yadisk._client.Client:13
msgid ""
"**timeout** - `tuple` (:code:`(<connect timeout>, <read timeout>)`) or "
"`float` (specifies both connect and read timeout), request timeout (in "
"seconds)"
msgstr ""
"**timeout** - `tuple` (:code:`(<connect timeout>, <read timeout>)`) или "
"`float` (указывает одновременно и connect и read timeout), таймаут "
"запроса в секундах"
#: of yadisk._async_client.AsyncClient:17
msgid ""
"Additional parameters, specific to a given HTTP client library can also "
"be passed, see documentation for specific :any:`AsyncSession` subclasses "
"(:doc:`/api_reference/sessions`)."
msgstr ""
"Дополнительные параметры, относящиеся к конкретной HTTP библиотеке могут "
"также быть переданы, см. документацию для конкретных подклассов "
":any:`AsyncSession` (:doc:`/api_reference/sessions`)."
#: of yadisk._async_client.AsyncClient:22
msgid ""
"Do not forget to call :any:`AsyncClient.close` or use the `async with` "
"statement to close all the connections. Otherwise, you may get a warning."
msgstr ""
"Не забывайте вызывать :any:`AsyncClient.close` или используйте `async "
"with`, чтобы закрыть все соединения. Иначе, вы можете получить "
"предупреждение."
#: of yadisk._async_client.AsyncClient:25
msgid ""
"In :any:`Client` this is handled in the destructor, but since "
":any:`AsyncClient.close` is a coroutine function the same cannot be done "
"here, so you have to do it explicitly."
msgstr ""
"В :any:`Client` это делалается в деструкторе, но т.к. "
":any:`AsyncClient.close` - корутина, здесь этого сделать нельзя, поэтому "
"приходится делать это явно."
#: of yadisk._async_client.AsyncClient
#: yadisk._async_client.AsyncClient.check_token
#: yadisk._async_client.AsyncClient.copy
#: yadisk._async_client.AsyncClient.download
#: yadisk._async_client.AsyncClient.download_by_link
#: yadisk._async_client.AsyncClient.download_public
#: yadisk._async_client.AsyncClient.exists
#: yadisk._async_client.AsyncClient.get_all_public_resources
#: yadisk._async_client.AsyncClient.get_auth_url
#: yadisk._async_client.AsyncClient.get_code_url
#: yadisk._async_client.AsyncClient.get_device_code
#: yadisk._async_client.AsyncClient.get_disk_info
#: yadisk._async_client.AsyncClient.get_download_link
#: yadisk._async_client.AsyncClient.get_files
#: yadisk._async_client.AsyncClient.get_last_uploaded
#: yadisk._async_client.AsyncClient.get_meta
#: yadisk._async_client.AsyncClient.get_operation_status
#: yadisk._async_client.AsyncClient.get_public_available_settings
#: yadisk._async_client.AsyncClient.get_public_download_link
#: yadisk._async_client.AsyncClient.get_public_meta
#: yadisk._async_client.AsyncClient.get_public_resources
#: yadisk._async_client.AsyncClient.get_public_settings
#: yadisk._async_client.AsyncClient.get_public_type
#: yadisk._async_client.AsyncClient.get_token
#: yadisk._async_client.AsyncClient.get_token_from_device_code
#: yadisk._async_client.AsyncClient.get_trash_meta
#: yadisk._async_client.AsyncClient.get_trash_type
#: yadisk._async_client.AsyncClient.get_type
#: yadisk._async_client.AsyncClient.get_upload_link
#: yadisk._async_client.AsyncClient.get_upload_link_object
#: yadisk._async_client.AsyncClient.is_dir
#: yadisk._async_client.AsyncClient.is_file
#: yadisk._async_client.AsyncClient.is_public_dir
#: yadisk._async_client.AsyncClient.is_public_file
#: yadisk._async_client.AsyncClient.is_trash_dir
#: yadisk._async_client.AsyncClient.is_trash_file
#: yadisk._async_client.AsyncClient.listdir
#: yadisk._async_client.AsyncClient.makedirs
#: yadisk._async_client.AsyncClient.mkdir yadisk._async_client.AsyncClient.move
#: yadisk._async_client.AsyncClient.patch
#: yadisk._async_client.AsyncClient.public_exists
#: yadisk._async_client.AsyncClient.publish
#: yadisk._async_client.AsyncClient.refresh_token
#: yadisk._async_client.AsyncClient.remove
#: yadisk._async_client.AsyncClient.remove_trash
#: yadisk._async_client.AsyncClient.rename
#: yadisk._async_client.AsyncClient.restore_trash
#: yadisk._async_client.AsyncClient.revoke_token
#: yadisk._async_client.AsyncClient.save_to_disk
#: yadisk._async_client.AsyncClient.trash_exists
#: yadisk._async_client.AsyncClient.trash_listdir
#: yadisk._async_client.AsyncClient.unpublish
#: yadisk._async_client.AsyncClient.update_public_settings
#: yadisk._async_client.AsyncClient.upload
#: yadisk._async_client.AsyncClient.upload_by_link
#: yadisk._async_client.AsyncClient.upload_url
#: yadisk._async_client.AsyncClient.wait_for_operation
#: yadisk._async_session.AsyncResponse.download
#: yadisk._async_session.AsyncSession.send_request yadisk._client.Client
#: yadisk._client.Client.check_token yadisk._client.Client.copy
#: yadisk._client.Client.download yadisk._client.Client.download_by_link
#: yadisk._client.Client.download_public yadisk._client.Client.exists
#: yadisk._client.Client.get_all_public_resources
#: yadisk._client.Client.get_auth_url yadisk._client.Client.get_code_url
#: yadisk._client.Client.get_device_code yadisk._client.Client.get_disk_info
#: yadisk._client.Client.get_download_link yadisk._client.Client.get_files
#: yadisk._client.Client.get_last_uploaded yadisk._client.Client.get_meta
#: yadisk._client.Client.get_operation_status
#: yadisk._client.Client.get_public_available_settings
#: yadisk._client.Client.get_public_download_link
#: yadisk._client.Client.get_public_meta
#: yadisk._client.Client.get_public_resources
#: yadisk._client.Client.get_public_settings
#: yadisk._client.Client.get_public_type yadisk._client.Client.get_token
#: yadisk._client.Client.get_token_from_device_code
#: yadisk._client.Client.get_trash_meta yadisk._client.Client.get_trash_type
#: yadisk._client.Client.get_type yadisk._client.Client.get_upload_link
#: yadisk._client.Client.get_upload_link_object yadisk._client.Client.is_dir
#: yadisk._client.Client.is_file yadisk._client.Client.is_public_dir
#: yadisk._client.Client.is_public_file yadisk._client.Client.is_trash_dir
#: yadisk._client.Client.is_trash_file yadisk._client.Client.listdir
#: yadisk._client.Client.makedirs yadisk._client.Client.mkdir
#: yadisk._client.Client.move yadisk._client.Client.patch
#: yadisk._client.Client.public_exists yadisk._client.Client.publish
#: yadisk._client.Client.refresh_token yadisk._client.Client.remove
#: yadisk._client.Client.remove_trash yadisk._client.Client.rename
#: yadisk._client.Client.restore_trash yadisk._client.Client.revoke_token
#: yadisk._client.Client.save_to_disk yadisk._client.Client.trash_exists
#: yadisk._client.Client.trash_listdir yadisk._client.Client.unpublish
#: yadisk._client.Client.update_public_settings yadisk._client.Client.upload
#: yadisk._client.Client.upload_by_link yadisk._client.Client.upload_url
#: yadisk._client.Client.wait_for_operation
#: yadisk._import_session.import_async_session
#: yadisk._import_session.import_session yadisk._session.Response.download
#: yadisk._session.Session.send_request yadisk.exceptions.YaDiskError
#: yadisk.objects._auth.DeviceCodeObject yadisk.objects._auth.TokenObject
#: yadisk.objects._auth.TokenRevokeStatusObject
#: yadisk.objects._disk.DiskInfoObject yadisk.objects._disk.SystemFoldersObject
#: yadisk.objects._disk.UserObject yadisk.objects._disk.UserPublicInfoObject
#: yadisk.objects._error_object.ErrorObject
#: yadisk.objects._link_object.LinkObject
#: yadisk.objects._operations.AsyncOperationLinkObject
#: yadisk.objects._operations.AsyncOperationLinkObject.get_status
#: yadisk.objects._operations.AsyncOperationLinkObject.wait
#: yadisk.objects._operations.OperationLinkObject
#: yadisk.objects._operations.OperationStatusObject
#: yadisk.objects._operations.SyncOperationLinkObject
#: yadisk.objects._operations.SyncOperationLi
gitextract_wzpapcjd/
├── .gitattributes
├── .github/
│ ├── ISSUE_TEMPLATE/
│ │ ├── bug-report--english-.md
│ │ ├── bug-report--русский-.md
│ │ ├── feature-request--english-.md
│ │ ├── feature-request--русский-.md
│ │ ├── question--english-.md
│ │ └── question--русский-.md
│ └── workflows/
│ └── lint_and_test.yml
├── .gitignore
├── .readthedocs.yaml
├── CONTRIBUTING.rst
├── CONTRIBUTORS.rst
├── COPYING
├── COPYING.lesser
├── MANIFEST.in
├── README.en.rst
├── README.rst
├── README.ru.rst
├── docs/
│ ├── Makefile
│ ├── api_reference/
│ │ ├── async_api.rst
│ │ ├── exceptions.rst
│ │ ├── index.rst
│ │ ├── response_objects.rst
│ │ ├── session_interface.rst
│ │ ├── sessions.rst
│ │ ├── settings.rst
│ │ ├── sync_api.rst
│ │ ├── types.rst
│ │ └── utilities.rst
│ ├── changelog.rst
│ ├── conf.py
│ ├── index.rst
│ ├── intro.rst
│ ├── known_issues.rst
│ ├── locales/
│ │ └── ru/
│ │ └── LC_MESSAGES/
│ │ ├── api_reference.po
│ │ ├── changelog.po
│ │ ├── index.po
│ │ ├── intro.po
│ │ ├── known_issues.po
│ │ └── migration_guide.po
│ ├── make.bat
│ ├── migration_guide.rst
│ ├── requirements.in
│ └── requirements.txt
├── pyproject.toml
├── requirements-dev.in
├── requirements-dev.txt
├── src/
│ └── yadisk/
│ ├── __init__.py
│ ├── _api/
│ │ ├── __init__.py
│ │ ├── api_request.py
│ │ ├── auth.py
│ │ ├── disk.py
│ │ ├── operations.py
│ │ └── resources.py
│ ├── _async_client.py
│ ├── _async_client.pyi
│ ├── _async_session.py
│ ├── _client.py
│ ├── _client.pyi
│ ├── _client_common.py
│ ├── _common.py
│ ├── _import_session.py
│ ├── _session.py
│ ├── _typing_compat.py
│ ├── exceptions.py
│ ├── objects/
│ │ ├── __init__.py
│ │ ├── _auth.py
│ │ ├── _disk.py
│ │ ├── _error_object.py
│ │ ├── _link_object.py
│ │ ├── _operations.py
│ │ ├── _operations.pyi
│ │ ├── _resources.py
│ │ ├── _resources.pyi
│ │ └── _yadisk_object.py
│ ├── py.typed
│ ├── sessions/
│ │ ├── __init__.py
│ │ ├── _httpx_common.py
│ │ ├── aiohttp_session.py
│ │ ├── async_httpx_session.py
│ │ ├── httpx_session.py
│ │ ├── pycurl_session.py
│ │ └── requests_session.py
│ ├── settings.py
│ ├── types.py
│ └── utils.py
└── tests/
├── __init__.py
├── async_client_test.py
├── auth_test.py
├── auto_retry_test.py
├── client_test.py
├── conftest.py
├── disk_gateway.py
├── import_session_test.py
├── recorded/
│ ├── async/
│ │ ├── test_auth_async.json
│ │ ├── test_check_token.json
│ │ ├── test_copy.json
│ │ ├── test_device_code_auth_async.json
│ │ ├── test_download_by_link_error.json
│ │ ├── test_get_disk_info.json
│ │ ├── test_get_files.json
│ │ ├── test_get_last_uploaded.json
│ │ ├── test_get_meta.json
│ │ ├── test_get_public_resources.json
│ │ ├── test_get_upload_link_object.json
│ │ ├── test_is_file.json
│ │ ├── test_issue7.json
│ │ ├── test_listdir.json
│ │ ├── test_listdir_fields.json
│ │ ├── test_listdir_on_file.json
│ │ ├── test_listdir_with_limits.json
│ │ ├── test_listdir_with_max_items.json
│ │ ├── test_makedirs_with_scheme.json
│ │ ├── test_makedirs_without_scheme.json
│ │ ├── test_mkdir_and_exists.json
│ │ ├── test_move.json
│ │ ├── test_none_args.json
│ │ ├── test_operation_error_triggers_retry.json
│ │ ├── test_patch.json
│ │ ├── test_permanent_remove.json
│ │ ├── test_public_listdir.json
│ │ ├── test_public_settings.json
│ │ ├── test_publish_unpublish.json
│ │ ├── test_remove_trash.json
│ │ ├── test_rename.json
│ │ ├── test_restore_trash.json
│ │ ├── test_save_to_disk.json
│ │ ├── test_streaming_requests.json
│ │ ├── test_upload_and_download.json
│ │ ├── test_upload_and_download_async.json
│ │ ├── test_upload_download_non_seekable.json
│ │ ├── test_upload_url.json
│ │ └── test_wait_for_operation.json
│ └── sync/
│ ├── test_auth.json
│ ├── test_check_token.json
│ ├── test_copy.json
│ ├── test_device_code_auth.json
│ ├── test_download_by_link_error.json
│ ├── test_get_disk_info.json
│ ├── test_get_files.json
│ ├── test_get_last_uploaded.json
│ ├── test_get_meta.json
│ ├── test_get_public_resources.json
│ ├── test_get_upload_link_object.json
│ ├── test_issue7.json
│ ├── test_listdir.json
│ ├── test_listdir_fields.json
│ ├── test_listdir_on_file.json
│ ├── test_listdir_with_limits.json
│ ├── test_listdir_with_max_items.json
│ ├── test_makedirs_with_scheme.json
│ ├── test_makedirs_without_scheme.json
│ ├── test_mkdir_and_exists.json
│ ├── test_move.json
│ ├── test_none_args.json
│ ├── test_operation_error_triggers_retry.json
│ ├── test_patch.json
│ ├── test_permanent_remove.json
│ ├── test_public_listdir.json
│ ├── test_public_settings.json
│ ├── test_publish_unpublish.json
│ ├── test_remove_trash.json
│ ├── test_rename.json
│ ├── test_restore_trash.json
│ ├── test_save_to_disk.json
│ ├── test_streaming_requests.json
│ ├── test_upload_and_download.json
│ ├── test_upload_download_non_seekable.json
│ ├── test_upload_generator.json
│ ├── test_upload_url.json
│ └── test_wait_for_operation.json
└── test_session.py
SYMBOL INDEX (1206 symbols across 40 files)
FILE: src/yadisk/_api/api_request.py
class APIRequest (line 40) | class APIRequest(object):
method __init__ (line 84) | def __init__(self, session: "AnySession", **kwargs):
method _prepare_send_args (line 126) | def _prepare_send_args(self) -> Dict[str, Any]:
method _attempt (line 146) | def _attempt(
method _async_attempt (line 191) | async def _async_attempt(
method send (line 225) | def send(
method asend (line 249) | async def asend(
method process_json (line 273) | def process_json(self, js: "JSON", **kwargs) -> Any:
FILE: src/yadisk/_api/auth.py
class RefreshTokenRequest (line 40) | class RefreshTokenRequest(APIRequest):
method __init__ (line 56) | def __init__(
method process_json (line 73) | def process_json(self, js: JSON, **kwargs) -> TokenObject:
class RevokeTokenRequest (line 80) | class RevokeTokenRequest(APIRequest):
method __init__ (line 96) | def __init__(
method process_json (line 112) | def process_json(self, js: JSON, **kwargs) -> TokenRevokeStatusObject:
class GetTokenRequest (line 119) | class GetTokenRequest(APIRequest):
method __init__ (line 138) | def __init__(
method process_json (line 182) | def process_json(self, js: JSON, **kwargs) -> TokenObject:
class GetDeviceCodeRequest (line 189) | class GetDeviceCodeRequest(APIRequest):
method __init__ (line 209) | def __init__(
method process_json (line 237) | def process_json(self, js: JSON, **kwargs) -> DeviceCodeObject:
FILE: src/yadisk/_api/disk.py
class DiskInfoRequest (line 32) | class DiskInfoRequest(APIRequest):
method __init__ (line 46) | def __init__(
method process_json (line 61) | def process_json(self, js: "JSON", **kwargs) -> DiskInfoObject:
FILE: src/yadisk/_api/operations.py
class GetOperationStatusRequest (line 35) | class GetOperationStatusRequest(APIRequest):
method __init__ (line 48) | def __init__(
method process_json (line 73) | def process_json(self, js: "JSON", **kwargs) -> OperationStatusObject:
FILE: src/yadisk/_api/resources.py
function _substitute_keys (line 72) | def _substitute_keys(keys: Iterable[str], sub_map: Dict[str, str]) -> Li...
class GetPublicResourcesRequest (line 76) | class GetPublicResourcesRequest(APIRequest):
method __init__ (line 94) | def __init__(
method process_json (line 122) | def process_json(
class UnpublishRequest (line 137) | class UnpublishRequest(APIRequest):
method __init__ (line 151) | def __init__(
method process_json (line 165) | def process_json(
class GetDownloadLinkRequest (line 180) | class GetDownloadLinkRequest(APIRequest):
method __init__ (line 194) | def __init__(
method process_json (line 208) | def process_json(
class GetTrashRequest (line 220) | class GetTrashRequest(APIRequest):
method __init__ (line 238) | def __init__(
method process_json (line 270) | def process_json(
class RestoreTrashRequest (line 285) | class RestoreTrashRequest(APIRequest):
method __init__ (line 303) | def __init__(
method process_json (line 325) | def process_json(
class DeleteTrashRequest (line 351) | class DeleteTrashRequest(APIRequest):
method __init__ (line 367) | def __init__(
method process_json (line 385) | def process_json(
class LastUploadedRequest (line 408) | class LastUploadedRequest(APIRequest):
method __init__ (line 425) | def __init__(
method process_json (line 457) | def process_json(
class CopyRequest (line 472) | class CopyRequest(APIRequest):
method __init__ (line 491) | def __init__(
method process_json (line 511) | def process_json(
class GetMetaRequest (line 537) | class GetMetaRequest(APIRequest):
method __init__ (line 556) | def __init__(
method process_json (line 592) | def process_json(
class GetUploadLinkRequest (line 607) | class GetUploadLinkRequest(APIRequest):
method __init__ (line 622) | def __init__(
method process_json (line 638) | def process_json(
class MkdirRequest (line 650) | class MkdirRequest(APIRequest):
method __init__ (line 664) | def __init__(
method process_json (line 678) | def process_json(
class PublishRequest (line 693) | class PublishRequest(APIRequest):
method __init__ (line 711) | def __init__(
method process_json (line 729) | def process_json(
class GetPublicSettingsRequest (line 744) | class GetPublicSettingsRequest(APIRequest):
method __init__ (line 760) | def __init__(
method process_json (line 776) | def process_json(
class GetPublicAvailableSettingsRequest (line 788) | class GetPublicAvailableSettingsRequest(APIRequest):
method __init__ (line 801) | def __init__(
method process_json (line 811) | def process_json(
class UpdatePublicSettingsRequest (line 823) | class UpdatePublicSettingsRequest(APIRequest):
method __init__ (line 838) | def __init__(
method process_json (line 850) | def process_json(self, js: "JSON", yadisk: Optional["AnyClient"] = Non...
class UploadURLRequest (line 854) | class UploadURLRequest(APIRequest):
method __init__ (line 871) | def __init__(
method process_json (line 889) | def process_json(
class DeleteRequest (line 904) | class DeleteRequest(APIRequest):
method __init__ (line 923) | def __init__(
method process_json (line 945) | def process_json(
class SaveToDiskRequest (line 967) | class SaveToDiskRequest(APIRequest):
method __init__ (line 986) | def __init__(
method process_json (line 1015) | def process_json(
class GetPublicMetaRequest (line 1041) | class GetPublicMetaRequest(APIRequest):
method __init__ (line 1063) | def __init__(
method process_json (line 1100) | def process_json(
class GetPublicDownloadLinkRequest (line 1115) | class GetPublicDownloadLinkRequest(APIRequest):
method __init__ (line 1130) | def __init__(
method process_json (line 1148) | def process_json(
class MoveRequest (line 1160) | class MoveRequest(APIRequest):
method __init__ (line 1178) | def __init__(
method process_json (line 1198) | def process_json(
class FilesRequest (line 1224) | class FilesRequest(APIRequest):
method __init__ (line 1243) | def __init__(
method process_json (line 1281) | def process_json(
class PatchRequest (line 1296) | class PatchRequest(APIRequest):
method __init__ (line 1312) | def __init__(
method process_json (line 1330) | def process_json(
FILE: src/yadisk/_async_client.py
function _open_file_with_aiofiles (line 70) | async def _open_file_with_aiofiles(path: Union[str, bytes], mode: FileOp...
function _open_file (line 76) | async def _open_file(path: Union[str, bytes], mode: FileOpenMode) -> Bin...
function _exists (line 85) | async def _exists(get_meta_function: Callable[..., Awaitable], /, *args,...
function _get_type (line 99) | async def _get_type(
function _listdir (line 115) | async def _listdir(
function read_in_chunks (line 185) | async def read_in_chunks(file: IO, chunk_size: int = 64 * 1024) -> Union...
function read_in_chunks_sync (line 191) | async def read_in_chunks_sync(file: IO, chunk_size: int = 64 * 1024) -> ...
function _file_tell (line 197) | async def _file_tell(file: Any) -> int:
function _file_seek (line 204) | async def _file_seek(file: Any, offset: int, whence: int = 0) -> int:
function _is_file_seekable (line 211) | async def _is_file_seekable(file: Any) -> bool:
class AsyncClient (line 222) | class AsyncClient:
method __init__ (line 309) | def __init__(
method __aenter__ (line 353) | async def __aenter__(self):
method __aexit__ (line 356) | async def __aexit__(self, *args, **kwargs) -> None:
method close (line 359) | async def close(self) -> None:
method _maybe_wait (line 370) | async def _maybe_wait(
method get_auth_url (line 416) | def get_auth_url(
method get_code_url (line 500) | def get_code_url(
method get_device_code (line 559) | async def get_device_code(self, **kwargs) -> "DeviceCodeObject":
method get_token (line 592) | async def get_token(self, code: str, /, **kwargs) -> "TokenObject":
method get_token_from_device_code (line 628) | async def get_token_from_device_code(self, device_code: str, /, **kwar...
method refresh_token (line 666) | async def refresh_token(self, refresh_token: str, /, **kwargs) -> "Tok...
method revoke_token (line 699) | async def revoke_token(
method get_disk_info (line 741) | async def get_disk_info(self, **kwargs) -> "DiskInfoObject":
method get_meta (line 771) | async def get_meta(self, path: str, /, **kwargs) -> "AsyncResourceObje...
method exists (line 808) | async def exists(self, path: str, /, **kwargs) -> bool:
method get_type (line 829) | async def get_type(self, path: str, /, **kwargs) -> str:
method is_file (line 851) | async def is_file(self, path: str, /, **kwargs) -> bool:
method is_dir (line 875) | async def is_dir(self, path: str, /, **kwargs) -> bool:
method listdir (line 899) | async def listdir(
method get_upload_link (line 934) | async def get_upload_link(
method get_upload_link_object (line 986) | async def get_upload_link_object(
method _upload (line 1035) | async def _upload(self,
method upload (line 1133) | async def upload(
method upload_by_link (line 1174) | async def upload_by_link(self,
method get_download_link (line 1203) | async def get_download_link(self, path: str, /, **kwargs) -> str:
method _download (line 1238) | async def _download(
method download (line 1317) | async def download(
method download_by_link (line 1350) | async def download_by_link(
method remove (line 1379) | async def remove(
method mkdir (line 1430) | async def mkdir(self, path: str, /, **kwargs) -> AsyncResourceLinkObject:
method makedirs (line 1464) | async def makedirs(self, path: str, /, **kwargs) -> AsyncResourceLinkO...
method check_token (line 1510) | async def check_token(self, token: Optional[str] = None, /, **kwargs) ...
method get_trash_meta (line 1547) | async def get_trash_meta(self, path: str, /, **kwargs) -> "AsyncTrashR...
method trash_exists (line 1588) | async def trash_exists(self, path: str, /, **kwargs) -> bool:
method copy (line 1609) | async def copy(
method restore_trash (line 1665) | async def restore_trash(
method move (line 1718) | async def move(
method rename (line 1769) | async def rename(
method remove_trash (line 1832) | async def remove_trash(
method publish (line 1879) | async def publish(self, path: str, /, **kwargs) -> AsyncResourceLinkOb...
method unpublish (line 1914) | async def unpublish(self, path: str, /, **kwargs) -> AsyncResourceLink...
method get_public_settings (line 1948) | async def get_public_settings(self, path: str, /, **kwargs) -> PublicS...
method get_public_available_settings (line 1980) | async def get_public_available_settings(self, path: str, /, **kwargs) ...
method update_public_settings (line 2010) | async def update_public_settings(self, path: str, public_settings: Pub...
method save_to_disk (line 2042) | async def save_to_disk(
method get_public_meta (line 2096) | async def get_public_meta(self, public_key: str, /, **kwargs) -> "Asyn...
method public_exists (line 2140) | async def public_exists(self, public_key: str, /, **kwargs) -> bool:
method public_listdir (line 2162) | async def public_listdir(
method get_public_type (line 2200) | async def get_public_type(self, public_key: str, /, **kwargs) -> str:
method is_public_dir (line 2223) | async def is_public_dir(self, public_key: str, /, **kwargs) -> bool:
method is_public_file (line 2248) | async def is_public_file(self, public_key: str, /, **kwargs) -> bool:
method trash_listdir (line 2273) | async def trash_listdir(
method get_trash_type (line 2308) | async def get_trash_type(self, path: str, /, **kwargs) -> str:
method is_trash_dir (line 2330) | async def is_trash_dir(self, path: str, /, **kwargs) -> bool:
method is_trash_file (line 2354) | async def is_trash_file(self, path: str, /, **kwargs) -> bool:
method get_public_resources (line 2378) | async def get_public_resources(self, **kwargs) -> "AsyncPublicResource...
method get_all_public_resources (line 2412) | async def get_all_public_resources(
method patch (line 2478) | async def patch(self, path: str, properties: dict, /, **kwargs) -> "As...
method _get_files_some (line 2511) | async def _get_files_some(self, **kwargs) -> List["AsyncResourceObject"]:
method get_files (line 2526) | async def get_files(
method get_last_uploaded (line 2595) | async def get_last_uploaded(self, **kwargs) -> List["AsyncResourceObje...
method upload_url (line 2642) | async def upload_url(
method get_public_download_link (line 2694) | async def get_public_download_link(self, public_key: str, /, **kwargs)...
method download_public (line 2730) | async def download_public(
method get_operation_status (line 2766) | async def get_operation_status(self, operation_id: str, /, **kwargs) -...
method wait_for_operation (line 2802) | async def wait_for_operation(
FILE: src/yadisk/_async_client.pyi
class AsyncClient (line 39) | class AsyncClient:
method __init__ (line 49) | def __init__(
method __aenter__ (line 62) | async def __aenter__(self): ...
method __aexit__ (line 63) | async def __aexit__(self, *args, **kwargs) -> None: ...
method close (line 64) | async def close(self) -> None: ...
method get_auth_url (line 66) | def get_auth_url(
method get_code_url (line 83) | def get_code_url(
method get_device_code (line 98) | async def get_device_code(
method get_token (line 115) | async def get_token(
method get_token_from_device_code (line 134) | async def get_token_from_device_code(
method refresh_token (line 152) | async def refresh_token(
method revoke_token (line 168) | async def revoke_token(
method check_token (line 184) | async def check_token(
method get_disk_info (line 200) | async def get_disk_info(
method get_meta (line 216) | async def get_meta(
method exists (line 238) | async def exists(
method get_type (line 254) | async def get_type(
method is_file (line 270) | async def is_file(
method is_dir (line 286) | async def is_dir(
method listdir (line 302) | async def listdir(
method get_upload_link (line 327) | async def get_upload_link(
method get_upload_link_object (line 345) | async def get_upload_link_object(
method upload (line 364) | async def upload(
method upload_by_link (line 383) | async def upload_by_link(
method get_download_link (line 400) | async def get_download_link(
method download (line 416) | async def download(
method download_by_link (line 433) | async def download_by_link(
method remove (line 451) | async def remove(
method remove (line 474) | async def remove(
method mkdir (line 496) | async def mkdir(
method makedirs (line 513) | async def makedirs(
method get_trash_meta (line 530) | async def get_trash_meta(
method trash_exists (line 552) | async def trash_exists(
method copy (line 569) | async def copy(
method copy (line 593) | async def copy(
method restore_trash (line 617) | async def restore_trash(
method restore_trash (line 641) | async def restore_trash(
method move (line 665) | async def move(
method move (line 689) | async def move(
method rename (line 713) | async def rename(
method rename (line 737) | async def rename(
method remove_trash (line 761) | async def remove_trash(
method remove_trash (line 783) | async def remove_trash(
method publish (line 804) | async def publish(
method unpublish (line 822) | async def unpublish(
method get_public_settings (line 839) | async def get_public_settings(
method get_public_available_settings (line 855) | async def get_public_available_settings(
method update_public_settings (line 870) | async def update_public_settings(
method save_to_disk (line 887) | async def save_to_disk(
method save_to_disk (line 912) | async def save_to_disk(
method get_public_meta (line 936) | async def get_public_meta(
method public_exists (line 959) | async def public_exists(
method public_listdir (line 982) | async def public_listdir(
method get_public_type (line 1008) | async def get_public_type(
method is_public_dir (line 1025) | async def is_public_dir(
method is_public_file (line 1042) | async def is_public_file(
method trash_listdir (line 1059) | async def trash_listdir(
method get_trash_type (line 1084) | async def get_trash_type(
method is_trash_dir (line 1100) | async def is_trash_dir(
method is_trash_file (line 1116) | async def is_trash_file(
method get_public_resources (line 1132) | async def get_public_resources(
method get_all_public_resources (line 1152) | async def get_all_public_resources(
method patch (line 1173) | async def patch(
method get_files (line 1191) | async def get_files(
method get_last_uploaded (line 1215) | async def get_last_uploaded(
method upload_url (line 1233) | async def upload_url(
method get_public_download_link (line 1255) | async def get_public_download_link(
method download_public (line 1271) | async def download_public(
method get_operation_status (line 1289) | async def get_operation_status(
method wait_for_operation (line 1304) | async def wait_for_operation(
FILE: src/yadisk/_async_session.py
class AsyncResponse (line 33) | class AsyncResponse:
method __init__ (line 47) | def __init__(self) -> None:
method json (line 52) | async def json(self) -> JSON:
method download (line 66) | async def download(self, consume_callback: AsyncConsumeCallback) -> None:
method get_exception (line 81) | async def get_exception(self) -> "YaDiskError":
method close (line 97) | async def close(self) -> None:
method __aenter__ (line 106) | async def __aenter__(self: _Self) -> _Self:
method __aexit__ (line 109) | async def __aexit__(self, *args, **kwargs) -> None:
class AsyncSession (line 115) | class AsyncSession:
method send_request (line 125) | async def send_request(self,
method close (line 159) | async def close(self) -> None:
method __aenter__ (line 168) | async def __aenter__(self: _Self) -> _Self:
method __aexit__ (line 171) | async def __aexit__(self, *args, **kwargs) -> None:
FILE: src/yadisk/_client.py
function _exists (line 72) | def _exists(
function _get_type (line 88) | def _get_type(
function _listdir (line 102) | def _listdir(
class Client (line 170) | class Client:
method __init__ (line 250) | def __init__(self,
method __enter__ (line 290) | def __enter__(self):
method __exit__ (line 293) | def __exit__(self, *args, **kwargs) -> None:
method close (line 296) | def close(self) -> None:
method _maybe_wait (line 307) | def _maybe_wait(
method get_auth_url (line 353) | def get_auth_url(
method get_code_url (line 437) | def get_code_url(
method get_device_code (line 496) | def get_device_code(self, **kwargs) -> "DeviceCodeObject":
method get_token (line 529) | def get_token(self, code: str, /, **kwargs) -> "TokenObject":
method get_token_from_device_code (line 567) | def get_token_from_device_code(self, device_code: str, /, **kwargs) ->...
method refresh_token (line 605) | def refresh_token(self, refresh_token: str, /, **kwargs) -> "TokenObje...
method revoke_token (line 639) | def revoke_token(
method check_token (line 678) | def check_token(self, token: Optional[str] = None, /, **kwargs) -> bool:
method get_disk_info (line 716) | def get_disk_info(self, **kwargs) -> "DiskInfoObject":
method get_meta (line 747) | def get_meta(self, path: str, /, **kwargs) -> "SyncResourceObject":
method exists (line 787) | def exists(self, path: str, /, **kwargs) -> bool:
method get_type (line 809) | def get_type(self, path: str, /, **kwargs) -> str:
method is_file (line 832) | def is_file(self, path: str, /, **kwargs) -> bool:
method is_dir (line 857) | def is_dir(self, path: str, /, **kwargs) -> bool:
method listdir (line 882) | def listdir(self, path: str, /, **kwargs) -> Generator["SyncResourceOb...
method get_upload_link (line 912) | def get_upload_link(
method get_upload_link_object (line 963) | def get_upload_link_object(
method _upload (line 1013) | def _upload(self,
method upload (line 1108) | def upload(
method upload_by_link (line 1152) | def upload_by_link(self,
method get_download_link (line 1180) | def get_download_link(self, path: str, /, **kwargs) -> str:
method _download (line 1214) | def _download(
method download (line 1304) | def download(
method download_by_link (line 1340) | def download_by_link(
method remove (line 1367) | def remove(self, path: str, /, **kwargs) -> Optional["SyncOperationLin...
method mkdir (line 1414) | def mkdir(self, path: str, /, **kwargs) -> SyncResourceLinkObject:
method makedirs (line 1449) | def makedirs(self, path: str, /, **kwargs) -> SyncResourceLinkObject:
method get_trash_meta (line 1496) | def get_trash_meta(self, path: str, /, **kwargs) -> "SyncTrashResource...
method trash_exists (line 1536) | def trash_exists(self, path: str, /, **kwargs) -> bool:
method copy (line 1558) | def copy(
method restore_trash (line 1615) | def restore_trash(
method move (line 1668) | def move(
method rename (line 1720) | def rename(
method remove_trash (line 1784) | def remove_trash(
method publish (line 1832) | def publish(self, path: str, /, **kwargs) -> SyncResourceLinkObject:
method unpublish (line 1868) | def unpublish(self, path: str, /, **kwargs) -> SyncResourceLinkObject:
method get_public_settings (line 1901) | def get_public_settings(self, path: str, /, **kwargs) -> PublicSetting...
method get_public_available_settings (line 1934) | def get_public_available_settings(self, path: str, /, **kwargs) -> Pub...
method update_public_settings (line 1965) | def update_public_settings(self, path: str, public_settings: PublicSet...
method save_to_disk (line 1998) | def save_to_disk(
method get_public_meta (line 2053) | def get_public_meta(
method public_exists (line 2101) | def public_exists(self, public_key: str, /, **kwargs) -> bool:
method public_listdir (line 2124) | def public_listdir(
method get_public_type (line 2162) | def get_public_type(self, public_key: str, /, **kwargs) -> str:
method is_public_dir (line 2186) | def is_public_dir(self, public_key: str, /, **kwargs) -> bool:
method is_public_file (line 2212) | def is_public_file(self, public_key: str, /, **kwargs) -> bool:
method trash_listdir (line 2238) | def trash_listdir(
method get_trash_type (line 2273) | def get_trash_type(self, path: str, /, **kwargs) -> str:
method is_trash_dir (line 2296) | def is_trash_dir(self, path: str, /, **kwargs) -> bool:
method is_trash_file (line 2321) | def is_trash_file(self, path: str, /, **kwargs) -> bool:
method get_public_resources (line 2346) | def get_public_resources(self, **kwargs) -> "SyncPublicResourcesListOb...
method get_all_public_resources (line 2381) | def get_all_public_resources(
method patch (line 2446) | def patch(self, path: str, properties: dict, /, **kwargs) -> "SyncReso...
method _get_files_some (line 2480) | def _get_files_some(self, **kwargs) -> List["SyncResourceObject"]:
method get_files (line 2489) | def get_files(
method get_last_uploaded (line 2558) | def get_last_uploaded(self, **kwargs) -> List["SyncResourceObject"]:
method upload_url (line 2599) | def upload_url(
method get_public_download_link (line 2652) | def get_public_download_link(self, public_key: str, /, **kwargs) -> str:
method download_public (line 2687) | def download_public(
method get_operation_status (line 2725) | def get_operation_status(self, operation_id: str, /, **kwargs) -> Oper...
method wait_for_operation (line 2760) | def wait_for_operation(
FILE: src/yadisk/_client.pyi
class Client (line 38) | class Client:
method __init__ (line 48) | def __init__(
method __enter__ (line 61) | def __enter__(self): ...
method __exit__ (line 62) | def __exit__(self, *args, **kwargs) -> None: ...
method close (line 63) | def close(self) -> None: ...
method get_auth_url (line 65) | def get_auth_url(
method get_code_url (line 82) | def get_code_url(
method get_device_code (line 97) | def get_device_code(
method get_token (line 115) | def get_token(
method get_token_from_device_code (line 135) | def get_token_from_device_code(
method refresh_token (line 154) | def refresh_token(
method revoke_token (line 171) | def revoke_token(
method check_token (line 188) | def check_token(
method get_disk_info (line 205) | def get_disk_info(
method get_meta (line 222) | def get_meta(
method exists (line 245) | def exists(
method get_type (line 262) | def get_type(
method is_file (line 279) | def is_file(
method is_dir (line 296) | def is_dir(
method listdir (line 313) | def listdir(
method get_upload_link (line 337) | def get_upload_link(
method get_upload_link_object (line 356) | def get_upload_link_object(
method upload (line 376) | def upload(
method upload_by_link (line 396) | def upload_by_link(
method get_download_link (line 414) | def get_download_link(
method download (line 431) | def download(
method download_by_link (line 449) | def download_by_link(
method remove (line 468) | def remove(
method remove (line 492) | def remove(
method mkdir (line 515) | def mkdir(
method makedirs (line 533) | def makedirs(
method get_trash_meta (line 551) | def get_trash_meta(
method trash_exists (line 574) | def trash_exists(
method copy (line 592) | def copy(
method copy (line 617) | def copy(
method restore_trash (line 642) | def restore_trash(
method restore_trash (line 667) | def restore_trash(
method move (line 692) | def move(
method move (line 717) | def move(
method rename (line 742) | def rename(
method rename (line 767) | def rename(
method remove_trash (line 792) | def remove_trash(
method remove_trash (line 815) | def remove_trash(
method publish (line 837) | def publish(
method unpublish (line 857) | def unpublish(
method get_public_settings (line 875) | def get_public_settings(
method get_public_available_settings (line 892) | def get_public_available_settings(
method update_public_settings (line 908) | def update_public_settings(
method save_to_disk (line 926) | def save_to_disk(
method save_to_disk (line 952) | def save_to_disk(
method get_public_meta (line 977) | def get_public_meta(
method public_exists (line 1001) | def public_exists(
method public_listdir (line 1025) | def public_listdir(
method get_public_type (line 1050) | def get_public_type(
method is_public_dir (line 1068) | def is_public_dir(
method is_public_file (line 1086) | def is_public_file(
method trash_listdir (line 1104) | def trash_listdir(
method get_trash_type (line 1128) | def get_trash_type(
method is_trash_dir (line 1145) | def is_trash_dir(
method is_trash_file (line 1162) | def is_trash_file(
method get_public_resources (line 1179) | def get_public_resources(
method get_all_public_resources (line 1200) | def get_all_public_resources(
method patch (line 1222) | def patch(
method get_files (line 1241) | def get_files(
method get_last_uploaded (line 1264) | def get_last_uploaded(
method upload_url (line 1284) | def upload_url(
method get_public_download_link (line 1307) | def get_public_download_link(
method download_public (line 1324) | def download_public(
method get_operation_status (line 1343) | def get_operation_status(
method wait_for_operation (line 1360) | def wait_for_operation(
FILE: src/yadisk/_client_common.py
function _apply_default_args (line 40) | def _apply_default_args(args: Dict[str, Any], default_args: Dict[str, An...
function _filter_request_kwargs (line 47) | def _filter_request_kwargs(kwargs: Dict[str, Any]) -> None:
function _read_file_as_generator (line 55) | def _read_file_as_generator(input_file: IO[AnyStr]) -> Generator[AnyStr,...
function _set_authorization_header (line 62) | def _set_authorization_header(
function _add_authorization_header (line 76) | def _add_authorization_header(
function _add_spoof_user_agent_header (line 93) | def _add_spoof_user_agent_header(kwargs: Dict[str, Any]) -> None:
function _validate_listdir_response (line 98) | def _validate_listdir_response(response: ResourceObject) -> ResourceObject:
function _validate_link_response (line 112) | def _validate_link_response(response: LinkObject) -> LinkObject:
function _validate_get_type_response (line 119) | def _validate_get_type_response(response: ResourceObject) -> ResourceObj...
FILE: src/yadisk/_common.py
function typed_list (line 49) | def typed_list(datatype: T) -> Callable[[Optional[List]], List[T]]:
function int_or_error (line 62) | def int_or_error(x: Any) -> int:
function float_or_error (line 69) | def float_or_error(x: Any) -> float:
function str_or_error (line 76) | def str_or_error(x: Any) -> str:
function bool_or_error (line 83) | def bool_or_error(x: Any) -> bool:
function dict_or_error (line 90) | def dict_or_error(x: Any) -> dict:
function str_or_dict_or_error (line 97) | def str_or_dict_or_error(x: Any) -> Union[str, dict]:
function yandex_date (line 104) | def yandex_date(string: str) -> datetime.datetime:
function _is_endpoint_link (line 108) | def _is_endpoint_link(link: str, base_endpoint_url: str) -> bool:
function is_operation_link (line 121) | def is_operation_link(link: str) -> bool:
function is_resource_link (line 125) | def is_resource_link(url: str) -> bool:
function is_public_resource_link (line 129) | def is_public_resource_link(url: str) -> bool:
function ensure_path_has_scheme (line 136) | def ensure_path_has_scheme(path: str, default_scheme: str = "disk") -> str:
function remove_path_scheme (line 153) | def remove_path_scheme(path: str) -> Tuple[str, str]:
function is_async_func (line 173) | def is_async_func(func: Any) -> bool:
function is_default_timeout (line 177) | def is_default_timeout(timeout: TimeoutParameter) -> bool:
FILE: src/yadisk/_import_session.py
function import_session (line 41) | def import_session(name: "SessionName") -> Type["Session"]:
function import_async_session (line 70) | def import_async_session(name: "AsyncSessionName") -> Type["AsyncSession"]:
FILE: src/yadisk/_session.py
class Response (line 31) | class Response:
method __init__ (line 45) | def __init__(self) -> None:
method json (line 50) | def json(self) -> JSON:
method download (line 64) | def download(self, consume_callback: ConsumeCallback) -> None:
method get_exception (line 78) | def get_exception(self) -> YaDiskError:
method close (line 94) | def close(self) -> None:
method __enter__ (line 103) | def __enter__(self: _Self) -> _Self:
method __exit__ (line 106) | def __exit__(self, *args, **kwargs) -> None:
class Session (line 111) | class Session:
method send_request (line 121) | def send_request(self,
method close (line 154) | def close(self) -> None:
method __enter__ (line 163) | def __enter__(self: _Self) -> _Self:
method __exit__ (line 166) | def __exit__(self, *args, **kwargs) -> None:
FILE: src/yadisk/exceptions.py
class YaDiskError (line 69) | class YaDiskError(Exception):
method __init__ (line 89) | def __init__(
class RequestError (line 103) | class RequestError(YaDiskError):
method __init__ (line 109) | def __init__(self, msg: str = "", disable_retry: bool = False):
class YaDiskConnectionError (line 113) | class YaDiskConnectionError(RequestError):
class TooManyRedirectsError (line 118) | class TooManyRedirectsError(RequestError):
class RequestTimeoutError (line 123) | class RequestTimeoutError(RequestError):
class WrongResourceTypeError (line 128) | class WrongResourceTypeError(YaDiskError):
method __init__ (line 131) | def __init__(self, msg: str = "") -> None:
class RetriableYaDiskError (line 135) | class RetriableYaDiskError(YaDiskError):
class AsyncOperationFailedError (line 140) | class AsyncOperationFailedError(RetriableYaDiskError):
method __init__ (line 143) | def __init__(self, msg: str = "") -> None:
class AsyncOperationPollingTimeoutError (line 147) | class AsyncOperationPollingTimeoutError(YaDiskError):
method __init__ (line 150) | def __init__(self, msg: str = "") -> None:
class UnknownYaDiskError (line 154) | class UnknownYaDiskError(RetriableYaDiskError):
method __init__ (line 157) | def __init__(
class BadRequestError (line 166) | class BadRequestError(YaDiskError):
class UnauthorizedError (line 171) | class UnauthorizedError(YaDiskError):
class ForbiddenError (line 176) | class ForbiddenError(YaDiskError):
class NotFoundError (line 181) | class NotFoundError(YaDiskError):
class NotAcceptableError (line 186) | class NotAcceptableError(YaDiskError):
class ConflictError (line 191) | class ConflictError(YaDiskError):
class GoneError (line 196) | class GoneError(YaDiskError):
class PayloadTooLargeError (line 201) | class PayloadTooLargeError(YaDiskError):
class UnsupportedMediaError (line 206) | class UnsupportedMediaError(YaDiskError):
class LockedError (line 211) | class LockedError(YaDiskError):
class UploadTrafficLimitExceededError (line 216) | class UploadTrafficLimitExceededError(LockedError):
class TooManyRequestsError (line 221) | class TooManyRequestsError(YaDiskError):
class ResourceDownloadLimitExceededError (line 226) | class ResourceDownloadLimitExceededError(TooManyRequestsError):
class InternalServerError (line 231) | class InternalServerError(RetriableYaDiskError):
class BadGatewayError (line 236) | class BadGatewayError(RetriableYaDiskError):
class UnavailableError (line 241) | class UnavailableError(RetriableYaDiskError):
class GatewayTimeoutError (line 246) | class GatewayTimeoutError(RetriableYaDiskError):
class InsufficientStorageError (line 251) | class InsufficientStorageError(YaDiskError):
class PathNotFoundError (line 256) | class PathNotFoundError(NotFoundError):
class ParentNotFoundError (line 261) | class ParentNotFoundError(ConflictError):
class PathExistsError (line 266) | class PathExistsError(ConflictError):
class DirectoryExistsError (line 271) | class DirectoryExistsError(PathExistsError):
class FieldValidationError (line 276) | class FieldValidationError(BadRequestError):
class ResourceIsLockedError (line 281) | class ResourceIsLockedError(LockedError):
class MD5DifferError (line 286) | class MD5DifferError(ConflictError):
class OperationNotFoundError (line 291) | class OperationNotFoundError(NotFoundError):
class InvalidResponseError (line 296) | class InvalidResponseError(YaDiskError):
class AuthorizationPendingError (line 301) | class AuthorizationPendingError(BadRequestError):
class InvalidClientError (line 306) | class InvalidClientError(BadRequestError):
class InvalidGrantError (line 311) | class InvalidGrantError(BadRequestError):
class BadVerificationCodeError (line 316) | class BadVerificationCodeError(BadRequestError):
class UnsupportedTokenTypeError (line 321) | class UnsupportedTokenTypeError(BadRequestError):
class PasswordRequiredError (line 326) | class PasswordRequiredError(ForbiddenError):
FILE: src/yadisk/objects/_auth.py
class TokenObject (line 27) | class TokenObject(YaDiskObject):
method __init__ (line 49) | def __init__(self, token: Optional[dict] = None, yadisk: Optional[Any]...
class TokenRevokeStatusObject (line 62) | class TokenRevokeStatusObject(YaDiskObject):
method __init__ (line 74) | def __init__(self,
class DeviceCodeObject (line 82) | class DeviceCodeObject(YaDiskObject):
method __init__ (line 105) | def __init__(self,
FILE: src/yadisk/objects/_disk.py
class DiskInfoObject (line 32) | class DiskInfoObject(YaDiskObject):
method __init__ (line 86) | def __init__(self, disk_info: Optional[Dict] = None, yadisk: Optional[...
class SystemFoldersObject (line 117) | class SystemFoldersObject(YaDiskObject):
method __init__ (line 157) | def __init__(
class UserObject (line 184) | class UserObject(YaDiskObject):
method __init__ (line 206) | def __init__(
class UserPublicInfoObject (line 227) | class UserPublicInfoObject(UserObject):
method __init__ (line 242) | def __init__(
FILE: src/yadisk/objects/_error_object.py
class ErrorObject (line 24) | class ErrorObject(YaDiskObject):
method __init__ (line 36) | def __init__(self, error=None, yadisk=None):
FILE: src/yadisk/objects/_link_object.py
class LinkObject (line 28) | class LinkObject(YaDiskObject):
method __init__ (line 44) | def __init__(self,
FILE: src/yadisk/objects/_operations.py
class OperationStatusObject (line 34) | class OperationStatusObject(YaDiskObject):
method __init__ (line 46) | def __init__(self,
class OperationLinkObject (line 57) | class OperationLinkObject(LinkObject):
class SyncOperationLinkObject (line 72) | class SyncOperationLinkObject(OperationLinkObject):
method get_status (line 84) | def get_status(self, **kwargs) -> OperationStatus:
method wait (line 114) | def wait(self, **kwargs) -> None:
class AsyncOperationLinkObject (line 148) | class AsyncOperationLinkObject(OperationLinkObject):
method get_status (line 160) | async def get_status(self, **kwargs) -> OperationStatus:
method wait (line 189) | async def wait(self, **kwargs) -> None:
FILE: src/yadisk/objects/_operations.pyi
class OperationStatusObject (line 35) | class OperationStatusObject(YaDiskObject):
method __init__ (line 38) | def __init__(self,
class OperationLinkObject (line 43) | class OperationLinkObject(LinkObject):
class SyncOperationLinkObject (line 46) | class SyncOperationLinkObject(OperationLinkObject):
method get_status (line 47) | def get_status(
method wait (line 61) | def wait(
class AsyncOperationLinkObject (line 79) | class AsyncOperationLinkObject(OperationLinkObject):
method get_status (line 80) | async def get_status(
method wait (line 93) | async def wait(
FILE: src/yadisk/objects/_resources.py
class CommentIDsObject (line 99) | class CommentIDsObject(YaDiskObject):
method __init__ (line 113) | def __init__(self,
class EXIFObject (line 125) | class EXIFObject(YaDiskObject):
method __init__ (line 141) | def __init__(
class FilesResourceListObject (line 159) | class FilesResourceListObject(YaDiskObject):
method __init__ (line 175) | def __init__(self,
class SyncFilesResourceListObject (line 188) | class SyncFilesResourceListObject(FilesResourceListObject):
method __init__ (line 202) | def __init__(self,
class AsyncFilesResourceListObject (line 211) | class AsyncFilesResourceListObject(FilesResourceListObject):
method __init__ (line 225) | def __init__(self,
class LastUploadedResourceListObject (line 234) | class LastUploadedResourceListObject(YaDiskObject):
method __init__ (line 248) | def __init__(self,
class SyncLastUploadedResourceListObject (line 259) | class SyncLastUploadedResourceListObject(LastUploadedResourceListObject):
method __init__ (line 272) | def __init__(self,
class AsyncLastUploadedResourceListObject (line 281) | class AsyncLastUploadedResourceListObject(LastUploadedResourceListObject):
method __init__ (line 294) | def __init__(self,
class PublicResourcesListObject (line 303) | class PublicResourcesListObject(YaDiskObject):
method __init__ (line 321) | def __init__(self,
class SyncPublicResourcesListObject (line 335) | class SyncPublicResourcesListObject(PublicResourcesListObject):
method __init__ (line 350) | def __init__(self,
class AsyncPublicResourcesListObject (line 359) | class AsyncPublicResourcesListObject(PublicResourcesListObject):
method __init__ (line 374) | def __init__(self,
class ResourceProtocol (line 383) | class ResourceProtocol(Protocol):
method type (line 385) | def type(self) -> Optional[str]: ...
method path (line 388) | def path(self) -> Optional[str]: ...
method public_key (line 391) | def public_key(self) -> Optional[str]: ...
method public_url (line 394) | def public_url(self) -> Optional[str]: ...
method file (line 397) | def file(self) -> Optional[str]: ...
method _yadisk (line 400) | def _yadisk(self) -> Optional[Any]: ...
class ResourceObjectMethodsMixin (line 403) | class ResourceObjectMethodsMixin:
method get_meta (line 404) | def get_meta(self: ResourceProtocol,
method get_public_meta (line 442) | def get_public_meta(self: ResourceProtocol, **kwargs) -> "SyncPublicRe...
method exists (line 479) | def exists(self: ResourceProtocol,
method get_type (line 510) | def get_type(self: ResourceProtocol,
method is_dir (line 542) | def is_dir(self: ResourceProtocol,
method is_file (line 573) | def is_file(self: ResourceProtocol,
method listdir (line 604) | def listdir(
method public_listdir (line 647) | def public_listdir(
method get_upload_link (line 688) | def get_upload_link(self: ResourceProtocol,
method get_upload_link_object (line 728) | def get_upload_link_object(
method upload (line 776) | def upload(self: ResourceProtocol,
method upload_url (line 819) | def upload_url(self: ResourceProtocol,
method get_download_link (line 868) | def get_download_link(self: ResourceProtocol,
method download (line 902) | def download(self: ResourceProtocol,
method download (line 907) | def download(self: ResourceProtocol,
method download (line 912) | def download(self: ResourceProtocol, /, *args, **kwargs) -> "SyncResou...
method patch (line 964) | def patch(self: ResourceProtocol, properties: Dict, **kwargs) -> "Sync...
method patch (line 968) | def patch(self: ResourceProtocol,
method patch (line 973) | def patch(self: ResourceProtocol, *args, **kwargs) -> "SyncResourceObj...
method publish (line 1018) | def publish(
method unpublish (line 1059) | def unpublish(self: ResourceProtocol,
method get_public_settings (line 1093) | def get_public_settings(
method get_public_available_settings (line 1132) | def get_public_available_settings(
method update_public_settings (line 1169) | def update_public_settings(
method mkdir (line 1216) | def mkdir(self: ResourceProtocol,
method makedirs (line 1252) | def makedirs(
method remove (line 1292) | def remove(self: ResourceProtocol,
method move (line 1341) | def move(self: ResourceProtocol,
method move (line 1346) | def move(self: ResourceProtocol,
method move (line 1351) | def move(self: ResourceProtocol, /, *args, **kwargs) -> Union["SyncRes...
method rename (line 1409) | def rename(self: ResourceProtocol,
method rename (line 1414) | def rename(self: ResourceProtocol,
method rename (line 1419) | def rename(
method copy (line 1480) | def copy(self: ResourceProtocol,
method copy (line 1485) | def copy(self: ResourceProtocol,
method copy (line 1490) | def copy(self: ResourceProtocol, /, *args, **kwargs) -> Union["SyncRes...
class AsyncResourceObjectMethodsMixin (line 1554) | class AsyncResourceObjectMethodsMixin:
method get_meta (line 1555) | async def get_meta(
method get_public_meta (line 1594) | async def get_public_meta(self: ResourceProtocol, **kwargs) -> "AsyncP...
method exists (line 1630) | async def exists(self: ResourceProtocol,
method get_type (line 1660) | async def get_type(self: ResourceProtocol,
method is_dir (line 1691) | async def is_dir(self: ResourceProtocol,
method is_file (line 1721) | async def is_file(self: ResourceProtocol,
method listdir (line 1751) | async def listdir(
method public_listdir (line 1794) | async def public_listdir(
method get_upload_link (line 1835) | async def get_upload_link(self: ResourceProtocol,
method get_upload_link_object (line 1871) | async def get_upload_link_object(
method upload (line 1918) | async def upload(
method upload_url (line 1964) | async def upload_url(self: ResourceProtocol,
method get_download_link (line 2012) | async def get_download_link(self: ResourceProtocol,
method download (line 2045) | async def download(
method download (line 2054) | async def download(
method download (line 2063) | async def download(self: ResourceProtocol, /, *args, **kwargs) -> "Asy...
method patch (line 2114) | async def patch(self: ResourceProtocol, properties: Dict, **kwargs) ->...
method patch (line 2118) | async def patch(
method patch (line 2125) | async def patch(self: ResourceProtocol, *args, **kwargs) -> "AsyncReso...
method publish (line 2169) | async def publish(self: ResourceProtocol,
method unpublish (line 2205) | async def unpublish(self: ResourceProtocol,
method get_public_settings (line 2238) | async def get_public_settings(
method get_public_available_settings (line 2276) | async def get_public_available_settings(
method update_public_settings (line 2312) | async def update_public_settings(
method mkdir (line 2358) | async def mkdir(self: ResourceProtocol,
method makedirs (line 2393) | async def makedirs(
method remove (line 2432) | async def remove(self: ResourceProtocol,
method move (line 2480) | async def move(self: ResourceProtocol,
method move (line 2485) | async def move(self: ResourceProtocol,
method move (line 2490) | async def move(
method rename (line 2552) | async def rename(self: ResourceProtocol,
method rename (line 2557) | async def rename(self: ResourceProtocol,
method rename (line 2562) | async def rename(
method copy (line 2622) | async def copy(self: ResourceProtocol,
method copy (line 2627) | async def copy(self: ResourceProtocol,
method copy (line 2632) | async def copy(
function _convert_list_of_previews (line 2700) | def _convert_list_of_previews(previews: JSON) -> Optional[Dict[str, str]]:
class ResourceObject (line 2730) | class ResourceObject(YaDiskObject):
method __init__ (line 2791) | def __init__(self, resource: Optional[Dict] = None, yadisk: Optional[A...
class SyncResourceObject (line 2824) | class SyncResourceObject(ResourceObject, ResourceObjectMethodsMixin):
method __init__ (line 2861) | def __init__(self, resource: Optional[Dict] = None, yadisk: Optional[A...
class AsyncResourceObject (line 2867) | class AsyncResourceObject(ResourceObject, AsyncResourceObjectMethodsMixin):
method __init__ (line 2904) | def __init__(self, resource: Optional[Dict] = None, yadisk: Optional[A...
class ResourceLinkObject (line 2910) | class ResourceLinkObject(LinkObject):
method __init__ (line 2930) | def __init__(self, link: Optional[Dict] = None, yadisk: Optional[Any] ...
method from_path (line 2949) | def from_path(cls, path: Optional[str], yadisk: Optional[Any] = None):
class SyncResourceLinkObject (line 2962) | class SyncResourceLinkObject(ResourceLinkObject, ResourceObjectMethodsMi...
class AsyncResourceLinkObject (line 2978) | class AsyncResourceLinkObject(ResourceLinkObject, AsyncResourceObjectMet...
class PublicResourceLinkObject (line 2994) | class PublicResourceLinkObject(LinkObject):
method __init__ (line 3015) | def __init__(self, link: Optional[Dict] = None, yadisk: Optional[Any] ...
method from_public_key (line 3035) | def from_public_key(cls, public_key: Optional[str], yadisk: Optional[A...
class SyncPublicResourceLinkObject (line 3046) | class SyncPublicResourceLinkObject(PublicResourceLinkObject, ResourceObj...
class AsyncPublicResourceLinkObject (line 3063) | class AsyncPublicResourceLinkObject(PublicResourceLinkObject, AsyncResou...
class ResourceListObject (line 3080) | class ResourceListObject(YaDiskObject):
method __init__ (line 3102) | def __init__(self, resource_list: Optional[Dict] = None, yadisk: Optio...
class SyncResourceListObject (line 3115) | class SyncResourceListObject(ResourceListObject):
method __init__ (line 3132) | def __init__(self, resource_list: Optional[Dict] = None, yadisk: Optio...
class AsyncResourceListObject (line 3138) | class AsyncResourceListObject(ResourceListObject):
method __init__ (line 3155) | def __init__(self, resource_list: Optional[Dict] = None, yadisk: Optio...
class ResourceUploadLinkObject (line 3161) | class ResourceUploadLinkObject(LinkObject):
method __init__ (line 3176) | def __init__(self,
class ResourceDownloadLinkObject (line 3184) | class ResourceDownloadLinkObject(LinkObject):
class ShareInfoObject (line 3199) | class ShareInfoObject(YaDiskObject):
method __init__ (line 3215) | def __init__(self, share_info: Optional[Dict] = None, yadisk: Optional...
class PublicResourceObject (line 3225) | class PublicResourceObject(ResourceObject):
method __init__ (line 3265) | def __init__(self, public_resource=None, yadisk=None):
class SyncPublicResourceObject (line 3274) | class SyncPublicResourceObject(PublicResourceObject, ResourceObjectMetho...
method __init__ (line 3311) | def __init__(self, public_resource: Optional[Dict] = None, yadisk: Opt...
class AsyncPublicResourceObject (line 3317) | class AsyncPublicResourceObject(PublicResourceObject, AsyncResourceObjec...
method __init__ (line 3354) | def __init__(self, public_resource: Optional[Dict] = None, yadisk: Opt...
class PublicResourceListObject (line 3360) | class PublicResourceListObject(ResourceListObject):
method __init__ (line 3379) | def __init__(self,
class SyncPublicResourceListObject (line 3388) | class SyncPublicResourceListObject(PublicResourceListObject):
method __init__ (line 3406) | def __init__(self, public_resource_list: Optional[Dict] = None, yadisk...
class AsyncPublicResourceListObject (line 3412) | class AsyncPublicResourceListObject(PublicResourceListObject):
method __init__ (line 3430) | def __init__(self, public_resource_list: Optional[Dict] = None, yadisk...
class TrashResourceObject (line 3436) | class TrashResourceObject(ResourceObject):
method __init__ (line 3477) | def __init__(self,
class SyncTrashResourceObject (line 3487) | class SyncTrashResourceObject(TrashResourceObject):
method __init__ (line 3526) | def __init__(self,
method get_meta (line 3533) | def get_meta(self: ResourceProtocol,
method exists (line 3571) | def exists(self: ResourceProtocol,
method get_type (line 3602) | def get_type(self: ResourceProtocol,
method is_dir (line 3634) | def is_dir(self: ResourceProtocol,
method is_file (line 3665) | def is_file(self: ResourceProtocol,
method listdir (line 3696) | def listdir(
method remove (line 3739) | def remove(self: ResourceProtocol,
method restore (line 3784) | def restore(self: ResourceProtocol,
method restore (line 3789) | def restore(self: ResourceProtocol,
method restore (line 3794) | def restore(self: ResourceProtocol, /, *args, **kwargs) -> Union[SyncR...
class AsyncTrashResourceObject (line 3856) | class AsyncTrashResourceObject(TrashResourceObject):
method __init__ (line 3895) | def __init__(self,
method get_meta (line 3902) | async def get_meta(self: ResourceProtocol,
method exists (line 3939) | async def exists(self: ResourceProtocol,
method get_type (line 3969) | async def get_type(self: ResourceProtocol,
method is_dir (line 4000) | async def is_dir(self: ResourceProtocol,
method is_file (line 4030) | async def is_file(self: ResourceProtocol,
method listdir (line 4060) | async def listdir(
method remove (line 4103) | async def remove(self: ResourceProtocol,
method restore (line 4147) | async def restore(self: ResourceProtocol,
method restore (line 4152) | async def restore(self: ResourceProtocol,
method restore (line 4157) | async def restore(
class TrashResourceListObject (line 4223) | class TrashResourceListObject(ResourceListObject):
method __init__ (line 4240) | def __init__(self,
class SyncTrashResourceListObject (line 4248) | class SyncTrashResourceListObject(TrashResourceListObject):
method __init__ (line 4265) | def __init__(self,
class AsyncTrashResourceListObject (line 4273) | class AsyncTrashResourceListObject(TrashResourceListObject):
method __init__ (line 4290) | def __init__(self,
class PublicSettingsObject (line 4298) | class PublicSettingsObject(YaDiskObject):
method __init__ (line 4322) | def __init__(
class AvailableUntilVerboseObject (line 4344) | class AvailableUntilVerboseObject(YaDiskObject):
method __init__ (line 4355) | def __init__(
class PasswordVerboseObject (line 4371) | class PasswordVerboseObject(YaDiskObject):
method __init__ (line 4382) | def __init__(
class ExternalOrganizationIdVerboseObject (line 4398) | class ExternalOrganizationIdVerboseObject(YaDiskObject):
method __init__ (line 4409) | def __init__(
class PublicAccessObject (line 4425) | class PublicAccessObject(YaDiskObject):
method __init__ (line 4469) | def __init__(
class PublicAvailableSettingsObject (line 4490) | class PublicAvailableSettingsObject(YaDiskObject):
method __init__ (line 4517) | def __init__(
class PublicDefaultObject (line 4536) | class PublicDefaultObject(YaDiskObject):
method __init__ (line 4559) | def __init__(
FILE: src/yadisk/objects/_resources.pyi
class CommentIDsObject (line 88) | class CommentIDsObject(YaDiskObject):
method __init__ (line 92) | def __init__(self,
class EXIFObject (line 98) | class EXIFObject(YaDiskObject):
method __init__ (line 103) | def __init__(
class FilesResourceListObject (line 110) | class FilesResourceListObject(YaDiskObject):
method __init__ (line 115) | def __init__(self,
class SyncFilesResourceListObject (line 121) | class SyncFilesResourceListObject(FilesResourceListObject):
method __init__ (line 124) | def __init__(self,
class AsyncFilesResourceListObject (line 129) | class AsyncFilesResourceListObject(FilesResourceListObject):
method __init__ (line 132) | def __init__(self,
class LastUploadedResourceListObject (line 138) | class LastUploadedResourceListObject(YaDiskObject):
method __init__ (line 142) | def __init__(self,
class SyncLastUploadedResourceListObject (line 148) | class SyncLastUploadedResourceListObject(LastUploadedResourceListObject):
method __init__ (line 151) | def __init__(self,
class AsyncLastUploadedResourceListObject (line 157) | class AsyncLastUploadedResourceListObject(LastUploadedResourceListObject):
method __init__ (line 160) | def __init__(self,
class PublicResourcesListObject (line 166) | class PublicResourcesListObject(YaDiskObject):
method __init__ (line 172) | def __init__(self,
class SyncPublicResourcesListObject (line 178) | class SyncPublicResourcesListObject(PublicResourcesListObject):
method __init__ (line 181) | def __init__(self,
class AsyncPublicResourcesListObject (line 187) | class AsyncPublicResourcesListObject(PublicResourcesListObject):
method __init__ (line 190) | def __init__(self,
class ResourceProtocol (line 196) | class ResourceProtocol(Protocol):
method type (line 198) | def type(self) -> Optional[str]: ...
method path (line 201) | def path(self) -> Optional[str]: ...
method public_key (line 204) | def public_key(self) -> Optional[str]: ...
method public_url (line 207) | def public_url(self) -> Optional[str]: ...
method file (line 210) | def file(self) -> Optional[str]: ...
method _yadisk (line 213) | def _yadisk(self) -> Optional[Any]: ...
class ResourceObjectMethodsMixin (line 216) | class ResourceObjectMethodsMixin:
method get_meta (line 217) | def get_meta(
method get_public_meta (line 240) | def get_public_meta(
method exists (line 262) | def exists(
method get_type (line 279) | def get_type(
method is_dir (line 296) | def is_dir(
method is_file (line 313) | def is_file(
method listdir (line 330) | def listdir(
method public_listdir (line 354) | def public_listdir(
method get_upload_link (line 377) | def get_upload_link(
method get_upload_link_object (line 395) | def get_upload_link_object(
method upload (line 415) | def upload(
method upload_url (line 435) | def upload_url(
method get_download_link (line 455) | def get_download_link(
method download (line 473) | def download(
method download (line 491) | def download(
method patch (line 510) | def patch(
method patch (line 528) | def patch(
method publish (line 546) | def publish(
method unpublish (line 566) | def unpublish(
method get_public_settings (line 584) | def get_public_settings(
method get_public_available_settings (line 601) | def get_public_available_settings(
method update_public_settings (line 618) | def update_public_settings(
method update_public_settings (line 637) | def update_public_settings(
method mkdir (line 654) | def mkdir(
method makedirs (line 672) | def makedirs(
method remove (line 691) | def remove(
method remove (line 714) | def remove(
method move (line 737) | def move(
method move (line 761) | def move(
method move (line 785) | def move(
method move (line 810) | def move(
method rename (line 835) | def rename(
method rename (line 859) | def rename(
method rename (line 883) | def rename(
method rename (line 908) | def rename(
method copy (line 933) | def copy(
method copy (line 957) | def copy(
method copy (line 981) | def copy(
method copy (line 1006) | def copy(
class AsyncResourceObjectMethodsMixin (line 1031) | class AsyncResourceObjectMethodsMixin:
method get_meta (line 1032) | async def get_meta(
method get_public_meta (line 1054) | async def get_public_meta(
method exists (line 1075) | async def exists(
method get_type (line 1091) | async def get_type(
method is_dir (line 1107) | async def is_dir(
method is_file (line 1123) | async def is_file(
method listdir (line 1139) | async def listdir(
method public_listdir (line 1164) | async def public_listdir(
method get_upload_link (line 1188) | async def get_upload_link(
method get_upload_link_object (line 1206) | async def get_upload_link_object(
method upload (line 1225) | async def upload(
method upload_url (line 1244) | async def upload_url(
method get_download_link (line 1266) | async def get_download_link(
method download (line 1283) | async def download(
method download (line 1300) | async def download(
method patch (line 1318) | async def patch(
method patch (line 1335) | async def patch(
method publish (line 1352) | async def publish(
method unpublish (line 1371) | async def unpublish(
method get_public_settings (line 1388) | async def get_public_settings(
method get_public_available_settings (line 1404) | async def get_public_available_settings(
method update_public_settings (line 1420) | async def update_public_settings(
method update_public_settings (line 1438) | async def update_public_settings(
method mkdir (line 1454) | async def mkdir(
method makedirs (line 1471) | async def makedirs(
method remove (line 1489) | async def remove(
method remove (line 1511) | async def remove(
method move (line 1533) | async def move(
method move (line 1556) | async def move(
method move (line 1579) | async def move(
method move (line 1603) | async def move(
method rename (line 1627) | async def rename(
method rename (line 1650) | async def rename(
method rename (line 1673) | async def rename(
method rename (line 1697) | async def rename(
method copy (line 1721) | async def copy(
method copy (line 1744) | async def copy(
method copy (line 1767) | async def copy(
method copy (line 1791) | async def copy(
class ResourceObject (line 1815) | class ResourceObject(YaDiskObject):
method __init__ (line 1842) | def __init__(self, resource: Optional[Dict] = None, yadisk: Optional[A...
class SyncResourceObject (line 1846) | class SyncResourceObject(ResourceObject, ResourceObjectMethodsMixin):
method __init__ (line 1850) | def __init__(self, resource: Optional[Dict] = None, yadisk: Optional[A...
class AsyncResourceObject (line 1854) | class AsyncResourceObject(ResourceObject, AsyncResourceObjectMethodsMixin):
method __init__ (line 1858) | def __init__(self, resource: Optional[Dict] = None, yadisk: Optional[A...
class ResourceLinkObject (line 1862) | class ResourceLinkObject(LinkObject):
method __init__ (line 1870) | def __init__(self, link: Optional[Dict] = None, yadisk: Optional[Any] ...
method from_path (line 1874) | def from_path(cls, path: Optional[str], yadisk: Optional[Any] = None):
class SyncResourceLinkObject (line 1878) | class SyncResourceLinkObject(ResourceLinkObject, ResourceObjectMethodsMi...
class AsyncResourceLinkObject (line 1882) | class AsyncResourceLinkObject(ResourceLinkObject, AsyncResourceObjectMet...
class PublicResourceLinkObject (line 1886) | class PublicResourceLinkObject(LinkObject):
method __init__ (line 1894) | def __init__(self, link: Optional[Dict] = None, yadisk: Optional[Any] ...
method from_public_key (line 1898) | def from_public_key(cls, public_key: Optional[str], yadisk: Optional[A...
class SyncPublicResourceLinkObject (line 1901) | class SyncPublicResourceLinkObject(PublicResourceLinkObject, ResourceObj...
class AsyncPublicResourceLinkObject (line 1905) | class AsyncPublicResourceLinkObject(PublicResourceLinkObject, AsyncResou...
class ResourceListObject (line 1909) | class ResourceListObject(YaDiskObject):
method __init__ (line 1917) | def __init__(self, resource_list: Optional[Dict] = None, yadisk: Optio...
class SyncResourceListObject (line 1921) | class SyncResourceListObject(ResourceListObject):
method __init__ (line 1924) | def __init__(self, resource_list: Optional[Dict] = None, yadisk: Optio...
class AsyncResourceListObject (line 1928) | class AsyncResourceListObject(ResourceListObject):
method __init__ (line 1931) | def __init__(self, resource_list: Optional[Dict] = None, yadisk: Optio...
class ResourceUploadLinkObject (line 1935) | class ResourceUploadLinkObject(LinkObject):
method __init__ (line 1938) | def __init__(self,
class ResourceDownloadLinkObject (line 1944) | class ResourceDownloadLinkObject(LinkObject):
class ShareInfoObject (line 1948) | class ShareInfoObject(YaDiskObject):
method __init__ (line 1953) | def __init__(self, share_info: Optional[Dict] = None, yadisk: Optional...
class PublicResourceObject (line 1957) | class PublicResourceObject(ResourceObject):
method __init__ (line 1964) | def __init__(self, public_resource: Optional[Dict] = None, yadisk: Opt...
class SyncPublicResourceObject (line 1968) | class SyncPublicResourceObject(PublicResourceObject, ResourceObjectMetho...
method __init__ (line 1972) | def __init__(self, public_resource: Optional[Dict] = None, yadisk: Opt...
class AsyncPublicResourceObject (line 1976) | class AsyncPublicResourceObject(PublicResourceObject, AsyncResourceObjec...
method __init__ (line 1980) | def __init__(self, public_resource: Optional[Dict] = None, yadisk: Opt...
class PublicResourceListObject (line 1984) | class PublicResourceListObject(ResourceListObject):
method __init__ (line 1988) | def __init__(self,
class SyncPublicResourceListObject (line 1994) | class SyncPublicResourceListObject(PublicResourceListObject):
method __init__ (line 1997) | def __init__(self, public_resource_list: Optional[Dict] = None, yadisk...
class AsyncPublicResourceListObject (line 2001) | class AsyncPublicResourceListObject(PublicResourceListObject):
method __init__ (line 2004) | def __init__(self, public_resource_list: Optional[Dict] = None, yadisk...
class TrashResourceObject (line 2008) | class TrashResourceObject(ResourceObject):
method __init__ (line 2014) | def __init__(self,
class SyncTrashResourceObject (line 2020) | class SyncTrashResourceObject(TrashResourceObject):
method __init__ (line 2024) | def __init__(self,
method get_meta (line 2029) | def get_meta(
method exists (line 2052) | def exists(
method get_type (line 2069) | def get_type(
method is_dir (line 2086) | def is_dir(
method is_file (line 2103) | def is_file(
method listdir (line 2120) | def listdir(
method remove (line 2145) | def remove(
method remove (line 2168) | def remove(
method restore (line 2191) | def restore(
method restore (line 2215) | def restore(
method restore (line 2239) | def restore(
method restore (line 2264) | def restore(
class AsyncTrashResourceObject (line 2289) | class AsyncTrashResourceObject(TrashResourceObject):
method __init__ (line 2293) | def __init__(self,
method get_meta (line 2298) | async def get_meta(
method exists (line 2320) | async def exists(
method get_type (line 2336) | async def get_type(
method is_dir (line 2352) | async def is_dir(
method is_file (line 2368) | async def is_file(
method listdir (line 2384) | async def listdir(
method remove (line 2410) | async def remove(
method remove (line 2432) | async def remove(
method restore (line 2454) | async def restore(
method restore (line 2477) | async def restore(
method restore (line 2500) | async def restore(
method restore (line 2524) | async def restore(
class TrashResourceListObject (line 2548) | class TrashResourceListObject(ResourceListObject):
method __init__ (line 2551) | def __init__(self,
class SyncTrashResourceListObject (line 2557) | class SyncTrashResourceListObject(TrashResourceListObject):
method __init__ (line 2560) | def __init__(self,
class AsyncTrashResourceListObject (line 2566) | class AsyncTrashResourceListObject(TrashResourceListObject):
method __init__ (line 2569) | def __init__(self,
class PublicSettingsObject (line 2575) | class PublicSettingsObject(YaDiskObject):
method __init__ (line 2585) | def __init__(
class AvailableUntilVerboseObject (line 2593) | class AvailableUntilVerboseObject(YaDiskObject):
method __init__ (line 2597) | def __init__(
class PasswordVerboseObject (line 2605) | class PasswordVerboseObject(YaDiskObject):
method __init__ (line 2609) | def __init__(
class ExternalOrganizationIdVerboseObject (line 2617) | class ExternalOrganizationIdVerboseObject(YaDiskObject):
method __init__ (line 2621) | def __init__(
class PublicAccessObject (line 2629) | class PublicAccessObject(YaDiskObject):
method __init__ (line 2647) | def __init__(
class PublicAvailableSettingsObject (line 2655) | class PublicAvailableSettingsObject(YaDiskObject):
method __init__ (line 2662) | def __init__(
class PublicDefaultObject (line 2670) | class PublicDefaultObject(YaDiskObject):
method __init__ (line 2675) | def __init__(
FILE: src/yadisk/objects/_yadisk_object.py
class YaDiskObject (line 25) | class YaDiskObject:
method __init__ (line 40) | def __init__(self,
method __dir__ (line 53) | def __dir__(self) -> Generator[str, None, None]:
method set_field_types (line 62) | def set_field_types(self, field_types: dict) -> None:
method set_field_type (line 71) | def set_field_type(self, field: str, type: Callable) -> None:
method set_alias (line 81) | def set_alias(self, alias: str, name: str) -> None:
method remove_alias (line 91) | def remove_alias(self, alias: str) -> None:
method remove_field (line 100) | def remove_field(self, field: str) -> None:
method import_fields (line 110) | def import_fields(self, source_dict: Optional[dict]) -> None:
method __setattr__ (line 131) | def __setattr__(self, attr: str, value: Any) -> None:
method __getattr__ (line 144) | def __getattr__(self, attr: str) -> Any:
method __getitem__ (line 152) | def __getitem__(self, key: str) -> Any:
method __setitem__ (line 160) | def __setitem__(self, key: str, value: Any) -> None:
method __delitem__ (line 163) | def __delitem__(self, key: str) -> None:
method __iter__ (line 171) | def __iter__(self) -> Iterator[dict]:
method __len__ (line 174) | def __len__(self) -> int:
method __repr__ (line 177) | def __repr__(self) -> str:
method _repr_pretty_ (line 180) | def _repr_pretty_(self, p, cycle: bool) -> None:
method field (line 202) | def field(self, name: str) -> Any:
method __matmul__ (line 221) | def __matmul__(self, name: str) -> Any:
FILE: src/yadisk/sessions/_httpx_common.py
function convert_httpx_exception (line 35) | def convert_httpx_exception(exc: httpx.HTTPError) -> Union[RequestError,...
function convert_timeout (line 48) | def convert_timeout(timeout: TimeoutParameter) -> Optional[httpx.Timeout]:
function convert_args_for_httpx (line 61) | def convert_args_for_httpx(
FILE: src/yadisk/sessions/aiohttp_session.py
function convert_aiohttp_exception (line 42) | def convert_aiohttp_exception(exc: aiohttp.ClientError) -> Union[Request...
class AIOHTTPResponse (line 55) | class AIOHTTPResponse(AsyncResponse):
method __init__ (line 56) | def __init__(self, response: aiohttp.ClientResponse):
method json (line 62) | async def json(self) -> JSON:
method download (line 70) | async def download(self, consume_callback: AsyncConsumeCallback) -> None:
method close (line 83) | async def close(self) -> None:
function convert_timeout (line 87) | def convert_timeout(timeout: TimeoutParameter) -> Optional[aiohttp.Clien...
class AIOHTTPSession (line 105) | class AIOHTTPSession(AsyncSession):
method __init__ (line 134) | def __init__(self, *args, **kwargs) -> None:
method aiohttp_session (line 149) | def aiohttp_session(self) -> aiohttp.ClientSession:
method send_request (line 152) | async def send_request(
method close (line 179) | async def close(self) -> None:
FILE: src/yadisk/sessions/async_httpx_session.py
class AsyncHTTPXResponse (line 32) | class AsyncHTTPXResponse(AsyncResponse):
method __init__ (line 33) | def __init__(self, response: httpx.Response):
method json (line 39) | async def json(self) -> JSON:
method download (line 49) | async def download(self, consume_callback: AsyncConsumeCallback) -> None:
method close (line 62) | async def close(self) -> None:
class AsyncHTTPXSession (line 66) | class AsyncHTTPXSession(AsyncSession):
method __init__ (line 99) | def __init__(self, *args, **kwargs):
method httpx_session (line 104) | def httpx_session(self) -> httpx.AsyncClient:
method send_request (line 107) | async def send_request(self, method: HTTPMethod, url: str, **kwargs) -...
method close (line 116) | async def close(self) -> None:
FILE: src/yadisk/sessions/httpx_session.py
class HTTPXResponse (line 29) | class HTTPXResponse(Response):
method __init__ (line 30) | def __init__(self, response: httpx.Response):
method json (line 36) | def json(self) -> JSON:
method download (line 46) | def download(self, consume_callback: ConsumeCallback) -> None:
method close (line 53) | def close(self) -> None:
class HTTPXSession (line 57) | class HTTPXSession(Session):
method __init__ (line 88) | def __init__(self, *args, **kwargs):
method httpx_client (line 93) | def httpx_client(self) -> httpx.Client:
method send_request (line 96) | def send_request(self, method: HTTPMethod, url: str, **kwargs) -> Resp...
method close (line 105) | def close(self) -> None:
FILE: src/yadisk/sessions/pycurl_session.py
function convert_curl_error (line 41) | def convert_curl_error(error: pycurl.error) -> RequestError:
class PycURLResponse (line 57) | class PycURLResponse(Response):
method __init__ (line 58) | def __init__(self, curl: pycurl.Curl, response: bytes):
method _update_status (line 66) | def _update_status(self) -> None:
method _perform (line 69) | def _perform(self) -> None:
method _perform_rb (line 77) | def _perform_rb(self) -> None:
method json (line 85) | def json(self) -> JSON:
method download (line 91) | def download(self, consume_callback: ConsumeCallback) -> None:
method close (line 122) | def close(self) -> None:
class IterableReader (line 126) | class IterableReader:
method __init__ (line 127) | def __init__(self, iterator: Iterator[bytes]):
method read (line 132) | def read(self, size=-1) -> bytes:
method readall (line 155) | def readall(self) -> bytes:
function convert_timeout (line 173) | def convert_timeout(timeout: TimeoutParameter) -> Tuple[float, float]:
class PycURLSession (line 201) | class PycURLSession(Session):
method __init__ (line 229) | def __init__(self) -> None:
method send_request (line 236) | def send_request(
method close (line 311) | def close(self) -> None:
FILE: src/yadisk/sessions/requests_session.py
function convert_requests_exception (line 38) | def convert_requests_exception(exc: requests.RequestException) -> Union[...
class RequestsResponse (line 51) | class RequestsResponse(Response):
method __init__ (line 52) | def __init__(self, response: requests.Response):
method json (line 58) | def json(self) -> JSON:
method download (line 64) | def download(self, consume_callback: ConsumeCallback) -> None:
method close (line 71) | def close(self) -> None:
class RequestsSession (line 75) | class RequestsSession(Session):
method __init__ (line 111) | def __init__(self, *args, **kwargs):
method requests_session (line 117) | def requests_session(self) -> requests.Session:
method _close_local (line 124) | def _close_local(self) -> None:
method send_request (line 133) | def send_request(
method close (line 168) | def close(self) -> None:
FILE: src/yadisk/types.py
class AsyncFileLike (line 106) | class AsyncFileLike(Protocol):
method read (line 112) | async def read(self, size: int = ..., /) -> Union[str, bytes]:
method write (line 121) | async def write(self, buffer: Any, /) -> int:
method seek (line 130) | async def seek(self, pos: int, whence: int = ..., /) -> int:
method tell (line 142) | async def tell(self) -> int:
class BinaryAsyncFileLike (line 151) | class BinaryAsyncFileLike(Protocol):
method read (line 157) | async def read(self, size: int = ..., /) -> bytes:
method write (line 166) | async def write(self, buffer: Any, /) -> int:
method seek (line 175) | async def seek(self, pos: int, whence: int = ..., /) -> int:
method tell (line 187) | async def tell(self) -> int:
class PublicSettings (line 269) | class PublicSettings(TypedDict, total=False):
class AvailableUntilVerbose (line 303) | class AvailableUntilVerbose(TypedDict):
class PasswordVerbose (line 315) | class PasswordVerbose(TypedDict):
class ExternalOrganizationIdVerbose (line 327) | class ExternalOrganizationIdVerbose(TypedDict):
class PublicSettingsAccess (line 339) | class PublicSettingsAccess(TypedDict, total=False):
FILE: src/yadisk/utils.py
class _UnexpectedRequestError (line 37) | class _UnexpectedRequestError(YaDiskError):
function _add_exception_note (line 43) | def _add_exception_note(exc: Exception, note: str) -> None:
function _add_exception_note (line 46) | def _add_exception_note(exc: Exception, note: str) -> None:
function get_exception (line 111) | def get_exception(response: AnyResponse, error: Optional[ErrorObject]) -...
function auto_retry (line 165) | def auto_retry(
function async_auto_retry (line 227) | async def async_auto_retry(
class CaseInsensitiveDict (line 297) | class CaseInsensitiveDict(dict):
method _k (line 301) | def _k(cls, key: str) -> str:
method __init__ (line 304) | def __init__(self, *args, **kwargs):
method __getitem__ (line 308) | def __getitem__(self, key: str) -> Any:
method __setitem__ (line 311) | def __setitem__(self, key: str, value: Any) -> None:
method __delitem__ (line 314) | def __delitem__(self, key: str) -> Any:
method __contains__ (line 317) | def __contains__(self, key: Any) -> bool:
method pop (line 320) | def pop(self, key: str, /, *args, **kwargs) -> Any:
method get (line 323) | def get(self, key: str, /, *args, **kwargs) -> Any:
method setdefault (line 326) | def setdefault(self, key: str, *args, **kwargs) -> Any:
method update (line 329) | def update(self, *args, **kwargs) -> None:
method _convert_keys (line 332) | def _convert_keys(self) -> None:
FILE: tests/async_client_test.py
function open_tmpfile (line 30) | def open_tmpfile(mode):
function async_open_tmpfile (line 38) | def async_open_tmpfile(mode):
class TestAsyncClient (line 47) | class TestAsyncClient:
method test_get_disk_info (line 53) | async def test_get_disk_info(self, async_client: yadisk.AsyncClient) -...
method test_get_meta (line 64) | async def test_get_meta(self, async_client: yadisk.AsyncClient, disk_r...
method test_listdir (line 75) | async def test_listdir(self, async_client: yadisk.AsyncClient, disk_ro...
method test_listdir_fields (line 92) | async def test_listdir_fields(self, async_client: yadisk.AsyncClient, ...
method test_listdir_on_file (line 108) | async def test_listdir_on_file(self, async_client: yadisk.AsyncClient,...
method test_listdir_with_limits (line 121) | async def test_listdir_with_limits(self, async_client: yadisk.AsyncCli...
method test_listdir_with_max_items (line 136) | async def test_listdir_with_max_items(self, async_client: yadisk.Async...
method test_mkdir_and_exists (line 163) | async def test_mkdir_and_exists(self, async_client: yadisk.AsyncClient...
method _test_makedirs (line 177) | async def _test_makedirs(self, async_client: yadisk.AsyncClient, disk_...
method test_makedirs_without_scheme (line 202) | async def test_makedirs_without_scheme(self, async_client: yadisk.Asyn...
method test_makedirs_with_scheme (line 206) | async def test_makedirs_with_scheme(self, async_client: yadisk.AsyncCl...
method test_upload_and_download (line 215) | async def test_upload_and_download(
method test_upload_and_download_async (line 248) | async def test_upload_and_download_async(self, async_client: yadisk.As...
method test_check_token (line 279) | async def test_check_token(self, async_client: yadisk.AsyncClient, dis...
method test_permanent_remove (line 284) | async def test_permanent_remove(self, async_client: yadisk.AsyncClient...
method test_restore_trash (line 295) | async def test_restore_trash(self, async_client: yadisk.AsyncClient, d...
method test_move (line 319) | async def test_move(self, async_client: yadisk.AsyncClient, disk_root:...
method test_rename (line 328) | async def test_rename(self, async_client: yadisk.AsyncClient, disk_roo...
method test_rename_edgecases (line 353) | async def test_rename_edgecases(self, async_client: yadisk.AsyncClient...
method test_remove_trash (line 392) | async def test_remove_trash(self, async_client: yadisk.AsyncClient, di...
method test_publish_unpublish (line 412) | async def test_publish_unpublish(self, async_client: yadisk.AsyncClien...
method test_public_settings (line 437) | async def test_public_settings(self, async_client: yadisk.AsyncClient,...
method test_patch (line 468) | async def test_patch(self, async_client: yadisk.AsyncClient, disk_root...
method test_issue7 (line 479) | async def test_issue7(self, async_client: yadisk.AsyncClient, disk_roo...
method test_is_operation_link (line 487) | def test_is_operation_link(self) -> None:
method test_get_operation_status_request_url (line 494) | async def test_get_operation_status_request_url(self, async_client: ya...
method test_is_file (line 513) | async def test_is_file(self, async_client: yadisk.AsyncClient, disk_ro...
method test_ensure_path_has_scheme (line 525) | def test_ensure_path_has_scheme(self) -> None:
method test_upload_download_non_seekable (line 536) | async def test_upload_download_non_seekable(
method test_copy (line 566) | async def test_copy(
method test_save_to_disk (line 598) | async def test_save_to_disk(
method test_upload_url (line 628) | async def test_upload_url(
method test_none_args (line 648) | async def test_none_args(self, async_client: yadisk.AsyncClient) -> None:
method test_get_files (line 673) | async def test_get_files(self, async_client: yadisk.AsyncClient) -> None:
method test_get_last_uploaded (line 694) | async def test_get_last_uploaded(
method test_public_listdir (line 720) | async def test_public_listdir(
method test_get_public_resources (line 763) | async def test_get_public_resources(self, async_client: yadisk.AsyncCl...
method test_get_upload_link_object (line 777) | async def test_get_upload_link_object(self, async_client: yadisk.Async...
method test_streaming_requests (line 792) | async def test_streaming_requests(self, async_client: yadisk.AsyncClie...
method test_wait_for_operation (line 803) | async def test_wait_for_operation(
method test_download_by_link_error (line 830) | async def test_download_by_link_error(self, async_client: yadisk.Async...
method test_operation_error_triggers_retry (line 847) | async def test_operation_error_triggers_retry(
FILE: tests/auth_test.py
function test_auth (line 23) | def test_auth(client: yadisk.Client) -> None:
function test_device_code_auth (line 45) | def test_device_code_auth(client: yadisk.Client) -> None:
function test_auth_async (line 70) | async def test_auth_async(async_client: yadisk.AsyncClient) -> None:
function test_device_code_auth_async (line 92) | async def test_device_code_auth_async(async_client: yadisk.AsyncClient) ...
FILE: tests/auto_retry_test.py
function test_auto_retry (line 7) | async def test_auto_retry() -> None:
function test_auto_retry_with_disable_retries (line 62) | async def test_auto_retry_with_disable_retries() -> None:
function test_auto_retry_without_errors (line 86) | async def test_auto_retry_without_errors() -> None:
FILE: tests/client_test.py
function open_tmpfile (line 27) | def open_tmpfile(mode):
class TestClient (line 35) | class TestClient:
method test_get_disk_info (line 41) | def test_get_disk_info(self, client: yadisk.Client) -> None:
method test_get_meta (line 52) | def test_get_meta(self, client: yadisk.Client, disk_root: str) -> None:
method test_listdir (line 63) | def test_listdir(self, client: yadisk.Client, disk_root: str) -> None:
method test_listdir_fields (line 81) | def test_listdir_fields(self, client: yadisk.Client, disk_root: str) -...
method test_listdir_on_file (line 94) | def test_listdir_on_file(self, client: yadisk.Client, disk_root: str) ...
method test_listdir_with_limits (line 107) | def test_listdir_with_limits(self, client: yadisk.Client, disk_root: s...
method test_listdir_with_max_items (line 120) | def test_listdir_with_max_items(self, client: yadisk.Client, disk_root...
method test_mkdir_and_exists (line 147) | def test_mkdir_and_exists(self, client: yadisk.Client, disk_root: str)...
method _test_makedirs (line 159) | def _test_makedirs(self, client: yadisk.Client, disk_root: str) -> None:
method test_makedirs_without_scheme (line 184) | def test_makedirs_without_scheme(self, client: yadisk.Client, disk_roo...
method test_makedirs_with_scheme (line 188) | def test_makedirs_with_scheme(self, client: yadisk.Client, disk_root: ...
method test_upload_and_download (line 196) | def test_upload_and_download(self, client: yadisk.Client, disk_root: s...
method test_check_token (line 212) | def test_check_token(self, client: yadisk.Client, disk_root: str) -> N...
method test_permanent_remove (line 217) | def test_permanent_remove(self, client: yadisk.Client, disk_root: str)...
method test_restore_trash (line 228) | def test_restore_trash(self, client: yadisk.Client, disk_root: str) ->...
method test_move (line 252) | def test_move(self, client: yadisk.Client, disk_root: str) -> None:
method test_rename (line 261) | def test_rename(self, client: yadisk.Client, disk_root: str) -> None:
method test_rename_edgecases (line 286) | def test_rename_edgecases(self, client: yadisk.Client, mocker) -> None:
method test_remove_trash (line 325) | def test_remove_trash(self, client: yadisk.Client, disk_root: str) -> ...
method test_publish_unpublish (line 345) | def test_publish_unpublish(self, client: yadisk.Client, disk_root: str...
method test_public_settings (line 371) | def test_public_settings(self, client: yadisk.Client, disk_root: str) ...
method test_patch (line 402) | def test_patch(self, client: yadisk.Client, disk_root: str) -> None:
method test_issue7 (line 413) | def test_issue7(self, client: yadisk.Client, disk_root: str) -> None:
method test_is_operation_link (line 421) | def test_is_operation_link(self) -> None:
method test_get_operation_status_request_url (line 428) | def test_get_operation_status_request_url(self, client: yadisk.Client,...
method test_ensure_path_has_scheme (line 446) | def test_ensure_path_has_scheme(self) -> None:
method test_upload_download_non_seekable (line 457) | def test_upload_download_non_seekable(
method test_upload_generator (line 489) | def test_upload_generator(self, client: yadisk.Client, disk_root: str)...
method test_copy (line 507) | def test_copy(
method test_save_to_disk (line 539) | def test_save_to_disk(
method test_upload_url (line 569) | def test_upload_url(
method test_none_args (line 589) | def test_none_args(self, client: yadisk.Client) -> None:
method test_get_files (line 614) | def test_get_files(self, client: yadisk.Client) -> None:
method test_get_last_uploaded (line 635) | def test_get_last_uploaded(self, client: yadisk.Client, disk_root: str...
method test_public_listdir (line 655) | def test_public_listdir(self, client: yadisk.Client, disk_root: str) -...
method test_get_public_resources (line 694) | def test_get_public_resources(self, client: yadisk.Client) -> None:
method test_get_upload_link_object (line 704) | def test_get_upload_link_object(self, client: yadisk.Client, disk_root...
method test_streaming_requests (line 715) | def test_streaming_requests(self, client: yadisk.Client) -> None:
method test_wait_for_operation (line 722) | def test_wait_for_operation(
method test_download_by_link_error (line 746) | def test_download_by_link_error(self, client: yadisk.Client) -> None:
method test_operation_error_triggers_retry (line 763) | def test_operation_error_triggers_retry(
FILE: tests/conftest.py
function gateway_host (line 17) | def gateway_host() -> str:
function gateway_port (line 22) | def gateway_port() -> int:
function gateway (line 27) | def gateway(gateway_host: str, gateway_port: int) -> Generator[Backgroun...
function disk_root (line 42) | def disk_root(request: pytest.FixtureRequest) -> str:
function disk_cleanup (line 59) | def disk_cleanup(
function async_disk_cleanup (line 85) | async def async_disk_cleanup(
function replay_enabled (line 111) | def replay_enabled() -> bool:
function recording_enabled (line 116) | def recording_enabled() -> bool:
function record_or_replay (line 121) | def record_or_replay(
function client (line 150) | def client(
function async_client (line 196) | async def async_client(
function anyio_backend (line 242) | def anyio_backend() -> str:
function sync_client_test (line 247) | def sync_client_test(record_or_replay, disk_cleanup) -> None:
function async_client_test (line 252) | def async_client_test(record_or_replay, async_disk_cleanup) -> None:
function poll_interval (line 257) | def poll_interval(replay_enabled: bool) -> float:
FILE: tests/disk_gateway.py
function get_upload_base_url (line 38) | def get_upload_base_url(subdomain: str) -> str:
function select_keys (line 42) | def select_keys(d, keys):
function serialize_content (line 46) | def serialize_content(content: bytes) -> str:
function deserialize_content (line 50) | def deserialize_content(content: str) -> bytes:
function serialize_request (line 54) | def serialize_request(request: httpx.Request, response: httpx.Response):
function deserialize_request (line 64) | def deserialize_request(request: dict):
function deserialize_response (line 76) | def deserialize_response(response: dict) -> httpx.Response:
function serialize_response (line 84) | def serialize_response(response: httpx.Response):
class UnexpectedRequestResponse (line 92) | class UnexpectedRequestResponse(JSONResponse):
method __init__ (line 93) | def __init__(self, message: str) -> None:
class DiskGateway (line 104) | class DiskGateway:
method __init__ (line 105) | def __init__(self):
method on_shutdown (line 196) | async def on_shutdown(self):
method update_token_map (line 199) | async def update_token_map(self, request: Request):
method clear_token_map (line 211) | async def clear_token_map(self, request: Request):
method forward_request (line 215) | async def forward_request(self, request: Request, base_url: str):
method replay_response (line 253) | async def replay_response(self, request: Request, base_url: str):
method disk_gateway (line 335) | async def disk_gateway(self, request: Request):
method auth_gateway (line 338) | async def auth_gateway(self, request: Request):
method download_gateway (line 341) | async def download_gateway(self, request: Request):
method upload_gateway (line 344) | async def upload_gateway(self, request: Request):
method disk_replay (line 349) | async def disk_replay(self, request: Request):
method auth_replay (line 352) | async def auth_replay(self, request: Request):
method download_replay (line 355) | async def download_replay(self, request: Request):
method upload_replay (line 358) | async def upload_replay(self, request: Request):
method start_recording (line 363) | async def start_recording(self, request: Request):
method stop_recording (line 368) | async def stop_recording(self, request: Request):
method clear_recorded_requests (line 373) | async def clear_recorded_requests(self, request: Request):
method dump_recorded_requests (line 379) | async def dump_recorded_requests(self, request: Request):
method set_replay_index (line 382) | async def set_replay_index(self, request: Request):
method set_replay (line 387) | async def set_replay(self, request: Request):
method check_status (line 393) | async def check_status(self, request: Request):
method stop (line 396) | def stop(self):
method run (line 400) | async def run(self, host: str, port: int):
function main (line 412) | async def main(args: list) -> None:
class DiskGatewayClient (line 422) | class DiskGatewayClient:
method __init__ (line 423) | def __init__(self, base_url: str):
method __enter__ (line 427) | def __enter__(self):
method __exit__ (line 431) | def __exit__(self, *args, **kwargs):
method close (line 434) | def close(self):
method start_recording (line 437) | def start_recording(self):
method stop_recording (line 440) | def stop_recording(self):
method clear_recorded_requests (line 443) | def clear_recorded_requests(self):
method dump_recorded_requests (line 446) | def dump_recorded_requests(self):
method set_replay_index (line 449) | def set_replay_index(self, index: int):
method set_replay (line 452) | def set_replay(self, json: Any):
method is_running (line 455) | def is_running(self) -> bool:
method update_token_map (line 461) | def update_token_map(self, tokens: dict):
method clear_token_map (line 464) | def clear_token_map(self):
method record_as (line 468) | def record_as(self, filename: str):
method replay (line 481) | def replay(self, filename: str):
class BackgroundGatewayThread (line 491) | class BackgroundGatewayThread:
method __init__ (line 492) | def __init__(self, host: str, port: int):
method start (line 502) | def start(self):
method stop (line 508) | def stop(self):
FILE: tests/import_session_test.py
function available_session_names (line 11) | def available_session_names() -> List[str]:
function available_async_session_names (line 16) | def available_async_session_names() -> List[str]:
function test_import_session (line 24) | def test_import_session(
function test_import_async_session (line 37) | def test_import_async_session(
function test_import_unknown_session (line 46) | def test_import_unknown_session() -> None:
function test_default_imported_session (line 54) | def test_default_imported_session() -> None:
FILE: tests/test_session.py
function _ensure_trailing_slash (line 12) | def _ensure_trailing_slash(s: str) -> str:
class TestSession (line 18) | class TestSession(yadisk.Session):
method __init__ (line 21) | def __init__(
method send_request (line 35) | def send_request(self, method: HTTPMethod, url: str, **kwargs) -> yadi...
method close (line 63) | def close(self) -> None:
class AsyncTestSession (line 66) | class AsyncTestSession(yadisk.AsyncSession):
method __init__ (line 69) | def __init__(
method send_request (line 83) | async def send_request(self, method: HTTPMethod, url: str, **kwargs) -...
method close (line 111) | async def close(self) -> None:
Condensed preview — 172 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (2,556K chars).
[
{
"path": ".gitattributes",
"chars": 14,
"preview": "*.json binary\n"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report--english-.md",
"chars": 646,
"preview": "---\nname: Bug report (English)\nabout: Create a report to help improve the library\ntitle: \"[Bug] <issue title>\"\nlabels: b"
},
{
"path": ".github/ISSUE_TEMPLATE/bug-report--русский-.md",
"chars": 691,
"preview": "---\nname: Bug report (Русский)\nabout: Создать баг репорт, чтобы помочь улучшить библиотеку\ntitle: \"[Bug] <название issue"
},
{
"path": ".github/ISSUE_TEMPLATE/feature-request--english-.md",
"chars": 447,
"preview": "---\nname: Feature request (English)\nabout: Suggest an idea for this project\ntitle: \"[Feature Request] <issue title>\"\nlab"
},
{
"path": ".github/ISSUE_TEMPLATE/feature-request--русский-.md",
"chars": 405,
"preview": "---\nname: Feature request (Русский)\nabout: Предложить идею\ntitle: \"[Feature Request] <название issue>\"\nlabels: enhanceme"
},
{
"path": ".github/ISSUE_TEMPLATE/question--english-.md",
"chars": 204,
"preview": "---\nname: Question (English)\nabout: Ask a question\ntitle: \"[Question] <issue title>\"\nlabels: language-english, question\n"
},
{
"path": ".github/ISSUE_TEMPLATE/question--русский-.md",
"chars": 208,
"preview": "---\nname: Question (Русский)\nabout: Задать вопрос\ntitle: \"[Question] <название issue>\"\nlabels: language-russian, questio"
},
{
"path": ".github/workflows/lint_and_test.yml",
"chars": 2405,
"preview": "name: Perform linting and run tests\n\npermissions:\n contents: read\n\non:\n push:\n branches:\n - master\n - dev"
},
{
"path": ".gitignore",
"chars": 124,
"preview": ".*.sw[a-z]\n*.py[co]\ndist/\nbuild/\nyadisk.egg-info/\ndocs/_build\n.venv/\npyrightconfig.json\n.vim/\n.coverage\n.tool-versions\n*"
},
{
"path": ".readthedocs.yaml",
"chars": 580,
"preview": "# .readthedocs.yaml\n# Read the Docs configuration file\n# See https://docs.readthedocs.io/en/stable/config-file/v2.html f"
},
{
"path": "CONTRIBUTING.rst",
"chars": 10857,
"preview": "Contributing\n============\n\n.. contents:: Table of contents:\n\nBug reports, feedback, questions, feature requests, etc.\n**"
},
{
"path": "CONTRIBUTORS.rst",
"chars": 413,
"preview": "Contributors\n============\n\n- Ivan Konovalov (`@ivknv <https://github.com/ivknv>`_) (author, maintainer)\n- Yuri Kobets (`"
},
{
"path": "COPYING",
"chars": 35147,
"preview": " GNU GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 Free "
},
{
"path": "COPYING.lesser",
"chars": 7649,
"preview": " GNU LESSER GENERAL PUBLIC LICENSE\n Version 3, 29 June 2007\n\n Copyright (C) 2007 F"
},
{
"path": "MANIFEST.in",
"chars": 155,
"preview": "include COPYING\ninclude COPYING.lesser\ninclude CONTRIBUTORS.rst\ninclude README.rst\ninclude README.en.rst\ninclude README."
},
{
"path": "README.en.rst",
"chars": 24702,
"preview": "YaDisk\n======\n\n.. |RTD Badge| image:: https://img.shields.io/readthedocs/yadisk.svg\n :alt: Read the Docs\n :target: h"
},
{
"path": "README.rst",
"chars": 25555,
"preview": "YaDisk\n======\n\n.. |RTD Badge| image:: https://img.shields.io/readthedocs/yadisk.svg\n :alt: Read the Docs\n :target: h"
},
{
"path": "README.ru.rst",
"chars": 25555,
"preview": "YaDisk\n======\n\n.. |RTD Badge| image:: https://img.shields.io/readthedocs/yadisk.svg\n :alt: Read the Docs\n :target: h"
},
{
"path": "docs/Makefile",
"chars": 606,
"preview": "# Minimal makefile for Sphinx documentation\n#\n\n# You can set these variables from the command line.\nSPHINXOPTS =\nSPHI"
},
{
"path": "docs/api_reference/async_api.rst",
"chars": 3727,
"preview": "Asynchronous API\n================\n\n.. autoclass:: yadisk.AsyncClient\n\n .. automethod:: close\n\n.. autoclass:: yadisk.As"
},
{
"path": "docs/api_reference/exceptions.rst",
"chars": 92,
"preview": "Exceptions\n==========\n\n.. automodule:: yadisk.exceptions\n :members:\n :show-inheritance:\n"
},
{
"path": "docs/api_reference/index.rst",
"chars": 208,
"preview": "API Reference\n=============\n\n.. toctree::\n :maxdepth: 1\n :caption: Contents:\n\n sync_api\n async_api\n types\n s"
},
{
"path": "docs/api_reference/response_objects.rst",
"chars": 133,
"preview": "Response Objects\n================\n\n.. automodule:: yadisk.objects\n :members:\n :special-members: __matmul__\n :show-"
},
{
"path": "docs/api_reference/session_interface.rst",
"chars": 699,
"preview": "Session Interface\n=================\n\nThe :any:`Session` and :any:`AsyncSession` are abstract classes that act as adapter"
},
{
"path": "docs/api_reference/sessions.rst",
"chars": 1265,
"preview": "Available Session Implementations\n=================================\n\nYou can choose which HTTP library will be used by :"
},
{
"path": "docs/api_reference/settings.rst",
"chars": 178,
"preview": "Settings\n========\n\nThe following settings can be accessed and changed at runtime in `yadisk.settings` module:\n\n.. automo"
},
{
"path": "docs/api_reference/sync_api.rst",
"chars": 3431,
"preview": "Synchronous API\n===============\n\n.. autoclass:: yadisk.Client\n\n .. automethod:: close\n\n.. autoclass:: yadisk.YaDisk\n\nA"
},
{
"path": "docs/api_reference/types.rst",
"chars": 77,
"preview": "Types\n=====\n\n.. automodule:: yadisk.types\n :members:\n :show-inheritance:\n"
},
{
"path": "docs/api_reference/utilities.rst",
"chars": 63,
"preview": "Utilities\n=========\n\n.. automodule:: yadisk.utils\n :members:\n"
},
{
"path": "docs/changelog.rst",
"chars": 18339,
"preview": "Changelog\n=========\n\n.. _issue #2: https://github.com/ivknv/yadisk/issues/2\n.. _issue #4: https://github.com/ivknv/yadis"
},
{
"path": "docs/conf.py",
"chars": 5567,
"preview": "#!/usr/bin/env python3\n# -*- coding: utf-8 -*-\n#\n# YaDisk documentation build configuration file, created by\n# sphinx-qu"
},
{
"path": "docs/index.rst",
"chars": 513,
"preview": ".. YaDisk documentation master file, created by\n sphinx-quickstart on Sun Oct 1 19:06:55 2017.\n You can adapt this "
},
{
"path": "docs/intro.rst",
"chars": 12563,
"preview": "Introduction\n============\n\nYaDisk is a Yandex.Disk REST API client library.\n\nInstallation\n************\n\n:code:`yadisk` s"
},
{
"path": "docs/known_issues.rst",
"chars": 2094,
"preview": "Known Issues\n============\n\nVery Slow Upload of Certain Types of Files\n##########################################\n\nYandex"
},
{
"path": "docs/locales/ru/LC_MESSAGES/api_reference.po",
"chars": 340573,
"preview": "# api_reference/*.rst translations.\n# Copyright (C) 2025, Ivan Konovalov\n# This file is distributed under the same licen"
},
{
"path": "docs/locales/ru/LC_MESSAGES/changelog.po",
"chars": 44159,
"preview": "# changelog.rst translations\n# Copyright (C) 2026, Ivan Konovalov\n# This file is distributed under the same license as t"
},
{
"path": "docs/locales/ru/LC_MESSAGES/index.po",
"chars": 1027,
"preview": "# index.rst translations.\n# Copyright (C) 2023, Ivan Konovalov\n# This file is distributed under the same license as the "
},
{
"path": "docs/locales/ru/LC_MESSAGES/intro.po",
"chars": 3667,
"preview": "# intro.rst translations.\n# Copyright (C) 2023, Ivan Konovalov\n# This file is distributed under the same license as the "
},
{
"path": "docs/locales/ru/LC_MESSAGES/known_issues.po",
"chars": 5335,
"preview": "# known_issues.rst translations.\n# Copyright (C) 2025, Ivan Konovalov\n# This file is distributed under the same license "
},
{
"path": "docs/locales/ru/LC_MESSAGES/migration_guide.po",
"chars": 11649,
"preview": "# migration_guide.rst translations.\n# Copyright (C) 2024, Ivan Konovalov\n# This file is distributed under the same licen"
},
{
"path": "docs/make.bat",
"chars": 804,
"preview": "@ECHO OFF\r\n\r\npushd %~dp0\r\n\r\nREM Command file for Sphinx documentation\r\n\r\nif \"%SPHINXBUILD%\" == \"\" (\r\n\tset SPHINXBUILD=py"
},
{
"path": "docs/migration_guide.rst",
"chars": 5148,
"preview": "Migration Guide\n===============\n\nMigrating From 2.x to 3.x\n#########################\n\nWaiting for asynchronous operation"
},
{
"path": "docs/requirements.in",
"chars": 185,
"preview": "# It is expected that the install command is running from the parent directory\n-e .[async_files,aiohttp,httpx,pycurl,req"
},
{
"path": "docs/requirements.txt",
"chars": 2398,
"preview": "#\n# This file is autogenerated by pip-compile with Python 3.9\n# by the following command:\n#\n# pip-compile --output-fi"
},
{
"path": "pyproject.toml",
"chars": 2144,
"preview": "[build-system]\nrequires = [\"setuptools\"]\nbuild-backend = \"setuptools.build_meta\"\n\n[tool.setuptools]\npackage-dir = {\"\" = "
},
{
"path": "requirements-dev.in",
"chars": 437,
"preview": "-e .[async-files,aiohttp,httpx,pycurl,requests]\n\n# Stub packages\ntypes-aiofiles\ntypes-requests\ntypes-pycurl\n\n# Tests\npyt"
},
{
"path": "requirements-dev.txt",
"chars": 4978,
"preview": "#\n# This file is autogenerated by pip-compile with Python 3.9\n# by the following command:\n#\n# pip-compile --output-fi"
},
{
"path": "src/yadisk/__init__.py",
"chars": 1306,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2025 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_api/__init__.py",
"chars": 878,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_api/api_request.py",
"chars": 9086,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_api/auth.py",
"chars": 7531,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_api/disk.py",
"chars": 2158,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_api/operations.py",
"chars": 2701,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_api/resources.py",
"chars": 45450,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2025 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_async_client.py",
"chars": 135585,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_async_client.pyi",
"chars": 43380,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_async_session.py",
"chars": 5838,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_client.py",
"chars": 135869,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2025 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_client.pyi",
"chars": 45728,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_client_common.py",
"chars": 3756,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_common.py",
"chars": 4951,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_import_session.py",
"chars": 3055,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_session.py",
"chars": 5469,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/_typing_compat.py",
"chars": 1848,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/exceptions.py",
"chars": 8840,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2025 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/__init__.py",
"chars": 2944,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_auth.py",
"chars": 4255,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_disk.py",
"chars": 10492,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_error_object.py",
"chars": 1498,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_link_object.py",
"chars": 1675,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_operations.py",
"chars": 9294,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_operations.pyi",
"chars": 3487,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_resources.py",
"chars": 211883,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_resources.pyi",
"chars": 89281,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/objects/_yadisk_object.py",
"chars": 7012,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/py.typed",
"chars": 0,
"preview": ""
},
{
"path": "src/yadisk/sessions/__init__.py",
"chars": 759,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/sessions/_httpx_common.py",
"chars": 2815,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/sessions/aiohttp_session.py",
"chars": 6003,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/sessions/async_httpx_session.py",
"chars": 3948,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/sessions/httpx_session.py",
"chars": 3409,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/sessions/pycurl_session.py",
"chars": 9855,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/sessions/requests_session.py",
"chars": 5488,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/settings.py",
"chars": 2152,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2024 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/types.py",
"chars": 12217,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2025 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "src/yadisk/utils.py",
"chars": 11078,
"preview": "# -*- coding: utf-8 -*-\n# Copyright © 2025 Ivan Konovalov\n\n# This file is part of a Python library yadisk.\n\n# This libra"
},
{
"path": "tests/__init__.py",
"chars": 24,
"preview": "# -*- coding: utf-8 -*-\n"
},
{
"path": "tests/async_client_test.py",
"chars": 35141,
"preview": "# -*- coding: utf-8 -*-\n\nimport hashlib\nimport logging\nimport os\nimport platform\nimport posixpath\nimport sys\nimport temp"
},
{
"path": "tests/auth_test.py",
"chars": 3920,
"preview": "# -*- coding: utf-8 -*-\n\nimport os\n\nimport pytest\nimport yadisk\n\nconfirmation_code = \"5320215\"\n\nreplay_disabled = os.env"
},
{
"path": "tests/auto_retry_test.py",
"chars": 2891,
"preview": "# -*- coding: utf-8 -*-\n\nimport pytest\nimport yadisk\n\n@pytest.mark.anyio\nasync def test_auto_retry() -> None:\n attemp"
},
{
"path": "tests/client_test.py",
"chars": 29656,
"preview": "# -*- coding: utf-8 -*-\n\nimport yadisk\n\nfrom yadisk._common import is_operation_link, ensure_path_has_scheme, remove_pat"
},
{
"path": "tests/conftest.py",
"chars": 7630,
"preview": "# -*- coding: utf-8 -*-\n\nimport inspect\nimport posixpath\nimport os\n\nfrom .test_session import TestSession, AsyncTestSess"
},
{
"path": "tests/disk_gateway.py",
"chars": 17650,
"preview": "# -*- coding: utf-8 -*-\n\nimport argparse\nimport threading\nimport time\nfrom typing import Any\nfrom urllib.parse import ur"
},
{
"path": "tests/import_session_test.py",
"chars": 1795,
"preview": "# -*- coding: utf-8 -*-\n\nimport pytest\nimport yadisk\nfrom yadisk._typing_compat import List\n\nimport typing\n\n\n@pytest.fix"
},
{
"path": "tests/recorded/async/test_auth_async.json",
"chars": 6521,
"preview": "[\n {\n \"method\": \"POST\",\n \"url\": \"https://oauth.yandex.ru/token\",\n \"headers\": {\n \"cont"
},
{
"path": "tests/recorded/async/test_check_token.json",
"chars": 2888,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_copy.json",
"chars": 15555,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_device_code_auth_async.json",
"chars": 3639,
"preview": "[{\"method\": \"POST\", \"url\": \"https://oauth.yandex.ru/device/code\", \"headers\": {\"content-type\": \"application/x-www-form-ur"
},
{
"path": "tests/recorded/async/test_download_by_link_error.json",
"chars": 6278,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://downloader.disk.yandex.ru/disk/4deb67f875582dfa8dd53c5d3b72e8fb"
},
{
"path": "tests/recorded/async/test_get_disk_info.json",
"chars": 1413,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk\",\n \"headers\": {\n "
},
{
"path": "tests/recorded/async/test_get_files.json",
"chars": 60082,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources/files?offset=0&limit=25\""
},
{
"path": "tests/recorded/async/test_get_last_uploaded.json",
"chars": 11762,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_get_meta.json",
"chars": 3418,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_get_public_resources.json",
"chars": 27661,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources/public?offset=0&limit=3\""
},
{
"path": "tests/recorded/async/test_get_upload_link_object.json",
"chars": 6845,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_is_file.json",
"chars": 6327,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_issue7.json",
"chars": 2364,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_listdir.json",
"chars": 9135,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_listdir_fields.json",
"chars": 6348,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_listdir_on_file.json",
"chars": 5101,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_listdir_with_limits.json",
"chars": 8808,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_listdir_with_max_items.json",
"chars": 22188,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_makedirs_with_scheme.json",
"chars": 19022,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_makedirs_without_scheme.json",
"chars": 19117,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_mkdir_and_exists.json",
"chars": 10386,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_move.json",
"chars": 5321,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_none_args.json",
"chars": 1798,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/operations/0000?fields=status\",\n "
},
{
"path": "tests/recorded/async/test_operation_error_triggers_retry.json",
"chars": 12095,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_patch.json",
"chars": 4452,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_permanent_remove.json",
"chars": 3764,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_public_listdir.json",
"chars": 27189,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_public_settings.json",
"chars": 8040,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_publish_unpublish.json",
"chars": 11682,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_remove_trash.json",
"chars": 5638,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_rename.json",
"chars": 7719,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_restore_trash.json",
"chars": 9305,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_save_to_disk.json",
"chars": 9322,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_streaming_requests.json",
"chars": 1416,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/operations/0000?fields=status\",\n "
},
{
"path": "tests/recorded/async/test_upload_and_download.json",
"chars": 9057,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_upload_and_download_async.json",
"chars": 15157,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_upload_download_non_seekable.json",
"chars": 6362,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_upload_url.json",
"chars": 9736,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/async/test_wait_for_operation.json",
"chars": 5126,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_auth.json",
"chars": 6521,
"preview": "[\n {\n \"method\": \"POST\",\n \"url\": \"https://oauth.yandex.ru/token\",\n \"headers\": {\n \"cont"
},
{
"path": "tests/recorded/sync/test_check_token.json",
"chars": 2888,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_copy.json",
"chars": 15546,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_device_code_auth.json",
"chars": 3639,
"preview": "[{\"method\": \"POST\", \"url\": \"https://oauth.yandex.ru/device/code\", \"headers\": {\"content-type\": \"application/x-www-form-ur"
},
{
"path": "tests/recorded/sync/test_download_by_link_error.json",
"chars": 6278,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://downloader.disk.yandex.ru/disk/4deb67f875582dfa8dd53c5d3b72e8fb"
},
{
"path": "tests/recorded/sync/test_get_disk_info.json",
"chars": 1413,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk\",\n \"headers\": {\n "
},
{
"path": "tests/recorded/sync/test_get_files.json",
"chars": 60082,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources/files?offset=0&limit=25\""
},
{
"path": "tests/recorded/sync/test_get_last_uploaded.json",
"chars": 11762,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_get_meta.json",
"chars": 3418,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_get_public_resources.json",
"chars": 27661,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources/public?offset=0&limit=3\""
},
{
"path": "tests/recorded/sync/test_get_upload_link_object.json",
"chars": 6845,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_issue7.json",
"chars": 2364,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_listdir.json",
"chars": 9135,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_listdir_fields.json",
"chars": 6348,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_listdir_on_file.json",
"chars": 5099,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_listdir_with_limits.json",
"chars": 8812,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_listdir_with_max_items.json",
"chars": 22180,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_makedirs_with_scheme.json",
"chars": 19717,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_makedirs_without_scheme.json",
"chars": 19816,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_mkdir_and_exists.json",
"chars": 7414,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_move.json",
"chars": 5321,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_none_args.json",
"chars": 1798,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/operations/0000?fields=status\",\n "
},
{
"path": "tests/recorded/sync/test_operation_error_triggers_retry.json",
"chars": 12104,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_patch.json",
"chars": 4456,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_permanent_remove.json",
"chars": 3764,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_public_listdir.json",
"chars": 27863,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_public_settings.json",
"chars": 8036,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_publish_unpublish.json",
"chars": 11710,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_remove_trash.json",
"chars": 5642,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_rename.json",
"chars": 7719,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_restore_trash.json",
"chars": 9305,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_save_to_disk.json",
"chars": 9300,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_streaming_requests.json",
"chars": 1416,
"preview": "[\n {\n \"method\": \"GET\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/operations/0000?fields=status\",\n "
},
{
"path": "tests/recorded/sync/test_upload_and_download.json",
"chars": 9113,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_upload_download_non_seekable.json",
"chars": 6417,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_upload_generator.json",
"chars": 6365,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_upload_url.json",
"chars": 9744,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/recorded/sync/test_wait_for_operation.json",
"chars": 5126,
"preview": "[\n {\n \"method\": \"PUT\",\n \"url\": \"https://cloud-api.yandex.net/v1/disk/resources?path=disk%3A%2FYaDiskTes"
},
{
"path": "tests/test_session.py",
"chars": 3985,
"preview": "# -*- coding: utf-8 -*-\n\nimport yadisk\nfrom yadisk.types import HTTPMethod\n\nfrom urllib.parse import urljoin, urlparse\n\n"
}
]
About this extraction
This page contains the full source code of the ivknv/yadisk GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 172 files (2.3 MB), approximately 601.6k tokens, and a symbol index with 1206 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.
Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.