amazon-orders 4.2.0__tar.gz → 4.2.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.
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/CHANGELOG.md +25 -1
- {amazon_orders-4.2.0/amazon_orders.egg-info → amazon_orders-4.2.2}/PKG-INFO +37 -31
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/README.md +27 -27
- {amazon_orders-4.2.0 → amazon_orders-4.2.2/amazon_orders.egg-info}/PKG-INFO +37 -31
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazon_orders.egg-info/requires.txt +4 -2
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/__init__.py +1 -1
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/contrib/waf/base.py +8 -3
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/forms.py +18 -3
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/session.py +2 -1
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/pyproject.toml +9 -3
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/LICENSE +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/MANIFEST.in +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazon_orders.egg-info/SOURCES.txt +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazon_orders.egg-info/dependency_links.txt +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazon_orders.egg-info/entry_points.txt +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazon_orders.egg-info/top_level.txt +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/banner.txt +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/cli.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/conf.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/constants.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/contrib/__init__.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/contrib/waf/__init__.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/contrib/waf/anticaptcha.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/contrib/waf/capsolver.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/contrib/waf/twocaptcha.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/__init__.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/item.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/order.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/parsable.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/recipient.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/seller.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/shipment.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/entity/transaction.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/exception.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/orders.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/selectors.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/transactions.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/amazonorders/util.py +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.2}/setup.cfg +0 -0
- {amazon_orders-4.2.0 → amazon_orders-4.2.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.2.
|
|
7
|
+
## [Unreleased](https://github.com/alexdlaird/amazon-orders/compare/4.2.2...HEAD)
|
|
8
|
+
|
|
9
|
+
## [4.2.2](https://github.com/alexdlaird/amazon-orders/compare/4.2.1...4.2.2) - 2026-06-06
|
|
10
|
+
|
|
11
|
+
### Fixed
|
|
12
|
+
|
|
13
|
+
- Improved error messaging for known JavaScript-based authentication challenges.
|
|
14
|
+
|
|
15
|
+
## [4.2.1](https://github.com/alexdlaird/amazon-orders/compare/4.2.0...4.2.1) - 2026-05-08
|
|
16
|
+
|
|
17
|
+
### Changed
|
|
18
|
+
|
|
19
|
+
- 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.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- 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.
|
|
8
24
|
|
|
9
25
|
## [4.2.0](https://github.com/alexdlaird/amazon-orders/compare/4.1.0...4.2.0) - 2026-05-08
|
|
10
26
|
|
|
@@ -16,6 +32,14 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
|
|
|
16
32
|
- Configurable Amazon domain for non-`.com` sites via the `domain` parameter on `AmazonSession`, the `domain` config field, and the `--domain` CLI flag.
|
|
17
33
|
- Improved currency parsing for English non-`.com` Amazon sites.
|
|
18
34
|
|
|
35
|
+
### Added
|
|
36
|
+
|
|
37
|
+
- 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.
|
|
38
|
+
- `auth_forms_classes` config option for plugging custom `AuthForm` subclasses into the auth chain without code changes.
|
|
39
|
+
- `AmazonSession.default_auth_forms()` static helper that returns the default form chain so callers can more easily extend it.
|
|
40
|
+
- Configurable Amazon domain for non-`.com` sites via the `domain` parameter on `AmazonSession`, the `domain` config field, and the `--domain` CLI flag.
|
|
41
|
+
- Improved currency parsing for English non-`.com` Amazon sites.
|
|
42
|
+
|
|
19
43
|
## [4.1.0](https://github.com/alexdlaird/amazon-orders/compare/4.0.19...4.1.0) - 2026-05-03
|
|
20
44
|
|
|
21
45
|
### Added
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-orders
|
|
3
|
-
Version: 4.2.
|
|
4
|
-
Summary: A Python
|
|
3
|
+
Version: 4.2.2
|
|
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>
|
|
7
7
|
License-Expression: MIT
|
|
@@ -9,6 +9,7 @@ Project-URL: Changelog, https://github.com/alexdlaird/amazon-orders/blob/main/CH
|
|
|
9
9
|
Project-URL: Documentation, https://amazon-orders.readthedocs.io
|
|
10
10
|
Project-URL: Sponsor, https://github.com/sponsors/alexdlaird
|
|
11
11
|
Project-URL: Source Code, https://github.com/alexdlaird/amazon-orders
|
|
12
|
+
Keywords: amazon,orders,order-history,scraper,web-scraping,receipts,cli
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
14
|
Classifier: Environment :: Console
|
|
14
15
|
Classifier: Environment :: Web Environment
|
|
@@ -20,7 +21,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
23
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
25
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
23
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
|
24
28
|
Requires-Python: >=3.9
|
|
25
29
|
Description-Content-Type: text/markdown
|
|
26
30
|
License-File: LICENSE
|
|
@@ -28,8 +32,8 @@ Requires-Dist: click>=7.1
|
|
|
28
32
|
Requires-Dist: requests>=2.23
|
|
29
33
|
Requires-Dist: Pillow>=9.0.1
|
|
30
34
|
Requires-Dist: beautifulsoup4>=4.12
|
|
31
|
-
Requires-Dist: PyYAML>=
|
|
32
|
-
Requires-Dist: python-dateutil>=2.
|
|
35
|
+
Requires-Dist: PyYAML>=6.0.3
|
|
36
|
+
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
33
37
|
Requires-Dist: pyotp>=2.9
|
|
34
38
|
Provides-Extra: captcha
|
|
35
39
|
Requires-Dist: amazoncaptcha>=0.4; extra == "captcha"
|
|
@@ -63,9 +67,11 @@ Requires-Dist: types-beautifulsoup4; extra == "docs"
|
|
|
63
67
|
Requires-Dist: types-Pillow; extra == "docs"
|
|
64
68
|
Requires-Dist: types-PyYAML; extra == "docs"
|
|
65
69
|
Requires-Dist: types-python-dateutil; extra == "docs"
|
|
70
|
+
Requires-Dist: sphinx-sitemap; extra == "docs"
|
|
71
|
+
Requires-Dist: sphinxext-opengraph; extra == "docs"
|
|
66
72
|
Dynamic: license-file
|
|
67
73
|
|
|
68
|
-
<p align="center"><img alt="amazon-orders - A Python
|
|
74
|
+
<p align="center"><img alt="amazon-orders - A Python library (and CLI) for Amazon order history" src="https://amazon-orders.readthedocs.io/_images/logo.png" /></p>
|
|
69
75
|
|
|
70
76
|
[](https://pypi.org/project/amazon-orders)
|
|
71
77
|
[](https://pypi.org/project/amazon-orders)
|
|
@@ -74,17 +80,17 @@ Dynamic: license-file
|
|
|
74
80
|
[](https://amazon-orders.readthedocs.io)
|
|
75
81
|
[](https://github.com/alexdlaird/amazon-orders/blob/main/LICENSE)
|
|
76
82
|
|
|
77
|
-
`amazon-orders` is an unofficial library that provides a Python API (and CLI) for Amazon order history.
|
|
78
|
-
|
|
79
|
-
This package works by parsing data from Amazon's consumer-facing website. A periodic build validates functionality
|
|
80
|
-
to ensure its stability, but as Amazon provides no official API to use, this package may break at any time (so check
|
|
81
|
-
often to ensure you're on the latest version).
|
|
83
|
+
`amazon-orders` is an unofficial library that provides a Python API (and CLI) for Amazon order history, line items, and transactions.
|
|
82
84
|
|
|
83
85
|
Only the English, `.com` version of Amazon is officially supported. Other Amazon domains can be
|
|
84
86
|
targeted by passing `domain` to [`AmazonSession`](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession)
|
|
85
87
|
(or `--domain` on the CLI), and other English-based sites may work by chance — see
|
|
86
88
|
[Known Limitations](https://amazon-orders.readthedocs.io/index.html#known-limitations) for details.
|
|
87
89
|
|
|
90
|
+
> **Note:** This package works by parsing data from Amazon's consumer-facing website. A periodic build validates
|
|
91
|
+
> functionality to ensure its stability, but as Amazon provides no official API to use, older versions of this
|
|
92
|
+
> package may break at any time, so it's recommended that you use the latest version.
|
|
93
|
+
|
|
88
94
|
## Installation
|
|
89
95
|
|
|
90
96
|
`amazon-orders` is available on [PyPI](https://pypi.org/project/amazon-orders/) and can be installed and/or upgraded using `pip`:
|
|
@@ -95,29 +101,9 @@ pip install amazon-orders --upgrade
|
|
|
95
101
|
|
|
96
102
|
That's it! `amazon-orders` is now available as a package to your Python projects and from the command line.
|
|
97
103
|
|
|
98
|
-
If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.
|
|
104
|
+
If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.2.*`, not `==4.2.2`) to
|
|
99
105
|
ensure you always get the latest stable release.
|
|
100
106
|
|
|
101
|
-
To enable **WAF auto-solve** via a third-party integration, install with the relevant extra:
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
pip install amazon-orders[capsolver]
|
|
105
|
-
pip install amazon-orders[anticaptcha]
|
|
106
|
-
pip install amazon-orders[2captcha]
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
See [Solving WAF Challenges](https://amazon-orders.readthedocs.io/waf.html) for details.
|
|
110
|
-
|
|
111
|
-
To enable **Captcha auto-solve** on Python <=3.12 (via the optional [`amazoncaptcha`](https://pypi.org/project/amazoncaptcha/)
|
|
112
|
-
dependency), install with the `captcha` extra:
|
|
113
|
-
|
|
114
|
-
```sh
|
|
115
|
-
pip install amazon-orders[captcha]
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Without this extra, Captcha challenges fall back to manual entry. `amazoncaptcha` is not available on Python 3.13+; see
|
|
119
|
-
[Captcha Blocking Login](https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login) for details.
|
|
120
|
-
|
|
121
107
|
## Basic Usage
|
|
122
108
|
|
|
123
109
|
You'll use [`AmazonSession`](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession) to
|
|
@@ -174,6 +160,26 @@ environment variables `amazon-orders` looks for are:
|
|
|
174
160
|
- `AMAZON_PASSWORD`
|
|
175
161
|
- `AMAZON_OTP_SECRET_KEY` (see [docs for usage](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession.otp_secret_key))
|
|
176
162
|
|
|
163
|
+
To enable **WAF auto-solve** via a third-party integration, install with the relevant extra:
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
pip install amazon-orders[capsolver]
|
|
167
|
+
pip install amazon-orders[anticaptcha]
|
|
168
|
+
pip install amazon-orders[2captcha]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
See [Solving WAF Challenges](https://amazon-orders.readthedocs.io/waf.html) for details.
|
|
172
|
+
|
|
173
|
+
To enable **Captcha auto-solve** on Python <=3.12 (via the optional [`amazoncaptcha`](https://pypi.org/project/amazoncaptcha/)
|
|
174
|
+
dependency), install with the `captcha` extra:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
pip install amazon-orders[captcha]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Without this extra, Captcha challenges fall back to manual entry. `amazoncaptcha` is not available on Python 3.13+; see
|
|
181
|
+
[Captcha Blocking Login](https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login) for details.
|
|
182
|
+
|
|
177
183
|
## Documentation
|
|
178
184
|
|
|
179
185
|
For more advanced usage, `amazon-orders`'s official documentation is available
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
<p align="center"><img alt="amazon-orders - A Python
|
|
1
|
+
<p align="center"><img alt="amazon-orders - A Python library (and CLI) for Amazon order history" src="https://amazon-orders.readthedocs.io/_images/logo.png" /></p>
|
|
2
2
|
|
|
3
3
|
[](https://pypi.org/project/amazon-orders)
|
|
4
4
|
[](https://pypi.org/project/amazon-orders)
|
|
@@ -7,17 +7,17 @@
|
|
|
7
7
|
[](https://amazon-orders.readthedocs.io)
|
|
8
8
|
[](https://github.com/alexdlaird/amazon-orders/blob/main/LICENSE)
|
|
9
9
|
|
|
10
|
-
`amazon-orders` is an unofficial library that provides a Python API (and CLI) for Amazon order history.
|
|
11
|
-
|
|
12
|
-
This package works by parsing data from Amazon's consumer-facing website. A periodic build validates functionality
|
|
13
|
-
to ensure its stability, but as Amazon provides no official API to use, this package may break at any time (so check
|
|
14
|
-
often to ensure you're on the latest version).
|
|
10
|
+
`amazon-orders` is an unofficial library that provides a Python API (and CLI) for Amazon order history, line items, and transactions.
|
|
15
11
|
|
|
16
12
|
Only the English, `.com` version of Amazon is officially supported. Other Amazon domains can be
|
|
17
13
|
targeted by passing `domain` to [`AmazonSession`](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession)
|
|
18
14
|
(or `--domain` on the CLI), and other English-based sites may work by chance — see
|
|
19
15
|
[Known Limitations](https://amazon-orders.readthedocs.io/index.html#known-limitations) for details.
|
|
20
16
|
|
|
17
|
+
> **Note:** This package works by parsing data from Amazon's consumer-facing website. A periodic build validates
|
|
18
|
+
> functionality to ensure its stability, but as Amazon provides no official API to use, older versions of this
|
|
19
|
+
> package may break at any time, so it's recommended that you use the latest version.
|
|
20
|
+
|
|
21
21
|
## Installation
|
|
22
22
|
|
|
23
23
|
`amazon-orders` is available on [PyPI](https://pypi.org/project/amazon-orders/) and can be installed and/or upgraded using `pip`:
|
|
@@ -28,29 +28,9 @@ 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.
|
|
31
|
+
If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.2.*`, not `==4.2.2`) to
|
|
32
32
|
ensure you always get the latest stable release.
|
|
33
33
|
|
|
34
|
-
To enable **WAF auto-solve** via a third-party integration, install with the relevant extra:
|
|
35
|
-
|
|
36
|
-
```sh
|
|
37
|
-
pip install amazon-orders[capsolver]
|
|
38
|
-
pip install amazon-orders[anticaptcha]
|
|
39
|
-
pip install amazon-orders[2captcha]
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
See [Solving WAF Challenges](https://amazon-orders.readthedocs.io/waf.html) for details.
|
|
43
|
-
|
|
44
|
-
To enable **Captcha auto-solve** on Python <=3.12 (via the optional [`amazoncaptcha`](https://pypi.org/project/amazoncaptcha/)
|
|
45
|
-
dependency), install with the `captcha` extra:
|
|
46
|
-
|
|
47
|
-
```sh
|
|
48
|
-
pip install amazon-orders[captcha]
|
|
49
|
-
```
|
|
50
|
-
|
|
51
|
-
Without this extra, Captcha challenges fall back to manual entry. `amazoncaptcha` is not available on Python 3.13+; see
|
|
52
|
-
[Captcha Blocking Login](https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login) for details.
|
|
53
|
-
|
|
54
34
|
## Basic Usage
|
|
55
35
|
|
|
56
36
|
You'll use [`AmazonSession`](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession) to
|
|
@@ -107,6 +87,26 @@ environment variables `amazon-orders` looks for are:
|
|
|
107
87
|
- `AMAZON_PASSWORD`
|
|
108
88
|
- `AMAZON_OTP_SECRET_KEY` (see [docs for usage](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession.otp_secret_key))
|
|
109
89
|
|
|
90
|
+
To enable **WAF auto-solve** via a third-party integration, install with the relevant extra:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
pip install amazon-orders[capsolver]
|
|
94
|
+
pip install amazon-orders[anticaptcha]
|
|
95
|
+
pip install amazon-orders[2captcha]
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
See [Solving WAF Challenges](https://amazon-orders.readthedocs.io/waf.html) for details.
|
|
99
|
+
|
|
100
|
+
To enable **Captcha auto-solve** on Python <=3.12 (via the optional [`amazoncaptcha`](https://pypi.org/project/amazoncaptcha/)
|
|
101
|
+
dependency), install with the `captcha` extra:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
pip install amazon-orders[captcha]
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
Without this extra, Captcha challenges fall back to manual entry. `amazoncaptcha` is not available on Python 3.13+; see
|
|
108
|
+
[Captcha Blocking Login](https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login) for details.
|
|
109
|
+
|
|
110
110
|
## Documentation
|
|
111
111
|
|
|
112
112
|
For more advanced usage, `amazon-orders`'s official documentation is available
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: amazon-orders
|
|
3
|
-
Version: 4.2.
|
|
4
|
-
Summary: A Python
|
|
3
|
+
Version: 4.2.2
|
|
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>
|
|
7
7
|
License-Expression: MIT
|
|
@@ -9,6 +9,7 @@ Project-URL: Changelog, https://github.com/alexdlaird/amazon-orders/blob/main/CH
|
|
|
9
9
|
Project-URL: Documentation, https://amazon-orders.readthedocs.io
|
|
10
10
|
Project-URL: Sponsor, https://github.com/sponsors/alexdlaird
|
|
11
11
|
Project-URL: Source Code, https://github.com/alexdlaird/amazon-orders
|
|
12
|
+
Keywords: amazon,orders,order-history,scraper,web-scraping,receipts,cli
|
|
12
13
|
Classifier: Development Status :: 5 - Production/Stable
|
|
13
14
|
Classifier: Environment :: Console
|
|
14
15
|
Classifier: Environment :: Web Environment
|
|
@@ -20,7 +21,10 @@ Classifier: Programming Language :: Python :: 3.10
|
|
|
20
21
|
Classifier: Programming Language :: Python :: 3.11
|
|
21
22
|
Classifier: Programming Language :: Python :: 3.12
|
|
22
23
|
Classifier: Programming Language :: Python :: 3.13
|
|
24
|
+
Classifier: Topic :: Internet :: WWW/HTTP :: Browsers
|
|
25
|
+
Classifier: Topic :: Office/Business :: Financial
|
|
23
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
27
|
+
Classifier: Topic :: Text Processing :: Markup :: HTML
|
|
24
28
|
Requires-Python: >=3.9
|
|
25
29
|
Description-Content-Type: text/markdown
|
|
26
30
|
License-File: LICENSE
|
|
@@ -28,8 +32,8 @@ Requires-Dist: click>=7.1
|
|
|
28
32
|
Requires-Dist: requests>=2.23
|
|
29
33
|
Requires-Dist: Pillow>=9.0.1
|
|
30
34
|
Requires-Dist: beautifulsoup4>=4.12
|
|
31
|
-
Requires-Dist: PyYAML>=
|
|
32
|
-
Requires-Dist: python-dateutil>=2.
|
|
35
|
+
Requires-Dist: PyYAML>=6.0.3
|
|
36
|
+
Requires-Dist: python-dateutil>=2.9.0.post0
|
|
33
37
|
Requires-Dist: pyotp>=2.9
|
|
34
38
|
Provides-Extra: captcha
|
|
35
39
|
Requires-Dist: amazoncaptcha>=0.4; extra == "captcha"
|
|
@@ -63,9 +67,11 @@ Requires-Dist: types-beautifulsoup4; extra == "docs"
|
|
|
63
67
|
Requires-Dist: types-Pillow; extra == "docs"
|
|
64
68
|
Requires-Dist: types-PyYAML; extra == "docs"
|
|
65
69
|
Requires-Dist: types-python-dateutil; extra == "docs"
|
|
70
|
+
Requires-Dist: sphinx-sitemap; extra == "docs"
|
|
71
|
+
Requires-Dist: sphinxext-opengraph; extra == "docs"
|
|
66
72
|
Dynamic: license-file
|
|
67
73
|
|
|
68
|
-
<p align="center"><img alt="amazon-orders - A Python
|
|
74
|
+
<p align="center"><img alt="amazon-orders - A Python library (and CLI) for Amazon order history" src="https://amazon-orders.readthedocs.io/_images/logo.png" /></p>
|
|
69
75
|
|
|
70
76
|
[](https://pypi.org/project/amazon-orders)
|
|
71
77
|
[](https://pypi.org/project/amazon-orders)
|
|
@@ -74,17 +80,17 @@ Dynamic: license-file
|
|
|
74
80
|
[](https://amazon-orders.readthedocs.io)
|
|
75
81
|
[](https://github.com/alexdlaird/amazon-orders/blob/main/LICENSE)
|
|
76
82
|
|
|
77
|
-
`amazon-orders` is an unofficial library that provides a Python API (and CLI) for Amazon order history.
|
|
78
|
-
|
|
79
|
-
This package works by parsing data from Amazon's consumer-facing website. A periodic build validates functionality
|
|
80
|
-
to ensure its stability, but as Amazon provides no official API to use, this package may break at any time (so check
|
|
81
|
-
often to ensure you're on the latest version).
|
|
83
|
+
`amazon-orders` is an unofficial library that provides a Python API (and CLI) for Amazon order history, line items, and transactions.
|
|
82
84
|
|
|
83
85
|
Only the English, `.com` version of Amazon is officially supported. Other Amazon domains can be
|
|
84
86
|
targeted by passing `domain` to [`AmazonSession`](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession)
|
|
85
87
|
(or `--domain` on the CLI), and other English-based sites may work by chance — see
|
|
86
88
|
[Known Limitations](https://amazon-orders.readthedocs.io/index.html#known-limitations) for details.
|
|
87
89
|
|
|
90
|
+
> **Note:** This package works by parsing data from Amazon's consumer-facing website. A periodic build validates
|
|
91
|
+
> functionality to ensure its stability, but as Amazon provides no official API to use, older versions of this
|
|
92
|
+
> package may break at any time, so it's recommended that you use the latest version.
|
|
93
|
+
|
|
88
94
|
## Installation
|
|
89
95
|
|
|
90
96
|
`amazon-orders` is available on [PyPI](https://pypi.org/project/amazon-orders/) and can be installed and/or upgraded using `pip`:
|
|
@@ -95,29 +101,9 @@ pip install amazon-orders --upgrade
|
|
|
95
101
|
|
|
96
102
|
That's it! `amazon-orders` is now available as a package to your Python projects and from the command line.
|
|
97
103
|
|
|
98
|
-
If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.
|
|
104
|
+
If pinning, be sure to use a wildcard for the [minor version](https://semver.org/) (ex. `==4.2.*`, not `==4.2.2`) to
|
|
99
105
|
ensure you always get the latest stable release.
|
|
100
106
|
|
|
101
|
-
To enable **WAF auto-solve** via a third-party integration, install with the relevant extra:
|
|
102
|
-
|
|
103
|
-
```sh
|
|
104
|
-
pip install amazon-orders[capsolver]
|
|
105
|
-
pip install amazon-orders[anticaptcha]
|
|
106
|
-
pip install amazon-orders[2captcha]
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
See [Solving WAF Challenges](https://amazon-orders.readthedocs.io/waf.html) for details.
|
|
110
|
-
|
|
111
|
-
To enable **Captcha auto-solve** on Python <=3.12 (via the optional [`amazoncaptcha`](https://pypi.org/project/amazoncaptcha/)
|
|
112
|
-
dependency), install with the `captcha` extra:
|
|
113
|
-
|
|
114
|
-
```sh
|
|
115
|
-
pip install amazon-orders[captcha]
|
|
116
|
-
```
|
|
117
|
-
|
|
118
|
-
Without this extra, Captcha challenges fall back to manual entry. `amazoncaptcha` is not available on Python 3.13+; see
|
|
119
|
-
[Captcha Blocking Login](https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login) for details.
|
|
120
|
-
|
|
121
107
|
## Basic Usage
|
|
122
108
|
|
|
123
109
|
You'll use [`AmazonSession`](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession) to
|
|
@@ -174,6 +160,26 @@ environment variables `amazon-orders` looks for are:
|
|
|
174
160
|
- `AMAZON_PASSWORD`
|
|
175
161
|
- `AMAZON_OTP_SECRET_KEY` (see [docs for usage](https://amazon-orders.readthedocs.io/api.html#amazonorders.session.AmazonSession.otp_secret_key))
|
|
176
162
|
|
|
163
|
+
To enable **WAF auto-solve** via a third-party integration, install with the relevant extra:
|
|
164
|
+
|
|
165
|
+
```sh
|
|
166
|
+
pip install amazon-orders[capsolver]
|
|
167
|
+
pip install amazon-orders[anticaptcha]
|
|
168
|
+
pip install amazon-orders[2captcha]
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
See [Solving WAF Challenges](https://amazon-orders.readthedocs.io/waf.html) for details.
|
|
172
|
+
|
|
173
|
+
To enable **Captcha auto-solve** on Python <=3.12 (via the optional [`amazoncaptcha`](https://pypi.org/project/amazoncaptcha/)
|
|
174
|
+
dependency), install with the `captcha` extra:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
pip install amazon-orders[captcha]
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
Without this extra, Captcha challenges fall back to manual entry. `amazoncaptcha` is not available on Python 3.13+; see
|
|
181
|
+
[Captcha Blocking Login](https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login) for details.
|
|
182
|
+
|
|
177
183
|
## Documentation
|
|
178
184
|
|
|
179
185
|
For more advanced usage, `amazon-orders`'s official documentation is available
|
|
@@ -2,8 +2,8 @@ click>=7.1
|
|
|
2
2
|
requests>=2.23
|
|
3
3
|
Pillow>=9.0.1
|
|
4
4
|
beautifulsoup4>=4.12
|
|
5
|
-
PyYAML>=
|
|
6
|
-
python-dateutil>=2.
|
|
5
|
+
PyYAML>=6.0.3
|
|
6
|
+
python-dateutil>=2.9.0.post0
|
|
7
7
|
pyotp>=2.9
|
|
8
8
|
|
|
9
9
|
[2captcha]
|
|
@@ -40,6 +40,8 @@ types-beautifulsoup4
|
|
|
40
40
|
types-Pillow
|
|
41
41
|
types-PyYAML
|
|
42
42
|
types-python-dateutil
|
|
43
|
+
sphinx-sitemap
|
|
44
|
+
sphinxext-opengraph
|
|
43
45
|
|
|
44
46
|
[integration]
|
|
45
47
|
pytest-rerunfailures
|
|
@@ -46,13 +46,18 @@ class AwsWafForm(AuthForm):
|
|
|
46
46
|
def __init__(self,
|
|
47
47
|
config: AmazonOrdersConfig) -> None:
|
|
48
48
|
super().__init__(config, selector=None)
|
|
49
|
-
|
|
49
|
+
config_key = self.API_KEY_ENV_VAR.lower()
|
|
50
|
+
api_key = (os.environ.get(self.API_KEY_ENV_VAR)
|
|
51
|
+
or getattr(config, config_key, None)
|
|
52
|
+
or "")
|
|
50
53
|
if not api_key:
|
|
51
54
|
raise AmazonOrdersError(
|
|
52
55
|
f"{type(self).__name__} requires the {self.API_KEY_ENV_VAR} "
|
|
53
|
-
f"environment variable to be set."
|
|
56
|
+
f"environment variable, or the {config_key} config key, to be set."
|
|
54
57
|
)
|
|
55
|
-
#: The third-party solver API key
|
|
58
|
+
#: The third-party solver API key. Resolved (in order of precedence) from the
|
|
59
|
+
#: :attr:`API_KEY_ENV_VAR` environment variable, then from the lowercase config key
|
|
60
|
+
#: of the same name on :class:`~amazonorders.conf.AmazonOrdersConfig`.
|
|
56
61
|
self.api_key: str = api_key
|
|
57
62
|
self._goku: Optional[Dict[str, Any]] = None
|
|
58
63
|
self._challenge_script: Optional[str] = None
|
|
@@ -451,6 +451,22 @@ class CaptchaForm(AuthForm):
|
|
|
451
451
|
self.data.update(additional_attrs)
|
|
452
452
|
|
|
453
453
|
|
|
454
|
+
class AcicAuthBlocker(AuthForm):
|
|
455
|
+
def __init__(self,
|
|
456
|
+
config: AmazonOrdersConfig) -> None:
|
|
457
|
+
super().__init__(config, None)
|
|
458
|
+
|
|
459
|
+
def select_form(self,
|
|
460
|
+
amazon_session: "AmazonSession",
|
|
461
|
+
parsed: Tag) -> bool:
|
|
462
|
+
if parsed.find(id="aa-challenge-page-captcha-container"):
|
|
463
|
+
raise AmazonOrdersAuthError(
|
|
464
|
+
"Amazon returned a JavaScript-based authentication challenge that this library cannot solve. See "
|
|
465
|
+
"https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login for help.")
|
|
466
|
+
|
|
467
|
+
return False
|
|
468
|
+
|
|
469
|
+
|
|
454
470
|
class JSAuthBlocker(AuthForm):
|
|
455
471
|
def __init__(self,
|
|
456
472
|
config: AmazonOrdersConfig,
|
|
@@ -467,8 +483,7 @@ class JSAuthBlocker(AuthForm):
|
|
|
467
483
|
|
|
468
484
|
if re.search(self.regex, parsed.text):
|
|
469
485
|
raise AmazonOrdersAuthError(
|
|
470
|
-
"
|
|
471
|
-
"
|
|
472
|
-
"https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login for more details.")
|
|
486
|
+
"Amazon returned a JavaScript-based authentication challenge that this library cannot solve. See "
|
|
487
|
+
"https://amazon-orders.readthedocs.io/troubleshooting.html#captcha-blocking-login for help.")
|
|
473
488
|
|
|
474
489
|
return False
|
|
@@ -15,7 +15,7 @@ from requests.utils import dict_from_cookiejar
|
|
|
15
15
|
|
|
16
16
|
from amazonorders.conf import AmazonOrdersConfig, config_file_lock, cookies_file_lock, debug_output_file_lock
|
|
17
17
|
from amazonorders.exception import AmazonOrdersAuthError, AmazonOrdersError, AmazonOrdersAuthRedirectError
|
|
18
|
-
from amazonorders.forms import (AuthForm, CaptchaForm, JSAuthBlocker, MfaDeviceSelectForm, MfaForm,
|
|
18
|
+
from amazonorders.forms import (AuthForm, AcicAuthBlocker, CaptchaForm, JSAuthBlocker, MfaDeviceSelectForm, MfaForm,
|
|
19
19
|
SignInForm, ClaimForm, IntentForm)
|
|
20
20
|
from amazonorders.util import AmazonSessionResponse, load_class
|
|
21
21
|
|
|
@@ -164,6 +164,7 @@ class AmazonSession:
|
|
|
164
164
|
"field-keywords"),
|
|
165
165
|
MfaForm(config,
|
|
166
166
|
config.selectors.CAPTCHA_OTP_FORM_SELECTOR),
|
|
167
|
+
AcicAuthBlocker(config),
|
|
167
168
|
JSAuthBlocker(config,
|
|
168
169
|
config.constants.JS_ROBOT_TEXT_REGEX)]
|
|
169
170
|
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "amazon-orders"
|
|
3
3
|
dynamic = ["version"]
|
|
4
|
-
description = "A Python
|
|
4
|
+
description = "A Python library (and CLI) for Amazon order history"
|
|
5
5
|
readme = "README.md"
|
|
6
6
|
license = "MIT"
|
|
7
|
+
keywords = ["amazon", "orders", "order-history", "scraper", "web-scraping", "receipts", "cli"]
|
|
7
8
|
authors = [{ name = "Alex Laird", email = "contact@alexlaird.com" }]
|
|
8
9
|
maintainers = [{ name = "Alex Laird", email = "contact@alexlaird.com" }]
|
|
9
10
|
requires-python = ">=3.9"
|
|
@@ -12,8 +13,8 @@ dependencies = [
|
|
|
12
13
|
"requests>=2.23",
|
|
13
14
|
"Pillow>=9.0.1",
|
|
14
15
|
"beautifulsoup4>=4.12",
|
|
15
|
-
"PyYAML>=
|
|
16
|
-
"python-dateutil>=2.
|
|
16
|
+
"PyYAML>=6.0.3",
|
|
17
|
+
"python-dateutil>=2.9.0.post0",
|
|
17
18
|
"pyotp>=2.9",
|
|
18
19
|
]
|
|
19
20
|
classifiers = [
|
|
@@ -28,7 +29,10 @@ classifiers = [
|
|
|
28
29
|
"Programming Language :: Python :: 3.11",
|
|
29
30
|
"Programming Language :: Python :: 3.12",
|
|
30
31
|
"Programming Language :: Python :: 3.13",
|
|
32
|
+
"Topic :: Internet :: WWW/HTTP :: Browsers",
|
|
33
|
+
"Topic :: Office/Business :: Financial",
|
|
31
34
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
35
|
+
"Topic :: Text Processing :: Markup :: HTML",
|
|
32
36
|
]
|
|
33
37
|
|
|
34
38
|
[project.optional-dependencies]
|
|
@@ -71,6 +75,8 @@ docs = [
|
|
|
71
75
|
"types-Pillow",
|
|
72
76
|
"types-PyYAML",
|
|
73
77
|
"types-python-dateutil",
|
|
78
|
+
"sphinx-sitemap",
|
|
79
|
+
"sphinxext-opengraph",
|
|
74
80
|
]
|
|
75
81
|
|
|
76
82
|
[project.scripts]
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|