vtexpy 0.0.0b18__tar.gz → 0.0.0b20__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.
Potentially problematic release.
This version of vtexpy might be problematic. Click here for more details.
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/PKG-INFO +4 -3
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/README.md +1 -1
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/pyproject.toml +3 -2
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/custom.py +1 -1
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/logistics.py +18 -1
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/orders.py +5 -3
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_utils.py +13 -7
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/LICENSE +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/__init__.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/__init__.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/base.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/catalog.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/checkout.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/license_manager.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/master_data.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/payments_gateway.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/promotions_and_taxes.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/types/__init__.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/types/catalog.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/types/generic.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_api/types/license_manager.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_config.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_constants.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_dto.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_exceptions.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_logging.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_sentinels.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_types.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/_vtex.py +0 -0
- {vtexpy-0.0.0b18 → vtexpy-0.0.0b20}/vtex/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: vtexpy
|
|
3
|
-
Version: 0.0.
|
|
3
|
+
Version: 0.0.0b20
|
|
4
4
|
Summary: Unofficial VTEX API's Python SDK
|
|
5
5
|
Home-page: https://github.com/lvieirajr/vtex-python
|
|
6
6
|
License: Apache
|
|
@@ -9,7 +9,7 @@ Author: Luis Vieira
|
|
|
9
9
|
Author-email: lvieira@lvieira.com
|
|
10
10
|
Maintainer: Luis Vieira
|
|
11
11
|
Maintainer-email: lvieira@lvieira.com
|
|
12
|
-
Requires-Python: >=3.9,<3.
|
|
12
|
+
Requires-Python: >=3.9,<3.14
|
|
13
13
|
Classifier: Development Status :: 4 - Beta
|
|
14
14
|
Classifier: Intended Audience :: Developers
|
|
15
15
|
Classifier: License :: OSI Approved :: Apache Software License
|
|
@@ -21,6 +21,7 @@ Classifier: Programming Language :: Python :: 3.9
|
|
|
21
21
|
Classifier: Programming Language :: Python :: 3.10
|
|
22
22
|
Classifier: Programming Language :: Python :: 3.11
|
|
23
23
|
Classifier: Programming Language :: Python :: 3.12
|
|
24
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
24
25
|
Classifier: Topic :: Software Development :: Libraries
|
|
25
26
|
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
26
27
|
Classifier: Typing :: Typed
|
|
@@ -57,7 +58,7 @@ development and breaking changes are expected on the external API.
|
|
|
57
58
|
|
|
58
59
|
#### Requirements
|
|
59
60
|
|
|
60
|
-
- Python >= 3.9, < 3.
|
|
61
|
+
- Python >= 3.9, < 3.14
|
|
61
62
|
|
|
62
63
|
#### Installation
|
|
63
64
|
|
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
5
5
|
[tool.poetry]
|
|
6
6
|
name = "vtexpy"
|
|
7
7
|
description = "Unofficial VTEX API's Python SDK"
|
|
8
|
-
version = "0.0.
|
|
8
|
+
version = "0.0.0b20"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = "Apache"
|
|
11
11
|
authors = [
|
|
@@ -28,6 +28,7 @@ classifiers = [
|
|
|
28
28
|
"Programming Language :: Python :: 3.10",
|
|
29
29
|
"Programming Language :: Python :: 3.11",
|
|
30
30
|
"Programming Language :: Python :: 3.12",
|
|
31
|
+
"Programming Language :: Python :: 3.13",
|
|
31
32
|
"Operating System :: OS Independent",
|
|
32
33
|
"Topic :: Software Development :: Libraries",
|
|
33
34
|
"Topic :: Software Development :: Libraries :: Python Modules",
|
|
@@ -38,7 +39,7 @@ packages = [
|
|
|
38
39
|
]
|
|
39
40
|
|
|
40
41
|
[tool.poetry.dependencies]
|
|
41
|
-
python = ">=3.9,<3.
|
|
42
|
+
python = ">=3.9,<3.14"
|
|
42
43
|
httpx = {version = ">=0.26,<1.0"}
|
|
43
44
|
pydantic = {version = ">=2.6,<3.0"}
|
|
44
45
|
python-dateutil = {version = ">=2.9,<3.0"}
|
|
@@ -61,7 +61,7 @@ class CustomAPI(BaseAPI):
|
|
|
61
61
|
def get_creation_date(self) -> datetime:
|
|
62
62
|
return to_datetime(
|
|
63
63
|
self.client.license_manager.get_account().data["creation_date"],
|
|
64
|
-
)
|
|
64
|
+
).replace(hour=0, minute=0, second=0, microsecond=0)
|
|
65
65
|
|
|
66
66
|
def list_sites(self) -> List[AccountSite]:
|
|
67
67
|
return self.client.license_manager.get_account().data["sites"]
|
|
@@ -9,7 +9,7 @@ from .._constants import (
|
|
|
9
9
|
LIST_SHIPPING_POLICIES_START_PAGE,
|
|
10
10
|
MIN_PAGE_SIZE,
|
|
11
11
|
)
|
|
12
|
-
from .._dto import VTEXDataResponse, VTEXPaginatedItemsResponse
|
|
12
|
+
from .._dto import VTEXDataResponse, VTEXItemsResponse, VTEXPaginatedItemsResponse
|
|
13
13
|
from .base import BaseAPI
|
|
14
14
|
|
|
15
15
|
|
|
@@ -119,6 +119,23 @@ class LogisticsAPI(BaseAPI):
|
|
|
119
119
|
response_class=VTEXDataResponse[Any],
|
|
120
120
|
)
|
|
121
121
|
|
|
122
|
+
def list_carrier_freight_values(
|
|
123
|
+
self,
|
|
124
|
+
carrier_id: str,
|
|
125
|
+
zip_code: str = "0",
|
|
126
|
+
**kwargs: Any,
|
|
127
|
+
) -> VTEXItemsResponse[Any, Any]:
|
|
128
|
+
return self._request(
|
|
129
|
+
method="GET",
|
|
130
|
+
environment=self.ENVIRONMENT,
|
|
131
|
+
endpoint=(
|
|
132
|
+
f"/api/logistics/pvt/configuration/freights/{carrier_id}/{zip_code}"
|
|
133
|
+
f"/values"
|
|
134
|
+
),
|
|
135
|
+
config=self.client.config.with_overrides(**kwargs),
|
|
136
|
+
response_class=VTEXItemsResponse[Any, Any],
|
|
137
|
+
)
|
|
138
|
+
|
|
122
139
|
def get_sku_inventories(
|
|
123
140
|
self,
|
|
124
141
|
sku_id: str,
|
|
@@ -11,7 +11,7 @@ from .._constants import (
|
|
|
11
11
|
from .._dto import VTEXDataResponse, VTEXItemsResponse, VTEXPaginatedItemsResponse
|
|
12
12
|
from .._sentinels import UNDEFINED, UndefinedSentinel
|
|
13
13
|
from .._types import OrderingDirectionType
|
|
14
|
-
from .._utils import now,
|
|
14
|
+
from .._utils import now, years_ago
|
|
15
15
|
from .base import BaseAPI
|
|
16
16
|
|
|
17
17
|
|
|
@@ -60,18 +60,20 @@ class OrdersAPI(BaseAPI):
|
|
|
60
60
|
|
|
61
61
|
if creation_date_from is not UNDEFINED or creation_date_to is not UNDEFINED:
|
|
62
62
|
if not isinstance(creation_date_from, datetime):
|
|
63
|
-
creation_date_from =
|
|
63
|
+
creation_date_from = years_ago(years=4)
|
|
64
64
|
|
|
65
65
|
if not isinstance(creation_date_to, datetime):
|
|
66
|
-
creation_date_to = now() + timedelta(
|
|
66
|
+
creation_date_to = now() + timedelta(minutes=1)
|
|
67
67
|
|
|
68
68
|
start = (
|
|
69
69
|
creation_date_from.astimezone(timezone.utc)
|
|
70
|
+
.replace(microsecond=0)
|
|
70
71
|
.isoformat(timespec="milliseconds")
|
|
71
72
|
.split("+")[0]
|
|
72
73
|
)
|
|
73
74
|
end = (
|
|
74
75
|
creation_date_to.astimezone(timezone.utc)
|
|
76
|
+
.replace(microsecond=999999)
|
|
75
77
|
.isoformat(timespec="milliseconds")
|
|
76
78
|
.split("+")[0]
|
|
77
79
|
)
|
|
@@ -15,6 +15,10 @@ TO_SNAKE_CASE_STEP_1_PATTERN = compile(r"(.)([A-Z][a-z]+)")
|
|
|
15
15
|
TO_SNAKE_CASE_STEP_2_PATTERN = compile(r"([a-z0-9])([A-Z])")
|
|
16
16
|
|
|
17
17
|
|
|
18
|
+
def str_to_bool(value: str) -> bool:
|
|
19
|
+
return bool(strtobool(value))
|
|
20
|
+
|
|
21
|
+
|
|
18
22
|
def omitting_undefined(obj: Dict[Any, Any]) -> Dict[Any, Any]:
|
|
19
23
|
return {key: value for key, value in obj.items() if value is not UNDEFINED}
|
|
20
24
|
|
|
@@ -23,11 +27,9 @@ def remove_null_bytes(value: str) -> str:
|
|
|
23
27
|
return value.replace("\x00", "")
|
|
24
28
|
|
|
25
29
|
|
|
26
|
-
def str_to_bool(value: str) -> bool:
|
|
27
|
-
return bool(strtobool(value))
|
|
28
|
-
|
|
29
|
-
|
|
30
30
|
def to_snake_case(string: str) -> str:
|
|
31
|
+
string = remove_null_bytes(string)
|
|
32
|
+
|
|
31
33
|
try:
|
|
32
34
|
UUID(string)
|
|
33
35
|
except (AttributeError, ValueError, TypeError):
|
|
@@ -45,7 +47,7 @@ def to_snake_case_deep(obj: Any) -> Any:
|
|
|
45
47
|
|
|
46
48
|
for key, value in sorted(obj.items(), key=lambda item: item[0]):
|
|
47
49
|
if isinstance(key, str):
|
|
48
|
-
key = to_snake_case(
|
|
50
|
+
key = to_snake_case(key)
|
|
49
51
|
|
|
50
52
|
while key in snake_cased_obj:
|
|
51
53
|
UTILS_LOGGER.debug(
|
|
@@ -97,11 +99,15 @@ def now(use_tz: bool = True, tz: Union[tzinfo, None] = None) -> datetime:
|
|
|
97
99
|
return datetime.now(to_tzinfo(tz) if use_tz else None)
|
|
98
100
|
|
|
99
101
|
|
|
100
|
-
def
|
|
102
|
+
def years_ago(
|
|
103
|
+
years: int,
|
|
104
|
+
use_tz: bool = True,
|
|
105
|
+
tz: Union[tzinfo, None] = None,
|
|
106
|
+
) -> datetime:
|
|
101
107
|
current_datetime = now(use_tz=use_tz, tz=tz)
|
|
102
108
|
|
|
103
109
|
return current_datetime.replace(
|
|
104
|
-
year=current_datetime.year -
|
|
110
|
+
year=current_datetime.year - years,
|
|
105
111
|
hour=0,
|
|
106
112
|
minute=0,
|
|
107
113
|
second=0,
|
|
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
|