productmapper 1.2.1__py3-none-any.whl
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.
- productmapper/__init__.py +70 -0
- productmapper/_version.py +21 -0
- productmapper/client.py +730 -0
- productmapper/exceptions.py +179 -0
- productmapper/models.py +458 -0
- productmapper/py.typed +0 -0
- productmapper-1.2.1.dist-info/METADATA +376 -0
- productmapper-1.2.1.dist-info/RECORD +10 -0
- productmapper-1.2.1.dist-info/WHEEL +4 -0
- productmapper-1.2.1.dist-info/licenses/LICENSE +21 -0
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
"""Official Python client for the ProductMapper API.
|
|
2
|
+
|
|
3
|
+
Resolve a UPC, EAN, GTIN, ASIN or free-text title into a live Amazon catalog listing.
|
|
4
|
+
|
|
5
|
+
from productmapper import ProductMapper
|
|
6
|
+
|
|
7
|
+
client = ProductMapper(api_key="pm_live_...")
|
|
8
|
+
result = client.lookup(value="079361039905", type="UPC")
|
|
9
|
+
print(result.title, result.price)
|
|
10
|
+
|
|
11
|
+
See https://product-mapper.com/docs for the full API reference.
|
|
12
|
+
"""
|
|
13
|
+
|
|
14
|
+
from ._version import __version__
|
|
15
|
+
from .client import DEFAULT_BASE_URL, AsyncProductMapper, ProductMapper
|
|
16
|
+
from .exceptions import (
|
|
17
|
+
AuthenticationError,
|
|
18
|
+
ConnectionError,
|
|
19
|
+
CreditsExhaustedError,
|
|
20
|
+
JobFailedError,
|
|
21
|
+
NotFoundError,
|
|
22
|
+
PermissionError,
|
|
23
|
+
ProductMapperError,
|
|
24
|
+
RateLimitError,
|
|
25
|
+
ServerError,
|
|
26
|
+
TimeoutError,
|
|
27
|
+
ValidationError,
|
|
28
|
+
)
|
|
29
|
+
from .models import (
|
|
30
|
+
IDENTIFIER_TYPES,
|
|
31
|
+
REGIONS,
|
|
32
|
+
AmazonListing,
|
|
33
|
+
BatchItem,
|
|
34
|
+
BatchJob,
|
|
35
|
+
HistoryPage,
|
|
36
|
+
HistoryRow,
|
|
37
|
+
JobStatus,
|
|
38
|
+
ListingIdentifiers,
|
|
39
|
+
MappingResult,
|
|
40
|
+
QueuedLookup,
|
|
41
|
+
)
|
|
42
|
+
|
|
43
|
+
__all__ = [
|
|
44
|
+
"DEFAULT_BASE_URL",
|
|
45
|
+
"IDENTIFIER_TYPES",
|
|
46
|
+
"REGIONS",
|
|
47
|
+
"AmazonListing",
|
|
48
|
+
"AsyncProductMapper",
|
|
49
|
+
"AuthenticationError",
|
|
50
|
+
"BatchItem",
|
|
51
|
+
"BatchJob",
|
|
52
|
+
"ConnectionError",
|
|
53
|
+
"CreditsExhaustedError",
|
|
54
|
+
"HistoryPage",
|
|
55
|
+
"HistoryRow",
|
|
56
|
+
"JobFailedError",
|
|
57
|
+
"JobStatus",
|
|
58
|
+
"ListingIdentifiers",
|
|
59
|
+
"MappingResult",
|
|
60
|
+
"NotFoundError",
|
|
61
|
+
"PermissionError",
|
|
62
|
+
"ProductMapper",
|
|
63
|
+
"ProductMapperError",
|
|
64
|
+
"QueuedLookup",
|
|
65
|
+
"RateLimitError",
|
|
66
|
+
"ServerError",
|
|
67
|
+
"TimeoutError",
|
|
68
|
+
"ValidationError",
|
|
69
|
+
"__version__",
|
|
70
|
+
]
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"""Single source of truth for the package version.
|
|
2
|
+
|
|
3
|
+
The version is declared once, in ``pyproject.toml``, and read back from the installed
|
|
4
|
+
package metadata at import time. Nothing else in the codebase hardcodes it, so a release
|
|
5
|
+
cannot ship a User-Agent or ``__version__`` that disagrees with the published version.
|
|
6
|
+
|
|
7
|
+
The fallback only matters when the package is imported from a source tree that was never
|
|
8
|
+
installed (for example a plain ``sys.path`` manipulation), where no metadata exists.
|
|
9
|
+
"""
|
|
10
|
+
|
|
11
|
+
from __future__ import annotations
|
|
12
|
+
|
|
13
|
+
from importlib.metadata import PackageNotFoundError
|
|
14
|
+
from importlib.metadata import version as _metadata_version
|
|
15
|
+
|
|
16
|
+
__all__ = ["__version__"]
|
|
17
|
+
|
|
18
|
+
try:
|
|
19
|
+
__version__: str = _metadata_version("productmapper")
|
|
20
|
+
except PackageNotFoundError: # pragma: no cover - only hit in an uninstalled source tree
|
|
21
|
+
__version__ = "0.0.0.dev0"
|