atk-common 1.19.0__py3-none-any.whl → 1.21.0__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.
atk_common/__init__.py CHANGED
@@ -1,5 +1,5 @@
1
1
  # __init__.py
2
- from atk_common.datetime_utils import date_time_utc, get_utc_date_time
2
+ from atk_common.datetime_utils import date_time_utc_column, get_utc_date_time, seconds_to_utc_timestamp, get_utc_date_from_iso
3
3
  from atk_common.env_utils import get_env_value
4
4
  from atk_common.error_utils import get_message, create_error_log, get_error_entity, handle_error, get_response_error, get_error_type
5
5
  from atk_common.http_utils import is_http_status_ok, is_http_status_internal, get_test_response
@@ -9,8 +9,10 @@ from atk_common.response_utils import create_response, is_response_ok
9
9
  from atk_common.docker_utils import get_current_container_info
10
10
 
11
11
  __all__ = [
12
- 'date_time_utc',
12
+ 'date_time_utc_column',
13
13
  'get_utc_date_time',
14
+ 'seconds_to_utc_timestamp',
15
+ 'get_utc_date_from_iso',
14
16
  'get_env_value',
15
17
  'get_message',
16
18
  'create_error_log',
@@ -1,7 +1,15 @@
1
1
  from datetime import datetime, timezone
2
2
 
3
- def date_time_utc(column):
3
+ def date_time_utc_column(column):
4
4
  return 'TO_CHAR({0} at time zone \'UTC\', \'yyyy-mm-dd hh24:mi:ss.ms"Z"\')'.format(column)
5
5
 
6
6
  def get_utc_date_time():
7
7
  return str(datetime.now(timezone.utc))
8
+
9
+ def seconds_to_utc_timestamp(seconds):
10
+ return str(datetime.fromtimestamp(seconds, tz=timezone.utc))
11
+
12
+ def get_utc_date_from_iso(date_time):
13
+ dt = datetime.fromisoformat(date_time)
14
+ dt_utc = dt.astimezone(timezone.utc)
15
+ return str(dt_utc.date())
@@ -1,12 +1,28 @@
1
1
  # __init__.py
2
- from atk_common.enums.command_status_enum import CommandStatusType
3
- from atk_common.enums.speed_control_status_enum import SpeedControlStatusType
4
2
  from atk_common.enums.api_error_type_enum import ApiErrorType
3
+ from atk_common.enums.command_status_enum import CommandStatusType
4
+ from atk_common.enums.encryption_type_enum import EncryptionType
5
+ from atk_common.enums.image_encoding_type_enum import ImageEncodingType
6
+ from atk_common.enums.image_part_category import ImagePartCategory
7
+ from atk_common.enums.image_part_type import ImagePartType
8
+ from atk_common.enums.process_status_enum import ProcessStatus
5
9
  from atk_common.enums.response_status_enum import ResponseStatus
10
+ from atk_common.enums.section_role_enum import SectionRole
11
+ from atk_common.enums.sensor_type_enum import SensorType
12
+ from atk_common.enums.speed_control_status_enum import SpeedControlStatusType
13
+ from atk_common.enums.violation_type_enum import ViolationType
6
14
 
7
15
  __all__ = [
8
- 'CommandStatusType',
9
- 'SpeedControlStatusType',
10
16
  'ApiErrorType',
17
+ 'CommandStatusType',
18
+ 'EncryptionType',
19
+ 'ImageEncodingType',
20
+ 'ImagePartCategory',
21
+ 'ImagePartType',
22
+ 'ProcessStatus',
11
23
  'ResponseStatus',
24
+ 'SectionRole',
25
+ 'SensorType',
26
+ 'SpeedControlStatusType',
27
+ 'ViolationType',
12
28
  ]
@@ -0,0 +1,5 @@
1
+ from enum import Enum
2
+
3
+ class EncryptionType(Enum):
4
+ NONE = 1
5
+ X25519AESGCM = 2
@@ -0,0 +1,6 @@
1
+ from enum import Enum
2
+
3
+ class ImageEncodingType(Enum):
4
+ RAW = 1
5
+ JPEG = 2
6
+ JXL = 3
@@ -0,0 +1,5 @@
1
+ from enum import Enum
2
+
3
+ class ImagePartCategory(Enum):
4
+ PART = 1
5
+ HATCH = 2
@@ -0,0 +1,6 @@
1
+ from enum import Enum
2
+
3
+ class ImagePartType(Enum):
4
+ LICENSEPLATE = 1
5
+ DRIVER = 2
6
+ PHOTOZONE = 3
@@ -0,0 +1,8 @@
1
+ from enum import Enum
2
+
3
+ class ProcessStatus(Enum):
4
+ NEW = 1
5
+ STARTED = 2
6
+ FINALIZED = 3
7
+ LOCKED = 4
8
+ NOTAPPROVED = 5
@@ -0,0 +1,5 @@
1
+ from enum import Enum
2
+
3
+ class SectionRole(Enum):
4
+ A = 1
5
+ B = 2
@@ -0,0 +1,5 @@
1
+ from enum import Enum
2
+
3
+ class SensorType(Enum):
4
+ PIEZO = 1
5
+ LOOP = 2
@@ -0,0 +1,5 @@
1
+ from enum import Enum
2
+
3
+ class ViolationType(Enum):
4
+ POINT = 1
5
+ SECTION = 2
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: atk_common
3
- Version: 1.19.0
3
+ Version: 1.21.0
4
4
  Summary: ATK common methods
5
5
  Home-page: https://github.com/pypa/atk_common
6
6
  Author: Roger
@@ -1,5 +1,5 @@
1
- atk_common/__init__.py,sha256=nG-PFquhz5ycFh1zY1zLqAFPOCbalD80_YmLcJ4vqr0,1093
2
- atk_common/datetime_utils.py,sha256=qsVF7l90P1-xukG2tV_jLqG9J_Yfl5wTpyfrdPBlyMo,239
1
+ atk_common/__init__.py,sha256=rEx7ncUlputDjFHrtdEqPPVz1QIE9RhsDWWZWBe2GY0,1219
2
+ atk_common/datetime_utils.py,sha256=bkWmLnXfSlr5IIlovdF3UEhAxFJEeskqKrav9uIpek8,512
3
3
  atk_common/db_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
4
4
  atk_common/docker_utils.py,sha256=nkUhp2OhwJsm41JDujHDY-JxQfdDjy91duprH59Esfk,2084
5
5
  atk_common/env_utils.py,sha256=66v-S0vlkJNaun6ay1XcOGRtYJb4Ce4odJsWxuaHsQc,373
@@ -9,13 +9,21 @@ atk_common/log_utils.py,sha256=k7VaknmSGvHQV6-eznltNUa3BOAywjFHkhVzDT1P0Hs,496
9
9
  atk_common/mq_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
10
10
  atk_common/rabbitmq_consumer.py,sha256=4MhuwZs47Jt1fX4sUxr1MKRe7o2QRbPe9_utXEsa8QE,1907
11
11
  atk_common/response_utils.py,sha256=jlCm3a7GKolV6zR1emIEGmMH93V6yktiv-lgNa3TNEw,349
12
- atk_common/enums/__init__.py,sha256=7iDZeOEAHGiU0KirokbOYDv3n1dSnL5lnRksD8HNyGg,410
12
+ atk_common/enums/__init__.py,sha256=aeL5BH72S7BDSLULlu6KxoplHCTZqPQQWKLvRq8r1YE,1103
13
13
  atk_common/enums/api_error_type_enum.py,sha256=9oW6ZaZ3lhMwR8r2sVNWGliS9C_jV-otiOYdezAuTp0,91
14
14
  atk_common/enums/command_status_enum.py,sha256=M2Nln27a_DbzI07-gfytWQk2X087JhkU6Fmard5qVHs,127
15
+ atk_common/enums/encryption_type_enum.py,sha256=jlrKeH2-Iakkuby8pwq8uXhX8A2FTvdULe633edGOc4,91
15
16
  atk_common/enums/http_status_enum.py,sha256=bJSTmkLxHnb04fWSDKuhTWrh_v9iCQM7otAVr731JDk,139
17
+ atk_common/enums/image_encoding_type_enum.py,sha256=s32PjcrprGUf7MG4UQNE3ssH-y9RiLtbwtNwKQxWMvE,98
18
+ atk_common/enums/image_part_category.py,sha256=YQ7xtO8v7Ja77Tu-Wo_wewLOULtalPtDsmHvEEWsnsw,87
19
+ atk_common/enums/image_part_type.py,sha256=tg6W9kYMRShOlsxhAJRNRdWH50gC-eF0sqvqsponP-M,111
20
+ atk_common/enums/process_status_enum.py,sha256=09kRE5Cy8Sc7e7wf5gSkIw0RnNzFAWxIrMvn-aElqt8,140
16
21
  atk_common/enums/response_status_enum.py,sha256=ogYXlGm0gJJDGlY6Fwq9Kvl861aGPop2qzfXXExzMKw,99
22
+ atk_common/enums/section_role_enum.py,sha256=9rwep4Wmvyvnlrey08TRRoi8VQYAPkylpP00uafIQMg,74
23
+ atk_common/enums/sensor_type_enum.py,sha256=UBa3LPyGTKgEJV578CqFlwXjnlXqVlybrvzdjsHhjSU,80
17
24
  atk_common/enums/speed_control_status_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe4hUn1illIkbo7k4mLfzIM,182
18
- atk_common-1.19.0.dist-info/licenses/license.txt,sha256=_0O6fWM00-wTurDjnZhUP_N5QiwGhItaQZqHq5eqadA,1063
25
+ atk_common/enums/violation_type_enum.py,sha256=01qTHOj-O8bOc-nwIHVnxLosm4cusD_YuqXM3ZsiRRk,86
26
+ atk_common-1.21.0.dist-info/licenses/license.txt,sha256=_0O6fWM00-wTurDjnZhUP_N5QiwGhItaQZqHq5eqadA,1063
19
27
  atk_package/__init__.py,sha256=EceDa352WFHTdC_LxYANXf_TS9pGzK3MCx87bwAKTvg,811
20
28
  atk_package/datetime_utils.py,sha256=qsVF7l90P1-xukG2tV_jLqG9J_Yfl5wTpyfrdPBlyMo,239
21
29
  atk_package/env_utils.py,sha256=bXOrxM3fZUslqfmZt75iphbEJHbG4riJa8XOVzPwIII,313
@@ -28,7 +36,7 @@ atk_package/enums/__init__.py,sha256=oW0aVnwewfH6sNu14jjZ5_uP4iRN4pRmGdTNC204rHo
28
36
  atk_package/enums/command_status_enum.py,sha256=M2Nln27a_DbzI07-gfytWQk2X087JhkU6Fmard5qVHs,127
29
37
  atk_package/enums/speed_control_status_enum.py,sha256=qpURh0K1L1tSpbrzVnckoe4hUn1illIkbo7k4mLfzIM,182
30
38
  shared_python_atk_enforcement/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
- atk_common-1.19.0.dist-info/METADATA,sha256=ROsazY251vJOFE4yUPZdvHrnGb-AFAw35hCYc8EQbkM,1464
32
- atk_common-1.19.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
33
- atk_common-1.19.0.dist-info/top_level.txt,sha256=4CwRjkLnheIdI4jQwc4tK3dbRc58WqUmoqjkdDTWlME,41
34
- atk_common-1.19.0.dist-info/RECORD,,
39
+ atk_common-1.21.0.dist-info/METADATA,sha256=FapJW4X2OPpdY8ubc09y6yzBV_EwBSDMDhtHiAJkkfk,1464
40
+ atk_common-1.21.0.dist-info/WHEEL,sha256=pxyMxgL8-pra_rKaQ4drOZAegBVuX-G_4nRHjjgWbmo,91
41
+ atk_common-1.21.0.dist-info/top_level.txt,sha256=4CwRjkLnheIdI4jQwc4tK3dbRc58WqUmoqjkdDTWlME,41
42
+ atk_common-1.21.0.dist-info/RECORD,,