Amazon Creators API wrapper for Python
Repo sergioteula/python-amazon-paapi, read from GitHub 2 h ago. sergioteula has not joined Take My Repo.
timeout in AmazonCreatorsApi and AsyncAmazonCreatorsApi accepts a pair of (connect, read) seconds, bounding each leg of a request on its own, so a host resolving to several addresses cannot spend a read-sized timeout on every one of them(5, 25) rather than 30, five seconds to connect and twenty-five to read. It adds up to the thirty seconds that have always been documented and makes them true of the token request and of the async client too, where a single value was applied to each leg separately and allowed sixty. A response taking between twenty-five and thirty seconds now times out where it used to arrivelist_feeds, get_feed, list_reports and get_report methods in amazon_creatorsapi and amazon_creatorsapi.aio, with Feed, FeedType, ReportMetadata and ReportType in amazon_creatorsapi.models and in the bundled SDKtimeout parameter in AmazonCreatorsApi and AsyncAmazonCreatorsApi to set the request timeout in seconds, or None to wait indefinitelyretries parameter in AmazonCreatorsApi and AsyncAmazonCreatorsApi to retry the throttled and failed requests that Amazon asks to retry, waiting longer before every attempt and honouring the Retry-After header, whether Amazon sends it as an amount of seconds or as a dateinclude_unavailable parameter in get_items to get an item holding only the ASIN for every requested item missing from the responseavailability parameter in search_items to include the items that are out of stock, keyword only and placed after the rest, so the arguments of a caller not using keywords keep their positionhost and auth_endpoint parameters in AmazonCreatorsApi and AsyncAmazonCreatorsApi to replace the endpoints of the API, useful to run tests against a mock server or to use a version newer than the ones known by the library, as long as the library can authenticate its familyAccessDeniedError, raised when the credentials cannot perform the requested operationResourceNotFoundError, raised when a feed or report does not exist, telling it apart from missing itemserrors attribute of the lists returned by get_items and get_browse_nodes, and are reported in the message of ItemsNotFoundErrorErrorData and ResultList available in amazon_creatorsapi.modelsget_asin and errors are available directly in amazon_creatorsapiclose method and context manager support in AmazonCreatorsApi, to release the connections of a client that is not going to be reusedpy.typed marker, so the type hints of the package are used by type checkersamazon_creatorsapi and how to fix itversion, the countries and the marketplace each one maps to, and the marketplace argument are documented, instead of having to read the code to find themCONTRIBUTING.md, with the setup of the project, the commands of the Makefile, the conventions of the code and the tests, and what a pull request is expected to carryAmazonCreatorsApi and used the 5 second default of httpx in AsyncAmazonCreatorsApi. Pass timeout=None to restore the previous behaviourInvalidArgumentError, missing or expired credentials raise AuthenticationError and a forbidden request raises AccessDeniedError, instead of a generic RequestErrorInvalidArgumentError instead of a pydantic.ValidationErrorRequestError instead of leaking the errors of the HTTP clientAuthenticationError and AccessDeniedError are subclasses of RequestError, which is what a failed request raised before they got their own typeInvalidArgumentError is also a ValueError, as the pydantic.ValidationError and the plain ValueError it replaced wereget_items splits a request with more items than the API accepts into as many calls as needed, so any amount of items can be requested at onceget_items returns the items in the order they were requested, and asks for duplicated items only onceget_items raises ItemsNotFoundError when the response holds no requested item, as documented, instead of returning an empty listsearch_items rejects a search without any criteria instead of sending it to the APIversion raises InvalidArgumentError instead of a plain ValueError, like the rest of the arguments of the clients, and a version of a family that the library cannot authenticate is rejected even when auth_endpoint is given, instead of being sent with the Cognito flow and rejected by Amazon without an explanationauth_endpointAmazonCreatorsApi validates the version when it is created, as AsyncAmazonCreatorsApi already did, instead of failing on the first requestAuthorization header it expects are decided in a single place shared by both clients, and the copies bundled in the SDK are pinned to them by tests, so a bump of the SDK cannot leave both halves disagreeingAsyncAmazonCreatorsApi builds its requests with the models of the SDK, so both clients validate the same values before sending a requestthrottling is validated like the rest of the options, so a negative or invalid value raises InvalidArgumentError instead of being accepted or failing with a TypeErroruv through a cached actionuv build, and its check for an already existing tag looks for the tag name that is actually created, which never matched beforecreatorsapi-python-sdk from 1.2.0 to 1.3.0, which makes partnerTag a required field of SearchItemsRequestContentruff to the version run by pre-commit, so make lint matches CISortBy.PRICE_LOW_TO_HIGH or GetItemsResource.ITEMINFO_TITLEitem_count, min_reviews_rating and variation_page, which did not match the ones accepted by the APIAuthenticationError in AsyncAmazonCreatorsApi, instead of the error of the JSON parserRequest failed with status 0amazon_paapi module and its bundled Product Advertising API 5.0 SDK, with AmazonApi, amazon_paapi.errors, amazon_paapi.helpers, amazon_paapi.models and amazon_paapi.tools. Use amazon_creatorsapi instead, following the migration guide for the credential, method and exception mappingAPI_KEY and API_SECRET environment variables, only used by the removed modulesix dependency, which was not useddelivery_flags parameter in search_items for amazon_creatorsapi and amazon_creatorsapi.aioamazon_creatorsapi.aio API layercreatorsapi-python-sdk from 1.1.2 to 1.2.0amazon_creatorsapi.aio subpackage (#143)AsyncAmazonCreatorsApi class for non-blocking API interactionshttpx integration for connection poolingAuthenticationError exception for improved OAuth2 error handling[async] installation extra: pip install python-amazon-paapi[async]make docs command in Makefile for building documentationamazon_creatorsapi module for Amazon Creators API supportcreatorsapi_python_sdk package bundled for OAuth2 authenticationmodels submodule exposing all SDK model classes (Item, Condition, SortBy, etc.)docs/pages/migration-guide-6.md)pydantic>=2.0.0 and requests>=2.28.0amazon_paapi module is now deprecated in favor of amazon_creatorsapiamazon_creatorsapi.core packageamazon_paapi module - use amazon_creatorsapi insteadmigration-guide-4.md, migration-guide-5.md)