python-amcards 1.3.4__py3-none-any.whl → 1.3.5__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.
- amcards/__helpers.py +9 -9
- {python_amcards-1.3.4.dist-info → python_amcards-1.3.5.dist-info}/METADATA +1 -1
- python_amcards-1.3.5.dist-info/RECORD +10 -0
- python_amcards-1.3.4.dist-info/RECORD +0 -10
- {python_amcards-1.3.4.dist-info → python_amcards-1.3.5.dist-info}/LICENSE +0 -0
- {python_amcards-1.3.4.dist-info → python_amcards-1.3.5.dist-info}/WHEEL +0 -0
- {python_amcards-1.3.4.dist-info → python_amcards-1.3.5.dist-info}/top_level.txt +0 -0
amcards/__helpers.py
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import time
|
|
2
2
|
from typing import Optional
|
|
3
|
-
|
|
3
|
+
import datetime
|
|
4
4
|
|
|
5
5
|
REQUIRED_SHIPPING_ADDRESS_FIELDS = {
|
|
6
6
|
'first_name',
|
|
@@ -42,28 +42,28 @@ def current_timestamp() -> int:
|
|
|
42
42
|
return int(time.time() * 1000)
|
|
43
43
|
|
|
44
44
|
def today() -> str:
|
|
45
|
-
today = datetime.today()
|
|
45
|
+
today = datetime.datetime.today()
|
|
46
46
|
yyyy = today.year
|
|
47
47
|
mm, dd = map(lambda x: str(x).zfill(2), (today.month, today.day))
|
|
48
48
|
return f'{yyyy}-{mm}-{dd}'
|
|
49
49
|
|
|
50
|
-
def to_datetime(datetime_str: Optional[str]) -> Optional[datetime]:
|
|
50
|
+
def to_datetime(datetime_str: Optional[str]) -> Optional[datetime.datetime]:
|
|
51
51
|
if datetime_str is None:
|
|
52
52
|
return None
|
|
53
53
|
|
|
54
54
|
if 'T' in datetime_str:
|
|
55
55
|
if '.' in datetime_str:
|
|
56
|
-
return datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M:%S.%f')
|
|
57
|
-
return datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M:%S')
|
|
56
|
+
return datetime.datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M:%S.%f')
|
|
57
|
+
return datetime.datetime.strptime(datetime_str, '%Y-%m-%dT%H:%M:%S')
|
|
58
58
|
|
|
59
59
|
if ' ' in datetime_str:
|
|
60
60
|
if '.' in datetime_str:
|
|
61
|
-
return datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S.%f')
|
|
62
|
-
return datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S')
|
|
61
|
+
return datetime.datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S.%f')
|
|
62
|
+
return datetime.datetime.strptime(datetime_str, '%Y-%m-%d %H:%M:%S')
|
|
63
63
|
|
|
64
64
|
if '.' in datetime_str:
|
|
65
|
-
return datetime.strptime(datetime_str, '%Y-%m-%d%H:%M:%S.%f')
|
|
66
|
-
return datetime.strptime(datetime_str, '%Y-%m-%d%H:%M:%S')
|
|
65
|
+
return datetime.datetime.strptime(datetime_str, '%Y-%m-%d%H:%M:%S.%f')
|
|
66
|
+
return datetime.datetime.strptime(datetime_str, '%Y-%m-%d%H:%M:%S')
|
|
67
67
|
|
|
68
68
|
def format_cents(price_in_cents: int) -> str:
|
|
69
69
|
whole, fractional = map(str, divmod(price_in_cents, 100))
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
amcards/__helpers.py,sha256=CQXc1e95mGZvsHgvtKBP-CAnNhF3ITzPonQrGvC-x4U,5745
|
|
2
|
+
amcards/__init__.py,sha256=nl-oq4BKdYSQZPNbtraEMHFf_8MU8gSOlJZIYxKudcM,34
|
|
3
|
+
amcards/amcards.py,sha256=NPNbscI4MawIWW0ZlfDCB7xtiwqSfUi1R-WF98pSEwk,63028
|
|
4
|
+
amcards/exceptions.py,sha256=wPu5lipT4oTJ2h-NY82jO_AjG68flmbFpcA-0xy0t_w,1978
|
|
5
|
+
amcards/models.py,sha256=ZuO5268HrIdYjhnzrDk1B0tDeMuQ2GekKkonOqttwEI,30973
|
|
6
|
+
python_amcards-1.3.5.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
7
|
+
python_amcards-1.3.5.dist-info/METADATA,sha256=jvZC9ACJgMV1cl6q5tb8erJXY26o1Xq0J8OfcPN5SjY,3076
|
|
8
|
+
python_amcards-1.3.5.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
9
|
+
python_amcards-1.3.5.dist-info/top_level.txt,sha256=xst-AU0pzvWXz3DQR-QICIruzgcf4Bkt6FF_GldcIck,8
|
|
10
|
+
python_amcards-1.3.5.dist-info/RECORD,,
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
amcards/__helpers.py,sha256=ECj3f2eg6jj5MolS9uY01do9-y4PImu9sfsXwqSUIHU,5687
|
|
2
|
-
amcards/__init__.py,sha256=nl-oq4BKdYSQZPNbtraEMHFf_8MU8gSOlJZIYxKudcM,34
|
|
3
|
-
amcards/amcards.py,sha256=NPNbscI4MawIWW0ZlfDCB7xtiwqSfUi1R-WF98pSEwk,63028
|
|
4
|
-
amcards/exceptions.py,sha256=wPu5lipT4oTJ2h-NY82jO_AjG68flmbFpcA-0xy0t_w,1978
|
|
5
|
-
amcards/models.py,sha256=ZuO5268HrIdYjhnzrDk1B0tDeMuQ2GekKkonOqttwEI,30973
|
|
6
|
-
python_amcards-1.3.4.dist-info/LICENSE,sha256=xx0jnfkXJvxRnG63LTGOxlggYnIysveWIZ6H3PNdCrQ,11357
|
|
7
|
-
python_amcards-1.3.4.dist-info/METADATA,sha256=qbNK62qLsJmrta99oK3cPAeZZAAQtL2WiH78-8pMgdA,3076
|
|
8
|
-
python_amcards-1.3.4.dist-info/WHEEL,sha256=HiCZjzuy6Dw0hdX5R3LCFPDmFS4BWl8H-8W39XfmgX4,91
|
|
9
|
-
python_amcards-1.3.4.dist-info/top_level.txt,sha256=xst-AU0pzvWXz3DQR-QICIruzgcf4Bkt6FF_GldcIck,8
|
|
10
|
-
python_amcards-1.3.4.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|