---------------------
* Dropped support for Python 2.7. Now setuptools requires Python >= 3.6.
CLI changes
~~~~~~~~~~~
* ``--start`` and ``--end`` CLI arguments no longer use the default values of ``NOW-1DAY`` and ``NOW``. (`459 <https://github.com/sentinelsat/sentinelsat/issues/459>`_ `valgur <https://github.com/valgur>`_)
* ``--footprints`` now expects a path for the output file to be specified instead of using the previous default ``<--path>/search_footprints.geojson``. (`462 <https://github.com/sentinelsat/sentinelsat/issues/462>`_ `valgur <https://github.com/valgur>`_, `#407 <https://github.com/sentinelsat/sentinelsat/issues/407>`_ `IpsumCapra <https://github.com/IpsumCapra>`_)
* ``--uuid``, ``--name`` and ``--query`` must now be repeated instead of passing a single comma-separated string.
Repeated keywords get treated as an "or" expression. (`463 <https://github.com/sentinelsat/sentinelsat/issues/463>`_ `valgur <https://github.com/valgur>`_)
* Display DHuS server version with CLI flag ``--info`` (`367 <https://github.com/sentinelsat/sentinelsat/issues/367>`_ `thomasyoung-audet <https://github.com/thomasyoung-audet>`_)
* Added searching by placenames with the CLI flag ``--location`` (`372 <https://github.com/sentinelsat/sentinelsat/issues/372>`_ `thomasyoung-audet <https://github.com/thomasyoung-audet>`_)
* Added CLI support for ``--geometry`` input as a WKT or GeoJSON string (`381 <https://github.com/sentinelsat/sentinelsat/issues/381>`_ `thomasyoung-audet <https://github.com/thomasyoung-audet>`_)
* Download quicklooks directly with the CLI flag ``--quicklook`` (`361 <https://github.com/sentinelsat/sentinelsat/issues/361>`_ `mackland <https://github.com/mackland>`_)
* Got rid of the special handling of ``--uuid`` and ``--name`` CLI arguments. The product IDs are now simply passed to ``api.query()`` as a set.
As a result they no longer ignore the date range arguments (fixes `387 <https://github.com/sentinelsat/sentinelsat/issues/387>`_). (`#390 <https://github.com/sentinelsat/sentinelsat/issues/390>`_ `valgur <https://github.com/valgur>`_)
* Added ``--timeout`` option with a default value of 60 seconds to avoid waiting indefinitely for a response. (`475 <https://github.com/sentinelsat/sentinelsat/issues/475>`_ `valgur <https://github.com/valgur>`_)
* New ``--gnss`` CLI flag to use the GNSS end-point for orbit products query and download (`441 <https://github.com/sentinelsat/sentinelsat/issues/441>`_ `avalentino <https://github.com/avalentino>`_).
Added
~~~~~
* Added ``setinelsat/__main__.py`` (`412 <https://github.com/sentinelsat/sentinelsat/issues/412>`_ `avalentino <https://github.com/avalentino>`_)
* Added ``get_stream()`` (`430 <https://github.com/sentinelsat/sentinelsat/issues/430>`_ `fwfichtner <https://github.com/fwfichtner>`_)
* New ``sentinelsat/products.py`` module providing a "product nodes" API that
allows to filter and download only selected files of the requested products
(`414 <https://github.com/sentinelsat/sentinelsat/issues/414>`_ `avalentino <https://github.com/avalentino>`_)
* Added ``trigger_offline_retrieval()``. (`476 <https://github.com/sentinelsat/sentinelsat/issues/476>`_ `valgur <https://github.com/valgur>`_)
* Added ``download_quicklooks()`` and ``download_all_quicklooks()`` (`361 <https://github.com/sentinelsat/sentinelsat/issues/361>`_ `mackland <https://github.com/mackland>`_)
Changed
~~~~~~~
* Replaced ``SentinelAPIError`` exceptions with more specific types:
* ``SentinelAPIError`` -- the parent, catch-all exception. Only used when no other more specific exception can be applied.
* ``ServerError`` -- raised when the server responded in an unexpected manner, typically due to undergoing maintenance.
* ``UnauthorizedError`` -- raised when attempting to retrieve a product with incorrect credentials.
* ``QuerySyntaxError`` -- raised when the query string could not be parsed on the server side.
* ``QueryLengthError`` -- raised when the query string length was excessively long.
* ``InvalidKeyError`` -- raised when product with given key was not found on the server.
* ``InvalidChecksumError`` -- MD5 checksum of a local file does not match the one from the server.
* ``LTAError`` -- raised when triggering a retrieval from the Long Term Archive failed.
* ``LTATriggered`` -- raised in some cases when the product is offline and retrieval was triggered successfully.
The new exceptions are still subclasses of ``SentinelAPIError`` for backwards compatibility.
(`285 <https://github.com/sentinelsat/sentinelsat/issues/285>`_ `valgur <https://github.com/valgur>`_, `dwlsalmeida <https://github.com/dwlsalmeida>`_)
* Tidied up the (internal) download code logic (`378 <https://github.com/sentinelsat/sentinelsat/issues/378>`_ `valgur <https://github.com/valgur>`_)
* Added an "exception" field to the ``failed_products`` dict returned by in ``.download_all()`` for easier debugging (`378 <https://github.com/sentinelsat/sentinelsat/issues/378>`_ `valgur <https://github.com/valgur>`_)
* Fixed the server-side space handling change issue reported in `383 <https://github.com/sentinelsat/sentinelsat/issues/383>`_ by quoting instead of backslash-escaping the strings. (`#390 <https://github.com/sentinelsat/sentinelsat/issues/390>`_ `valgur <https://github.com/valgur>`_)
* Queries now use ``(key:value OR key:value)`` format instead of the previous ``key:(value OR value)`` format,
which for some reason took tens of seconds per query. (`390 <https://github.com/sentinelsat/sentinelsat/issues/390>`_ `valgur <https://github.com/valgur>`_)
* Empty queries raise a ``ValueError`` immediately on the client side instead of letting the server generate it. (`390 <https://github.com/sentinelsat/sentinelsat/issues/390>`_ `valgur <https://github.com/valgur>`_)
* Added stricter checks for empty keyword values in queries, which would cause server-side errors. (`390 <https://github.com/sentinelsat/sentinelsat/issues/390>`_ `valgur <https://github.com/valgur>`_)
* Gracefully handle cancelled futures. (`448 <https://github.com/sentinelsat/sentinelsat/issues/448>`_ and `#479 <https://github.com/sentinelsat/sentinelsat/issues/479>`_ `avalentino <https://github.com/avalentino>`_)
* Use the HTTP status instead of OData metadata to determine the online status of a product when downloading.
This is a workaround for the rare server-side bug of the OData info for the online status being incorrect (`467 <https://github.com/sentinelsat/sentinelsat/issues/467>`_). (`#469 <https://github.com/sentinelsat/sentinelsat/issues/469>`_ `valgur <https://github.com/valgur>`_)
* ``download()`` now raises ``LTATriggered`` or ``LTAError`` if the requested product is offline. (`476 <https://github.com/sentinelsat/sentinelsat/issues/476>`_ `valgur <https://github.com/valgur>`_)
This is a workaround for the rare server-side bug of the OData info for the online status being incorrect (`467 <https://github.com/sentinelsat/sentinelsat/issues/467>`_). (`#469 <https://github.com/sentinelsat/sentinelsat/issues/469>`_ `valgur <https://github.com/valgur>`_)
* Set the default query timeout to 60 seconds to avoid waiting indefinitely for a response. (`475 <https://github.com/sentinelsat/sentinelsat/issues/475>`_ `valgur <https://github.com/valgur>`_)
* ``download_all`` now returns a named tuple for clarity. (`477 <https://github.com/sentinelsat/sentinelsat/issues/477>`_ `valgur <https://github.com/valgur>`_)
* Search queries now use GET instead of POST requests because the Sentinel-5P Pre-Operations Data Hub does not support POST (`380 <https://github.com/sentinelsat/sentinelsat/issues/380>`_).
As a consequence, the search query contents are now limited to latin1 encoding instead of UTF-8. (`473 <https://github.com/sentinelsat/sentinelsat/issues/473>`_ `valgur <https://github.com/valgur>`_)
* Use ``tqdm.auto`` for nicer progress reporting in notebooks. (`480 <https://github.com/sentinelsat/sentinelsat/issues/480>`_ `valgur <https://github.com/valgur>`_)
Deprecated
~~~~~~~~~~
* Removed ``query_raw()`` that was deprecated in v0.12.
Fixed
~~~~~
* Fix location information for Nominatim bounding box queries (`384 <https://github.com/sentinelsat/sentinelsat/issues/384>`_)
* Get file name extension more reliably from either the HTTP header or an OData attribute. (`378 <https://github.com/sentinelsat/sentinelsat/issues/378>`_, `#472 <https://github.com/sentinelsat/sentinelsat/issues/472>`_ `valgur <https://github.com/valgur>`_)
* Updated the API Hub URL to `https://apihub.copernicus.eu/apihub/`.
* Server-side error info has become much more detailed and the client code has been updated to correctly handle that.
* ``check_existing()`` now determines the filename correctly for Sentinel-5 products. (`valgur <https://github.com/valgur>`_ `#452 <https://github.com/sentinelsat/sentinelsat/issues/452>`_)
* Fix accidental downloading of the whole product in memory when the product is actually available despite being marked
as offline in its metadata. (`386 <https://github.com/sentinelsat/sentinelsat/issues/386>`_, `#421 <https://github.com/sentinelsat/sentinelsat/issues/421>`_, `#454 <https://github.com/sentinelsat/sentinelsat/issues/454>`_ `lucadelu <https://github.com/lucadelu>`_)
* Fixed timeout not being used in some queries. (`454 <https://github.com/sentinelsat/sentinelsat/issues/454>`_ `valgur <https://github.com/valgur>`_)
Development Changes
~~~~~~~~~~~~~~~~~~~
* Fixed failing Read The Docs builds (`370 <https://github.com/sentinelsat/sentinelsat/issues/370>`_)
* Replaced Travis CI with Github Actions. Added testing on MacOS and Windows. (`438 <https://github.com/sentinelsat/sentinelsat/issues/438>`_ `avalentino <https://github.com/avalentino>`_)
* Made tests more robust by not relying on specific products being returned where possible.