Fix an issue with getting all valid keywords that
aiohttpaccepts by using
From release 0.15 onward, all minor versions of HyRiver packages
will be pinned. This ensures that previous minor versions of HyRiver
packages cannot be installed with later minor releases. For example,
if you have
py3dep==0.14.x installed, you cannot install
pydaymet==0.15.x. This is to ensure that the API is
consistent across all minor versions.
False, responses for failed requests used to return as
Nonebut their requests ID was not returned, so sorting would have failed. Now request IDs are returned for all requests regardless of whether they were successful or not.
Give precedence to non-default arguments for caching related arguments instead of directly getting them from env variables. This is to avoid the case where the user sets the env variables but then passes different arguments to the function. In this case, the function should use the passed arguments instead of the env variables.
Add a new option to all functions called
Falseno exception will be raised and instead
Noneis returned for those requests that led to exceptions. This will allow for returning all responses that were successful and ignoring the ones that failed. This option defaults to
Truefor retaining backward compatibility.
Set the cache expiration time to one week from never expire. To ensure all users have a smooth transition, cache files that were created before the release of this version will be deleted, and a new cache will be created.
Sync all minor versions of HyRiver packages to 0.14.0.
Rewrite the private
async_sessionfunction as two separate functions called
async_session_with_cache. This makes the code more readable and easier to maintain.
Convert relative imports to absolute with
Sync all patch versions of HyRiver packages to x.x.12.
show_versionsfunction to improve performance and print the output in a nicer table-like format.
Fix a bug in reading the
Bump the minimum version of
aiohttp-client-cacheto 0.8.1 to fix a bug in reading cache files that were created with previous versions. (GH 41)
aiohttp-client-cacheto speed up saving responses to the cache file.
pyrightfor type checking instead of
mypyand fix all type errors.
Skip 0.13.8/9 versions so the minor version of all HyRiver packages become the same.
Add support for specifying the chunk size in
stream_write. Defaults to
Nonewhich was the default behavior before, and means iterating over and writing the responses as they are received from the server.
pyupgradepackage to update the type hinting annotations to Python 3.10 style.
Modify the codebase based on Refurb suggestions.
Add the missing PyPi classifiers for the supported Python versions.
Release the package as both
async-retrieveron PyPi and Conda-forge.
Append “Error” to all exception classes for conforming to PEP-8 naming conventions.
Bump minimum version of
aiohttp-client-cacheto 0.7.3 since the
attrsversion issue has been addressed.
Add a new function,
stream_write, for writing a response to a file as it’s being retrieved. This could be very useful for downloading large files. This function does not use persistent caching.
Set the minimum supported version of Python to 3.8 since many of the dependencies such as
rioxarrayhave dropped support for Python 3.7.
Add support for setting caching-related arguments using three environmental variables:
HYRIVER_CACHE_NAME: Path to the caching SQLite database.
HYRIVER_CACHE_EXPIRE: Expiration time for cached requests in seconds.
HYRIVER_CACHE_DISABLE: Disable reading/writing from/to the cache file.
You can do this like so:
import os os.environ["HYRIVER_CACHE_NAME"] = "path/to/file.sqlite" os.environ["HYRIVER_CACHE_EXPIRE"] = "3600" os.environ["HYRIVER_CACHE_DISABLE"] = "true"
Include the URL of a failed request in its exception error message.
Add three new functions called
retrieve_binary. These functions are derived from the
retrievefunction and are used to retrieve the text, JSON, or binary content of a response. They are meant to help with type hinting since they have only one return type instead of the three different return types that the
Move all private functions to a new module called
utils. This makes the code-base more readable and easier to maintain.
Set the expiration time to never expire by default.
Add two new arguments to
retrievefor controlling caching. First,
delete_url_cachefor deleting caches for specific requests. Second,
expire_afterfor setting a custom expiration time.
sslargument for disabling the SSL certification verification (GH 41).
Add a new option called
disablethat temporarily disables caching requests/responses if set to
True. It defaults to
Add two new arguments,
retrieve. These two arguments give the user more control in dealing with issues related to caching.
pytestas the testing framework.
importlib-metadatafor getting the version instead of
pkg_resourcesto decrease import time as discussed in this issue.
ujonfor converting responses to JSON.
Fix an issue with catching service error messages.
ujsonfor JSON parsing instead of
orjsononly serializes to
byteswhich is not compatible with
Add a new function,
clean_cache, for manually removing the expired responses from the cache database.
Handle all cache file-related operations in the
The responses now are returned to the same order as the input URLs.
Add support for passing connection type, i.e., IPv4 only, IPv6 only, or both via the
familyargument. Defaults to
trust_env=True, so the session can read the system’s
netrcfiles. This can be useful for working with services such as EarthData service that read the user authentication info from a
AsyncRequestclass with the
_retrievefunction to increase readability and reduce overhead.
More robust handling of validating user inputs via a new class called
Move all if-blocks in
async_sessionto other functions to improve performance.
Make persistent caching dependencies required.
retrievewhich now accepts both lower and upper cases of
Pass a new loop explicitly to
Refactor the entire code-base for more efficient handling of different request methods.
Check the validity of inputs before sending requests.
Improve cache handling by removing the expired responses before returning the results.
Increase testing coverage to 100%.