python3-commons 0.5.5__py2.py3-none-any.whl → 0.5.7__py2.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.

Potentially problematic release.


This version of python3-commons might be problematic. Click here for more details.

python3_commons/audit.py CHANGED
@@ -18,7 +18,7 @@ from python3_commons.object_storage import get_s3_client
18
18
  logger = logging.getLogger(__name__)
19
19
 
20
20
 
21
- async def write_audit_data(settings: S3Settings, key: str, data: bytes):
21
+ def write_audit_data_sync(settings: S3Settings, key: str, data: bytes):
22
22
  if settings.s3_secret_access_key:
23
23
  try:
24
24
  client = get_s3_client(settings)
@@ -33,6 +33,10 @@ async def write_audit_data(settings: S3Settings, key: str, data: bytes):
33
33
  logger.debug(f'S3 is not configured, not storing object in storage: {key}')
34
34
 
35
35
 
36
+ async def write_audit_data(settings: S3Settings, key: str, data: bytes):
37
+ write_audit_data_sync(settings, key, data)
38
+
39
+
36
40
  async def archive_audit_data(root_path: str = 'audit'):
37
41
  now = datetime.now(tz=UTC) - timedelta(days=1)
38
42
  year = now.year
@@ -41,7 +45,7 @@ async def archive_audit_data(root_path: str = 'audit'):
41
45
  bucket_name = s3_settings.s3_bucket
42
46
  fo = BytesIO()
43
47
  object_names = []
44
- date_path = object_storage.get_absolute_path(f'{root_path}/{year}/{month:02}/{day:02}')
48
+ date_path = f'{root_path}/{year}/{month:02}/{day:02}'
45
49
 
46
50
  with tarfile.open(fileobj=fo, mode='w|bz2') as archive:
47
51
  if objects := object_storage.get_objects(bucket_name, date_path, recursive=True):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python3-commons
3
- Version: 0.5.5
3
+ Version: 0.5.7
4
4
  Summary: Re-usable Python3 code
5
5
  Home-page: https://github.com/kamikaze/python3-commons
6
6
  Author: Oleg Korsak
@@ -1,5 +1,5 @@
1
1
  python3_commons/__init__.py,sha256=h-KTJUaQ50E3RmkTn_GO88IRunmDTEpNc3ylpFvCTOc,339
2
- python3_commons/audit.py,sha256=QkXok1Kn-8E043K6fu7oVC5UNOJMkOHQXkjyssuXHnM,3684
2
+ python3_commons/audit.py,sha256=O9-Qf8TC1CJEDbWlTMdx-ap3UIoxbncpkEhSszrf_N4,3771
3
3
  python3_commons/conf.py,sha256=vSXyFwXx2wb1uy8IffeeI-RoTqhUZs0RLSSG2OLc2ss,598
4
4
  python3_commons/db.py,sha256=qhaDIdzBWgFyeP_XPKfHZlYVlwS2bpBPYMv84yV6820,738
5
5
  python3_commons/fs.py,sha256=wfLjybXndwLqNlOxTpm_HRJnuTcC4wbrHEOaEeCo9Wc,337
@@ -12,9 +12,9 @@ python3_commons/serializers/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMp
12
12
  python3_commons/serializers/json.py,sha256=P288wWz9ic38QWEMrpp_uwKPYkQiOgvE1cI4WZn6ZCg,808
13
13
  python3_commons/serializers/msgpack.py,sha256=P7CZoRTBeDtgALT5GTOZVCNM_3snOfCnfh5S3zcCIEY,1679
14
14
  python3_commons/serializers/msgspec.py,sha256=ZrfQWBz_67t3yjU_S6avnRJZzYN-HFzef2qGB5W21KI,2023
15
- python3_commons-0.5.5.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
16
- python3_commons-0.5.5.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
17
- python3_commons-0.5.5.dist-info/METADATA,sha256=TB4VMzseDmaNHZRTJpFPcaWThzI0QENb1ycV3XH94ko,974
18
- python3_commons-0.5.5.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
19
- python3_commons-0.5.5.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
20
- python3_commons-0.5.5.dist-info/RECORD,,
15
+ python3_commons-0.5.7.dist-info/AUTHORS.rst,sha256=3R9JnfjfjH5RoPWOeqKFJgxVShSSfzQPIrEr1nxIo9Q,90
16
+ python3_commons-0.5.7.dist-info/LICENSE,sha256=xxILuojHm4fKQOrMHPSslbyy6WuKAN2RiG74HbrYfzM,34575
17
+ python3_commons-0.5.7.dist-info/METADATA,sha256=II9MLcbrYmnS8RmEUZ8JDcyZa44K2Zrx5kYP1lS8onE,974
18
+ python3_commons-0.5.7.dist-info/WHEEL,sha256=DZajD4pwLWue70CAfc7YaxT1wLUciNBvN_TTcvXpltE,110
19
+ python3_commons-0.5.7.dist-info/top_level.txt,sha256=lJI6sCBf68eUHzupCnn2dzG10lH3jJKTWM_hrN1cQ7M,16
20
+ python3_commons-0.5.7.dist-info/RECORD,,