amazon-orders 4.4.1__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.1 → amazon_orders-4.4.2}/CHANGELOG.md +16 -63
  2. {amazon_orders-4.4.1/amazon_orders.egg-info → amazon_orders-4.4.2}/PKG-INFO +1 -1
  3. {amazon_orders-4.4.1 → amazon_orders-4.4.2/amazon_orders.egg-info}/PKG-INFO +1 -1
  4. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/__init__.py +1 -1
  5. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/conf.py +2 -0
  6. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/order.py +9 -3
  7. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/session.py +3 -0
  8. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/LICENSE +0 -0
  9. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/MANIFEST.in +0 -0
  10. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/README.md +0 -0
  11. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazon_orders.egg-info/SOURCES.txt +0 -0
  12. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazon_orders.egg-info/dependency_links.txt +0 -0
  13. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazon_orders.egg-info/entry_points.txt +0 -0
  14. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazon_orders.egg-info/requires.txt +0 -0
  15. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazon_orders.egg-info/top_level.txt +0 -0
  16. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/banner.txt +0 -0
  17. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/cli.py +0 -0
  18. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/constants.py +0 -0
  19. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/__init__.py +0 -0
  20. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/browser/__init__.py +0 -0
  21. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/browser/playwright.py +0 -0
  22. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/waf/__init__.py +0 -0
  23. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/waf/anticaptcha.py +0 -0
  24. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/waf/base.py +0 -0
  25. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/waf/capsolver.py +0 -0
  26. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/contrib/waf/twocaptcha.py +0 -0
  27. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/__init__.py +0 -0
  28. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/item.py +0 -0
  29. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/parsable.py +0 -0
  30. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/recipient.py +0 -0
  31. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/seller.py +0 -0
  32. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/shipment.py +0 -0
  33. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/entity/transaction.py +0 -0
  34. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/exception.py +0 -0
  35. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/forms.py +0 -0
  36. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/orders.py +0 -0
  37. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/selectors.py +0 -0
  38. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/transactions.py +0 -0
  39. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/amazonorders/util.py +0 -0
  40. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/pyproject.toml +0 -0
  41. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/setup.cfg +0 -0
  42. {amazon_orders-4.4.1 → amazon_orders-4.4.2}/tests/testcase.py +0 -0
@@ -4,26 +4,28 @@ 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.1...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.
8
18
 
9
19
  ## [4.4.1](https://github.com/alexdlaird/amazon-orders/compare/4.4.0...4.4.1) - 2026-07-04
10
20
 
11
21
  ### Fixed
12
22
 
13
- - Fixed parsing of some `Order` fields on older order pages using the `chargeSummary` layout.
23
+ - Parsing of some `Order` fields on older order pages using the `chargeSummary` layout.
14
24
 
15
25
  ## [4.4.0](https://github.com/alexdlaird/amazon-orders/compare/4.3.1...4.4.0) - 2026-06-12
16
26
 
17
27
  ### Added
18
28
 
19
- - `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.
20
- - `AwsWafForm._solve_visual_captcha()` subclass hook for Puzzle classification. `CapSolverWafForm` implements this via the `AwsWafClassification` task type.
21
- - `browser_timeout` config key (defaults to 30s) controlling how long the browser waits for challenge elements to appear.
22
- - `retry_failures` input on the integration test workflow for fail-fast CI runs.
23
- - Build and stability improvements.
24
-
25
- ### Added
26
-
27
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.
28
30
  - `AwsWafForm._solve_visual_captcha()` subclass hook for Puzzle classification. `CapSolverWafForm` implements this via the `AwsWafClassification` task type.
29
31
  - `browser_timeout` config key (defaults to 30s) controlling how long the browser waits for challenge elements to appear.
@@ -36,20 +38,15 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
36
38
  - `AmazonOrders.get_invoice()` to fetch an Order's print-friendly invoice page, returning the response (including its parsed HTML) for rendering or printing.
37
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.
38
40
 
39
- ### Added
40
-
41
- - `AmazonOrders.get_invoice()` to fetch an Order's print-friendly invoice page, returning the response (including its parsed HTML) for rendering or printing.
42
- - `AmazonTransactions.get_transactions()` `order_id` parameter to scope results to a single Order server-side via Amazon's `transactionTag` filter, bypassing the `days` window.
43
-
44
41
  ## [4.3.0](https://github.com/alexdlaird/amazon-orders/compare/4.2.2...4.3.0) - 2026-06-07
45
42
 
46
43
  ### Added
47
44
 
48
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.
49
- - `PlaywrightAcicForm` handles the ACIC challenge page. If an embedded AWS WAF CAPTCHA is present, it delegates automatically to any configured WAF solver extra.
50
- - `PlaywrightJSAuthForm` is a best-effort handler for the JS robot-detection page.
51
- - `PlaywrightManualWafForm` opens a **visible** browser window for manual WAF CAPTCHA solving a free alternative to the paid `[waf]` extras for local/interactive use.
52
- - `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.
53
50
  - `Transaction.payment_method_last_4`, the masked card digits parsed from `payment_method`, mirroring the existing field on `Order`.
