Yadisk

Latest version: v3.1.0

Safety actively analyzes 681775 Python packages for vulnerabilities to keep your Python projects secure.

Scan your dependencies

Page 1 of 7

3.1.0

* 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

3.0.1

* Fixed broken :code:`pyproject.toml` that did not include full package
contents (see `issue 49`_)

3.0.0

* 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

2.1.0

* 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`

2.0.0

* 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

1.3.4

* `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`_

Page 1 of 7

© 2024 Safety CLI Cybersecurity Inc. All Rights Reserved.