amazon-orders 4.4.0__tar.gz → 4.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/CHANGELOG.md +21 -55
  2. {amazon_orders-4.4.0/amazon_orders.egg-info → amazon_orders-4.4.2}/PKG-INFO +2 -2
  3. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/README.md +1 -1
  4. {amazon_orders-4.4.0 → amazon_orders-4.4.2/amazon_orders.egg-info}/PKG-INFO +2 -2
  5. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/__init__.py +1 -1
  6. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/conf.py +2 -0
  7. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/order.py +9 -3
  8. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/selectors.py +2 -1
  9. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/session.py +3 -0
  10. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/LICENSE +0 -0
  11. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/MANIFEST.in +0 -0
  12. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazon_orders.egg-info/SOURCES.txt +0 -0
  13. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazon_orders.egg-info/dependency_links.txt +0 -0
  14. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazon_orders.egg-info/entry_points.txt +0 -0
  15. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazon_orders.egg-info/requires.txt +0 -0
  16. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazon_orders.egg-info/top_level.txt +0 -0
  17. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/banner.txt +0 -0
  18. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/cli.py +0 -0
  19. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/constants.py +0 -0
  20. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/__init__.py +0 -0
  21. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/browser/__init__.py +0 -0
  22. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/browser/playwright.py +0 -0
  23. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/waf/__init__.py +0 -0
  24. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/waf/anticaptcha.py +0 -0
  25. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/waf/base.py +0 -0
  26. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/waf/capsolver.py +0 -0
  27. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/contrib/waf/twocaptcha.py +0 -0
  28. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/__init__.py +0 -0
  29. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/item.py +0 -0
  30. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/parsable.py +0 -0
  31. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/recipient.py +0 -0
  32. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/seller.py +0 -0
  33. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/shipment.py +0 -0
  34. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/entity/transaction.py +0 -0
  35. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/exception.py +0 -0
  36. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/forms.py +0 -0
  37. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/orders.py +0 -0
  38. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/transactions.py +0 -0
  39. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/amazonorders/util.py +0 -0
  40. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/pyproject.toml +0 -0
  41. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/setup.cfg +0 -0
  42. {amazon_orders-4.4.0 → amazon_orders-4.4.2}/tests/testcase.py +0 -0
@@ -4,7 +4,23 @@ All notable changes to this project will be documented in this file.
4
4
 
5
5
  This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
 
7
- ## [Unreleased](https://github.com/alexdlaird/amazon-orders/compare/4.4.0...HEAD)
7
+ ## [Unreleased](https://github.com/alexdlaird/amazon-orders/compare/4.4.2...HEAD)
8
+
9
+ ## [4.4.2](https://github.com/alexdlaird/amazon-orders/compare/4.4.1...4.4.2) - 2026-07-05
10
+
11
+ ### Added
12
+
13
+ - `request_timeout` config key (defaults to `None`) controlling the timeout passed to each HTTP request.
14
+
15
+ ### Changed
16
+
17
+ - `Order.order_number` now uses the caller-supplied value as a fallback when the order number cannot be parsed from the details page; previously documented but unintuitive behavior.
18
+
19
+ ## [4.4.1](https://github.com/alexdlaird/amazon-orders/compare/4.4.0...4.4.1) - 2026-07-04
20
+
21
+ ### Fixed
22
+
23
+ - Parsing of some `Order` fields on older order pages using the `chargeSummary` layout.
8
24
 
9
25
  ## [4.4.0](https://github.com/alexdlaird/amazon-orders/compare/4.3.1...4.4.0) - 2026-06-12
10
26
 
@@ -13,7 +29,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
13
29
  - `PlaywrightAcicForm` now solves visual grid Puzzles (e.g. "Choose all the buckets") automatically when a WAF solver extra is configured. Puzzles are detected and solved in a loop alongside the existing WAF token challenge, handling any combination Amazon presents.
14
30
  - `AwsWafForm._solve_visual_captcha()` subclass hook for Puzzle classification. `CapSolverWafForm` implements this via the `AwsWafClassification` task type.
15
31
  - `browser_timeout` config key (defaults to 30s) controlling how long the browser waits for challenge elements to appear.
16
- - `retry_failures` input on the integration test workflow for fail-fast CI runs.
17
32
  - Build and stability improvements.
18
33
 
19
34
  ## [4.3.1](https://github.com/alexdlaird/amazon-orders/compare/4.3.0...4.3.1) - 2026-06-07
