Release Notes#
[0.6.0] - 2024-08-05#
Added#
OAuth2ServiceAccountauthentication method
[0.5.0] - 2023-07-30#
Changes/Improvements#
WebAPIno longer needs to be constructed after an event loop is running.unmanage_async_context_syncrenamed tounmanage_async_contextunused async version removed
returns a
asyncio.Eventinstead ofasyncio.Semaphorefor releasing contextreturns a
asyncio.Task[T]instead ofTand does not assume__aenter__returns self
Removed#
unused
run_sync_ensured
[0.4.5] - 2023-03-03#
Added#
WebAPI._get_, _post, _put, _patch, _deletemethods with serialization and deserializationReturn type can have
from_jsonclassmethod for deserialization. None for no deserialization, str for text content, or a single-parameter constructor which will get the JSON response object.Data parameter can have
to_jsonmethod for serialization, asdict for dataclasses, or passed as-is.TypedDictis one good way to define the JSON response type, and will work without any extra code.
WebAPI._use_form_datais used for the above methods.
[0.4.4] - 2023-03-02#
Added#
delete_json(for HTTP DELETE) method
[0.4.3] - 2023-02-26#
Changed#
OAuth2AppandOAuth2Userno longer overload the dataclass constructoruse
.from_json_obj()or.from_json_file()instead
WebAPIis no longerAsyncInit, and should not be awaitedAPIKeyrenamed toUrlApiKey,APIErrortoApiErrorAuth.sign_requestrenamed toAuth.signWebAPInow requires anAuthobject, not Noneuse
Auth.none()for no auth
OAuth2Userno longer keeps asource_pathand does not do any IO
Added#
Interactive wizard for granting credentials
Google flavor app/client JSON files can now be used to create
OAuth2Success local flow page styling, light/dark
HeaderApiKeyfor adding API keys to theAuthorizationheader, or any other headerWebAPI._parameter_list_delimiterfor serialization. Only applies to URL parameters.NoAuthimplementation ofAuthOAuth2accepts a callback for when user tokens are refreshed.separate
METHOD_form()methods for form-parameter requests
Removed#
EnumParam,EnumParamstypes. Instead, useset[str]orset[T]whereTis an enum type.Make sure to convert any sets or lists to strings with the appropriate delimter for whichever API you are using.
Alternatively, set
WebAPI._parameter_list_delimiterto the appropriate delimiter for your API.
APIObjdid not provide much value as a base class, and could make usage less clear.Auth.refreshandAuth.flow, which could not be implemented by many authorization schemes.AsyncInitbase class, which was no longer needed.
[0.2.4] - 2022-02-26#
Added#
OAuth1andOAuth1Userconstructors accept a string as a path to a JSON file.