54
51
 
55
52
  ### Changed
@@ -57,15 +54,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
57
54
  - JavaScript-based authentication challenge errors now direct users to the `[browser]` extra rather than reporting the challenge as unsolvable.
58
55
  - All user-facing error messages that include install commands now wrap those commands in backticks.
59
56
 
60
- ### Added
61
-
62
- - `[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.
63
- - `PlaywrightAcicForm` handles the ACIC challenge page. If an embedded WAF is present, it delegates automatically to any configured WAF solver extra.
64
- - `PlaywrightJSAuthForm` is a best-effort handler for the JS bot-detection page.
65
- - `PlaywrightManualWafForm` opens a **visible** browser window for you to solve the challenge yourself, suitable when a display is available.
66
- - `browser` config key and `AMAZON_BROWSER` environment variable to select between `chromium` (default) and `firefox` browser user agents.
67
- - `Transaction.payment_method_last_4`, the masked card digits parsed from `payment_method`, mirroring the existing field on `Order`.
68
-
69
57
  ## [4.2.2](https://github.com/alexdlaird/amazon-orders/compare/4.2.1...4.2.2) - 2026-06-06
70
58
 
71
59
  ### Fixed
@@ -78,10 +66,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
78
66
 
79
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.
80
68
 
81
- ### Changed
82
-
83
- - 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.
84
-
85
69
  ## [4.2.0](https://github.com/alexdlaird/amazon-orders/compare/4.1.0...4.2.0) - 2026-05-08
86
70
 
87
71
  ### Added
@@ -92,14 +76,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
92
76
  - Configurable Amazon domain for non-`.com` sites via the `domain` parameter on `AmazonSession`, the `domain` config field, and the `--domain` CLI flag.
93
77
  - Improved currency parsing for English non-`.com` Amazon sites.
94
78
 
95
- ### Added
96
-
97
- - 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.
98
- - `auth_forms_classes` config option for plugging custom `AuthForm` subclasses into the auth chain without code changes.
99
- - `AmazonSession.default_auth_forms()` static helper that returns the default form chain so callers can more easily extend it.
100
- - Configurable Amazon domain for non-`.com` sites via the `domain` parameter on `AmazonSession`, the `domain` config field, and the `--domain` CLI flag.
101
- - Improved currency parsing for English non-`.com` Amazon sites.
102
-
103
79
  ## [4.1.0](https://github.com/alexdlaird/amazon-orders/compare/4.0.19...4.1.0) - 2026-05-03
104
80
 
105
81
  ### Added
@@ -114,28 +90,12 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
114
90
 
115
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.
116
92
 
117
- ### Added
118
-
119
- - Python 3.13 support.
120
-
121
- ### Changed
122
-
123
- - `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.
124
-
125
- ### Deprecated
126
-
127
- - 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.
128
-
129
93
  ## [4.0.19](https://github.com/alexdlaird/amazon-orders/compare/4.0.18...4.0.19) - 2026-04-29
130
94
 
131
95
  ### Added
132
96
 
133
97
  - Build and stability improvements.
134
98
 
135
- ### Added
136
-
137
- - Build and stability improvements.
138
-
139
99
  ## [4.0.18](https://github.com/alexdlaird/amazon-orders/compare/4.0.17...4.0.18) - 2025-12-06
140
100
 
141
101
  ### Added
@@ -260,13 +220,6 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
260
220
 
261
221
  ### Added
262
222
 
263
- - Improvements around auth retry logic.
264
- - Detect JavaScript-based auth challenges (which can be solved) and give more clear error for them.
265
- - Stability improvements.
266
- - Documentation improvements.
267
-
268
- ### Added
269
-
270
223
  - Stability improvements for auth flow.
271
224
  - Documentation improvements.
272
225
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-orders
3
- Version: 4.4.1
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>
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: amazon-orders
3
- Version: 4.4.1
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>
@@ -1,3 +1,3 @@
1
1
  __copyright__ = "Copyright (c) 2024-2025 Alex Laird"
2
2
  __license__ = "MIT"
3
- __version__ = "4.4.1"
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)
@@ -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
File without changes