@@ -23,20 +38,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
23
38
  - `AmazonOrders.get_invoice()` to fetch an Order's print-friendly invoice page, returning the response (including its parsed HTML) for rendering or printing.
24
39
  - `AmazonTransactions.get_transactions()` `order_id` parameter to scope results to a single Order server-side via Amazon's `transactionTag` filter, bypassing the `days` window.
25
40
 
26
- ### Added
27
-
28
- - `AmazonOrders.get_invoice()` to fetch an Order's print-friendly invoice page, returning the response (including its parsed HTML) for rendering or printing.
29
- - `AmazonTransactions.get_transactions()` `order_id` parameter to scope results to a single Order server-side via Amazon's `transactionTag` filter, bypassing the `days` window.
30
-
31
41
  ## [4.3.0](https://github.com/alexdlaird/amazon-orders/compare/4.2.2...4.3.0) - 2026-06-07
32
42
 
33
43
  ### Added
34
44
 
35
45
  - `[browser]` optional extra (`pip install amazon-orders[browser]`) for handling JavaScript-based authentication challenges via a headless browser. See [the docs](https://amazon-orders.readthedocs.io/browser.html) for setup.
36
- - `PlaywrightAcicForm` handles the ACIC challenge page. If an embedded AWS WAF CAPTCHA is present, it delegates automatically to any configured WAF solver extra.
37
- - `PlaywrightJSAuthForm` is a best-effort handler for the JS robot-detection page.
38
- - `PlaywrightManualWafForm` opens a **visible** browser window for manual WAF CAPTCHA solving a free alternative to the paid `[waf]` extras for local/interactive use.
39
- - `browser` config key and `AMAZON_BROWSER` environment variable to select between `chromium` (default) and `firefox` browser fingerprints.
46
+ - `PlaywrightAcicForm` handles the ACIC challenge page. If an embedded WAF is present, it delegates automatically to any configured WAF solver extra.
47
+ - `PlaywrightJSAuthForm` is a best-effort handler for the JS bot-detection page.
48
+ - `PlaywrightManualWafForm` opens a **visible** browser window for you to solve the challenge yourself, suitable when a display is available.
49
+ - `browser` config key and `AMAZON_BROWSER` environment variable to select between `chromium` (default) and `firefox` browser user agents.
40
50
  - `Transaction.payment_method_last_4`, the masked card digits parsed from `payment_method`, mirroring the existing field on `Order`.
41
51
 
42
52
  ### Changed
@@ -44,15 +54,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
44
54
  - JavaScript-based authentication challenge errors now direct users to the `[browser]` extra rather than reporting the challenge as unsolvable.
45
55
  - All user-facing error messages that include install commands now wrap those commands in backticks.
46
56
 
47
- ### Added
48
-
49
- - `[browser]` optional extra (`pip install amazon-orders[browser]`) for handling JavaScript-based authentication challenges via a headless browser. See [the docs](https://amazon-orders.readthedocs.io/browser.html) for setup.
50
- - `PlaywrightAcicForm` handles the ACIC challenge page. If an embedded WAF is present, it delegates automatically to any configured WAF solver extra.
51
- - `PlaywrightJSAuthForm` is a best-effort handler for the JS bot-detection page.
52
- - `PlaywrightManualWafForm` opens a **visible** browser window for you to solve the challenge yourself, suitable when a display is available.
53
- - `browser` config key and `AMAZON_BROWSER` environment variable to select between `chromium` (default) and `firefox` browser user agents.
54
- - `Transaction.payment_method_last_4`, the masked card digits parsed from `payment_method`, mirroring the existing field on `Order`.
55
-
56
57
  ## [4.2.2](https://github.com/alexdlaird/amazon-orders/compare/4.2.1...4.2.2) - 2026-06-06
57
58
 
58
59
  ### Fixed
@@ -65,10 +66,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
65
66
 
66
67
  - WAF solver API keys can now also be set via `AmazonOrdersConfig` (under the lowercased env var name, e.g. `capsolver_api_key`), matching the precedence pattern used for other credentials.
67
68
 
68
- ### Changed
69
-
70
- - WAF solver API keys can now also be set via `AmazonOrdersConfig` (under the lowercased env var name, e.g. `capsolver_api_key`), matching the precedence pattern used for other credentials.
71
-
72
69
  ## [4.2.0](https://github.com/alexdlaird/amazon-orders/compare/4.1.0...4.2.0) - 2026-05-08
73
70
 
74
71
  ### Added
@@ -79,14 +76,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
79
76
  - Configurable Amazon domain for non-`.com` sites via the `domain` parameter on `AmazonSession`, the `domain` config field, and the `--domain` CLI flag.
80
77
  - Improved currency parsing for English non-`.com` Amazon sites.
81
78
 
82
- ### Added
83
-
84
- - Support for AWS WAF solving via third-party providers like CapSolver (`pip install amazon-orders[capsolver]`), Anti-Captcha (`pip install amazon-orders[anticaptcha]`), and 2Captcha (`pip install amazon-orders[2captcha]`). See [the docs](https://amazon-orders.readthedocs.io/waf.html) for setup.
85
- - `auth_forms_classes` config option for plugging custom `AuthForm` subclasses into the auth chain without code changes.
86
- - `AmazonSession.default_auth_forms()` static helper that returns the default form chain so callers can more easily extend it.
87
- - Configurable Amazon domain for non-`.com` sites via the `domain` parameter on `AmazonSession`, the `domain` config field, and the `--domain` CLI flag.
88
- - Improved currency parsing for English non-`.com` Amazon sites.
89
-
90
79
  ## [4.1.0](https://github.com/alexdlaird/amazon-orders/compare/4.0.19...4.1.0) - 2026-05-03
91
80
 
92
81
  ### Added
@@ -101,28 +90,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
101
90
 
102
91
  - Captcha auto-solve via `amazoncaptcha` is likely to be removed in the future, since Amazon has continued to phase out OCR-style Captchas in favor of WAF.
103
92
 
104
- ### Added
105
-
106
- - Python 3.13 support.
107
-
108
- ### Changed
109
-
110
- - `amazoncaptcha` is now an optional dependency. Install with `pip install amazon-orders[captcha]` to enable Captcha auto-solve (only compatible with Python <=3.12. When not installed, Captcha challenges fall back to manual entry.
111
-
112
- ### Deprecated
113
-
114
- - Captcha auto-solve via `amazoncaptcha` is likely to be removed in the future, since Amazon has continued to phase out OCR-style Captchas in favor of WAF.
115
-
116
93
  ## [4.0.19](https://github.com/alexdlaird/amazon-orders/compare/4.0.18...4.0.19) - 2026-04-29
117
94
 
118
95
  ### Added
119
96
 
120
97
  - Build and stability improvements.
121
98
 
122
- ### Added
123
-
124
- - Build and stability improvements.
125
-
126
99
  ## [4.0.18](https://github.com/alexdlaird/amazon-orders/compare/4.0.17...4.0.18) - 2025-12-06
127
100
 
128
101
  ### Added
@@ -247,13 +220,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
247
220
 
248
221
  ### Added
249
222
 
250
- - Improvements around auth retry logic.
251
- - Detect JavaScript-based auth challenges (which can be solved) and give more clear error for them.
252
- - Stability improvements.
253
- - Documentation improvements.
254
-
255
- ### Added
256
-
257
223
  - Stability improvements for auth flow.
258
224
  - Documentation improvements.
259
225
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-orders
3
- Version: 4.4.0
3
+ Version: 4.4.2
4
4
  Summary: A Python library (and CLI) for Amazon order history
5
5
  Author-email: Alex Laird <contact@alexlaird.com>
6
6
  Maintainer-email: Alex Laird <contact@alexlaird.com>
@@ -102,7 +102,7 @@ pip install amazon-orders --upgrade
102
102
 
103
103
  That's it! `amazon-orders` is now available as a package to your Python projects and from the command line.
104
104
 
105
- If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.4.*`, not `==4.2.1`) to
105
+ If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.4.*`, not `==4.4.0`) to
106
106
  ensure you always get the latest stable release.
107
107
 
108
108
  ## Basic Usage
@@ -28,7 +28,7 @@ pip install amazon-orders --upgrade
28
28
 
29
29
  That's it! `amazon-orders` is now available as a package to your Python projects and from the command line.
30
30
 
31
- If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.4.*`, not `==4.2.1`) to
31
+ If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.4.*`, not `==4.4.0`) to
32
32
  ensure you always get the latest stable release.
33
33
 
34
34
  ## Basic Usage
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-orders
3
- Version: 4.4.0
3
+ Version: 4.4.2
4
4
  Summary: A Python library (and CLI) for Amazon order history
5
5
  Author-email: Alex Laird <contact@alexlaird.com>
6
6
  Maintainer-email: Alex Laird <contact@alexlaird.com>
@@ -102,7 +102,7 @@ pip install amazon-orders --upgrade
102
102
 
103
103
  That's it! `amazon-orders` is now available as a package to your Python projects and from the command line.
104
104
 
105
- If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.4.*`, not `==4.2.1`) to
105
+ If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.4.*`, not `==4.4.0`) to
106
106
  ensure you always get the latest stable release.
107
107
 
108
108
  ## Basic Usage
@@ -1,3 +1,3 @@
1
1
  __copyright__ = "Copyright (c) 2024-2025 Alex Laird"
2
2
  __license__ = "MIT"
3
- __version__ = "4.4.0"
3
+ __version__ = "4.4.2"
@@ -60,6 +60,8 @@ class AmazonOrdersConfig:
60
60
  "auth_forms_classes": [],
61
61
  # Timeout in seconds for browser-based challenge detection and resolution
62
62
  "browser_timeout": 30,
63
+ # Timeout in seconds for HTTP requests; ``None`` leaves requests with no timeout
64
+ "request_timeout": None,
63
65
  "thread_pool_size": (os.cpu_count() or 1) * 4,
64
66
  "connection_pool_size": thread_pool_size * 2,
65
67
  # The maximum number of failed attempts to allow before failing CLI authentication
@@ -58,11 +58,17 @@ class Order(Parsable):
58
58
  self.items: List[Item] = clone.items if clone and not full_details else self._parse_items()
59
59
  #: The Order number. May be ``None`` only when the Order is :attr:`cancelled` and Amazon stripped the order
60
60
  #: number from the details page (the ``order_number`` parameter is used as a fallback in that case).
61
- self.order_number: Optional[str] = clone.order_number if clone else self.safe_simple_parse(
61
+ # `required` is relaxed only when `order_number` is explicitly supplied (the `get_order()` path), so the
62
+ # fallback is never silently applied when parsing the history list, where the parsed value must be present.
63
+ _parsed_order_number = None if clone else self.safe_simple_parse(
62
64
  selector=self.config.selectors.FIELD_ORDER_NUMBER_SELECTOR,
63
- required=not self.cancelled,
65
+ required=not self.cancelled and order_number is None,
64
66
  prefix_split="#",
65
- prefix_split_fuzzy=True) or order_number
67
+ prefix_split_fuzzy=True)
68
+ if _parsed_order_number is None and order_number is not None:
69
+ logger.debug(f"Order number could not be parsed from the page; "
70
+ f"using supplied order_number={order_number}.")
71
+ self.order_number: Optional[str] = clone.order_number if clone else _parsed_order_number or order_number
66
72
  #: The Order details link.
67
73
  self.order_details_link: Optional[str] = clone.order_details_link if clone else self.safe_parse(
68
74
  self._parse_order_details_link)
@@ -154,7 +154,8 @@ class Selectors:
154
154
  FIELD_ORDER_PAYMENT_METHOD_SELECTOR = "img.pmts-payment-credit-card-instrument-logo"
155
155
  FIELD_ORDER_PAYMENT_METHOD_LAST_4_SELECTOR = "span:has(img.pmts-payment-credit-card-instrument-logo):last-child"
156
156
  FIELD_ORDER_SUBTOTALS_TAG_ITERATOR_SELECTOR = ["[data-component='orderSubtotals'] div.a-row",
157
- "div#od-subtotals div.a-row"]
157
+ "div#od-subtotals div.a-row",
158
+ "[data-component='chargeSummary'] div.od-line-item-row"]
158
159
  FIELD_ORDER_SUBTOTALS_TAG_POPOVER_PRELOAD_SELECTOR = ".a-popover-preload"
159
160
  FIELD_ORDER_SUBTOTALS_INNER_TAG_SELECTOR = "div.a-span-last"
160
161
  FIELD_ORDER_ADDRESS_SELECTOR = ["div.displayAddressDiv", "[data-component='shippingAddress']"]
@@ -200,6 +200,9 @@ class AmazonSession:
200
200
  url_to_log += "?" + encoded_params
201
201
  logger.debug(f"{method} request: {url_to_log}")
202
202
 
203
+ if self.config.request_timeout is not None:
204
+ kwargs.setdefault("timeout", self.config.request_timeout)
205
+
203
206
  response = self.session.request(method, url, **kwargs)
204
207
  amazon_session_response = AmazonSessionResponse(response,
205
208
  self.config.bs4_parser)
File without changes
File without changes
File without changes