python3-commons 0.17.2__tar.gz → 0.17.4__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.
- {python3_commons-0.17.2/src/python3_commons.egg-info → python3_commons-0.17.4}/PKG-INFO +2 -2
- {python3_commons-0.17.2 → python3_commons-0.17.4}/pyproject.toml +1 -1
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/api_client.py +11 -11
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/cache.py +5 -5
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/conf.py +5 -6
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/db/helpers.py +1 -1
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/object_storage.py +10 -6
- {python3_commons-0.17.2 → python3_commons-0.17.4/src/python3_commons.egg-info}/PKG-INFO +2 -2
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons.egg-info/requires.txt +1 -1
- {python3_commons-0.17.2 → python3_commons-0.17.4}/uv.lock +9 -9
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.coveragerc +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.devcontainer/Dockerfile +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.devcontainer/devcontainer.json +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.devcontainer/docker-compose.yml +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.env_template +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.github/workflows/checks.yml +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.github/workflows/python-publish.yaml +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.github/workflows/release-on-tag-push.yml +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.gitignore +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.pre-commit-config.yaml +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/.python-version +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/AUTHORS.rst +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/CHANGELOG.rst +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/LICENSE +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/README.md +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/README.rst +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/docs/Makefile +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/docs/_static/.gitignore +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/docs/authors.rst +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/docs/changelog.rst +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/docs/conf.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/docs/index.rst +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/docs/license.rst +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/setup.cfg +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/async_functools.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/audit.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/auth.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/db/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/db/models/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/db/models/auth.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/db/models/common.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/db/models/rbac.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/db/models/users.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/exceptions.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/fs.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/generators.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/helpers.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/log/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/log/filters.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/log/formatters.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/permissions.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/common.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/json.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/msgpack.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/msgspec.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons.egg-info/SOURCES.txt +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons.egg-info/dependency_links.txt +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons.egg-info/top_level.txt +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/integration/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/integration/test_cache.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/integration/test_osc.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/conftest.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/log/__init__.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/log/test_formatters.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/test_async_functools.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/test_audit.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/test_helpers.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/test_msgpack.py +0 -0
- {python3_commons-0.17.2 → python3_commons-0.17.4}/tests/unit/test_msgspec.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-commons
|
|
3
|
-
Version: 0.17.
|
|
3
|
+
Version: 0.17.4
|
|
4
4
|
Summary: Re-usable Python3 code
|
|
5
5
|
Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0
|
|
@@ -37,7 +37,7 @@ Requires-Dist: asyncpg~=0.31.0; extra == "database"
|
|
|
37
37
|
Requires-Dist: SQLAlchemy[asyncio]~=2.0.49; extra == "database"
|
|
38
38
|
Provides-Extra: object-storage
|
|
39
39
|
Requires-Dist: aiobotocore~=3.5.0; extra == "object-storage"
|
|
40
|
-
Requires-Dist: object-storage-client==0.0.
|
|
40
|
+
Requires-Dist: object-storage-client==0.0.23; extra == "object-storage"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
|
|
43
43
|
Re-usable Python3 code
|
|
@@ -25,7 +25,7 @@ logger = logging.getLogger(__name__)
|
|
|
25
25
|
|
|
26
26
|
|
|
27
27
|
async def _store_response_for_audit(
|
|
28
|
-
|
|
28
|
+
response: ClientResponse, audit_name: str, uri_path: str, method: str, request_id: str
|
|
29
29
|
) -> None:
|
|
30
30
|
response_text = await response.text()
|
|
31
31
|
|
|
@@ -43,16 +43,16 @@ async def _store_response_for_audit(
|
|
|
43
43
|
|
|
44
44
|
@asynccontextmanager
|
|
45
45
|
async def request(
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
46
|
+
client: ClientSession,
|
|
47
|
+
base_url: str,
|
|
48
|
+
uri: str,
|
|
49
|
+
query: Mapping | None = None,
|
|
50
|
+
method: Literal['get', 'post', 'put', 'patch', 'options', 'head', 'delete'] = 'get',
|
|
51
|
+
headers: Mapping | None = None,
|
|
52
|
+
json: Mapping | Sequence | str | None = None,
|
|
53
|
+
data: bytes | None = None,
|
|
54
|
+
timeout: ClientTimeout | Enum | None = None,
|
|
55
|
+
audit_name: str | None = None,
|
|
56
56
|
) -> AsyncGenerator[ClientResponse]:
|
|
57
57
|
now = datetime.now(tz=UTC)
|
|
58
58
|
date_path = now.strftime('%Y/%m/%d')
|
|
@@ -81,11 +81,11 @@ def get_valkey_client() -> Valkey:
|
|
|
81
81
|
|
|
82
82
|
|
|
83
83
|
async def scan(
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
84
|
+
cursor: int = 0,
|
|
85
|
+
match: bytes | str | memoryview | None = None,
|
|
86
|
+
count: int | None = None,
|
|
87
|
+
_type: str | None = None,
|
|
88
|
+
**kwargs,
|
|
89
89
|
) -> ResponseT:
|
|
90
90
|
return await get_valkey_client().scan(cursor, match, count, _type, **kwargs)
|
|
91
91
|
|
|
@@ -58,11 +58,11 @@ class DBSettings(BaseSettings):
|
|
|
58
58
|
@model_validator(mode='after')
|
|
59
59
|
def build_dsn_if_missing(self) -> DBSettings:
|
|
60
60
|
if self.dsn is None and all(
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
(
|
|
62
|
+
self.user,
|
|
63
|
+
self.password,
|
|
64
|
+
self.name,
|
|
65
|
+
)
|
|
66
66
|
):
|
|
67
67
|
self.dsn = PostgresDsn.build(
|
|
68
68
|
scheme=self.scheme,
|
|
@@ -82,7 +82,6 @@ class S3Settings(BaseSettings):
|
|
|
82
82
|
aws_access_key_id: SecretStr | None = None
|
|
83
83
|
aws_secret_access_key: SecretStr | None = None
|
|
84
84
|
|
|
85
|
-
s3_endpoint_url: str | None = None
|
|
86
85
|
s3_addressing_style: Literal['path', 'virtual'] = 'virtual'
|
|
87
86
|
s3_secure: bool = True
|
|
88
87
|
s3_bucket: str | None = None
|
|
@@ -16,7 +16,7 @@ logger = logging.getLogger(__name__)
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
def get_query(
|
|
19
|
-
|
|
19
|
+
search: Mapping[str, str] | None = None, order_by: str | None = None, columns: Mapping | None = None
|
|
20
20
|
) -> tuple[ColumnElement[bool] | None, tuple[ColumnElement[bool]] | None]:
|
|
21
21
|
"""
|
|
22
22
|
:columns:
|
|
@@ -50,9 +50,6 @@ class ObjectStorage(metaclass=SingletonMeta):
|
|
|
50
50
|
'config': Config(s3={'addressing_style': settings.s3_addressing_style}, signature_version='s3v4'),
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
if s3_endpoint_url := settings.s3_endpoint_url:
|
|
54
|
-
config['endpoint_url'] = s3_endpoint_url
|
|
55
|
-
|
|
56
53
|
if aws_access_key_id := settings.aws_access_key_id:
|
|
57
54
|
config['aws_access_key_id'] = aws_access_key_id.get_secret_value()
|
|
58
55
|
|
|
@@ -113,10 +110,17 @@ async def get_object_stream(bucket_name: str, path: str) -> AsyncGenerator[Strea
|
|
|
113
110
|
|
|
114
111
|
|
|
115
112
|
async def get_object(bucket_name: str, path: str) -> bytes:
|
|
116
|
-
|
|
117
|
-
|
|
113
|
+
logger.debug('Getting object from object storage: %s:%s', bucket_name, path)
|
|
114
|
+
|
|
115
|
+
try:
|
|
116
|
+
client = get_client()
|
|
117
|
+
absolute_path = get_absolute_path(path)
|
|
118
|
+
url = f's3://{bucket_name}/{absolute_path}'
|
|
119
|
+
body = await client.get_object(url)
|
|
120
|
+
except Exception as e:
|
|
121
|
+
logger.exception('Failed getting object from object storage: %s:%s', bucket_name, path, exc_info=e)
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
raise
|
|
120
124
|
|
|
121
125
|
return body
|
|
122
126
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python3-commons
|
|
3
|
-
Version: 0.17.
|
|
3
|
+
Version: 0.17.4
|
|
4
4
|
Summary: Re-usable Python3 code
|
|
5
5
|
Author-email: Oleg Korsak <kamikaze.is.waiting.you@gmail.com>
|
|
6
6
|
License-Expression: GPL-3.0
|
|
@@ -37,7 +37,7 @@ Requires-Dist: asyncpg~=0.31.0; extra == "database"
|
|
|
37
37
|
Requires-Dist: SQLAlchemy[asyncio]~=2.0.49; extra == "database"
|
|
38
38
|
Provides-Extra: object-storage
|
|
39
39
|
Requires-Dist: aiobotocore~=3.5.0; extra == "object-storage"
|
|
40
|
-
Requires-Dist: object-storage-client==0.0.
|
|
40
|
+
Requires-Dist: object-storage-client==0.0.23; extra == "object-storage"
|
|
41
41
|
Dynamic: license-file
|
|
42
42
|
|
|
43
43
|
Re-usable Python3 code
|
|
@@ -668,22 +668,22 @@ wheels = [
|
|
|
668
668
|
|
|
669
669
|
[[package]]
|
|
670
670
|
name = "object-storage-client"
|
|
671
|
-
version = "0.0.
|
|
671
|
+
version = "0.0.23"
|
|
672
672
|
source = { registry = "https://pypi.org/simple" }
|
|
673
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
673
|
+
sdist = { url = "https://files.pythonhosted.org/packages/8d/05/2789ff2531d2f8e5be4643505dc8052f4d72cd15f635bdee160c464a6cce/object_storage_client-0.0.23.tar.gz", hash = "sha256:991ba770604c96ffdd992939a2fe2438a0250dc1cd17e3ddf3a6def436985507", size = 41641, upload-time = "2026-04-26T18:50:40.694Z" }
|
|
674
674
|
wheels = [
|
|
675
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
676
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
677
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
675
|
+
{ url = "https://files.pythonhosted.org/packages/ea/26/f2a6f1d83b580d1b3fddc2aa40b3a295f4fcd34e78ef860f7d9485c8eccc/object_storage_client-0.0.23-cp314-cp314-macosx_11_0_arm64.whl", hash = "sha256:ef7d3736c26dcfebe5b468cd662dc19bd6f724e82dfb61b0f568d66f1fdf7a05", size = 1945209, upload-time = "2026-04-26T18:50:39.519Z" },
|
|
676
|
+
{ url = "https://files.pythonhosted.org/packages/c9/19/a41fba90759ae91dab35f98665d1895aeb193f42d2fe899977d428bb4820/object_storage_client-0.0.23-cp314-cp314-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0f3a6535a564e0ab97636d810bfc5ad49c10048a1f0ad241b09c91a4fc916bbf", size = 2137323, upload-time = "2026-04-26T18:50:45.91Z" },
|
|
677
|
+
{ url = "https://files.pythonhosted.org/packages/a8/20/2b309e05ad849cfc2e757c3b62030211904e82b32cb07d48648d941c72c1/object_storage_client-0.0.23-cp314-cp314-win_amd64.whl", hash = "sha256:b71e1fe22f2fc900a08b8b4a356cab4b927eaf84b483b5330f7c96157c4dd9ae", size = 2126848, upload-time = "2026-04-26T18:50:41.661Z" },
|
|
678
678
|
]
|
|
679
679
|
|
|
680
680
|
[[package]]
|
|
681
681
|
name = "packaging"
|
|
682
|
-
version = "26.
|
|
682
|
+
version = "26.2"
|
|
683
683
|
source = { registry = "https://pypi.org/simple" }
|
|
684
|
-
sdist = { url = "https://files.pythonhosted.org/packages/
|
|
684
|
+
sdist = { url = "https://files.pythonhosted.org/packages/d7/f1/e7a6dd94a8d4a5626c03e4e99c87f241ba9e350cd9e6d75123f992427270/packaging-26.2.tar.gz", hash = "sha256:ff452ff5a3e828ce110190feff1178bb1f2ea2281fa2075aadb987c2fb221661", size = 228134, upload-time = "2026-04-24T20:15:23.917Z" }
|
|
685
685
|
wheels = [
|
|
686
|
-
{ url = "https://files.pythonhosted.org/packages/
|
|
686
|
+
{ url = "https://files.pythonhosted.org/packages/df/b2/87e62e8c3e2f4b32e5fe99e0b86d576da1312593b39f47d8ceef365e95ed/packaging-26.2-py3-none-any.whl", hash = "sha256:5fc45236b9446107ff2415ce77c807cee2862cb6fac22b8a73826d0693b0980e", size = 100195, upload-time = "2026-04-24T20:15:22.081Z" },
|
|
687
687
|
]
|
|
688
688
|
|
|
689
689
|
[[package]]
|
|
@@ -1067,7 +1067,7 @@ requires-dist = [
|
|
|
1067
1067
|
{ name = "lxml", marker = "extra == 'audit'", specifier = "~=6.1.0" },
|
|
1068
1068
|
{ name = "msgpack", specifier = "~=1.1.2" },
|
|
1069
1069
|
{ name = "msgspec", specifier = "==0.21.1" },
|
|
1070
|
-
{ name = "object-storage-client", marker = "extra == 'object-storage'", specifier = "==0.0.
|
|
1070
|
+
{ name = "object-storage-client", marker = "extra == 'object-storage'", specifier = "==0.0.23" },
|
|
1071
1071
|
{ name = "pydantic-settings", specifier = "~=2.14.0" },
|
|
1072
1072
|
{ name = "python3-commons", extras = ["api-client", "audit", "authn", "authz", "cache", "database", "object-storage"], marker = "extra == 'all'" },
|
|
1073
1073
|
{ name = "python3-commons", extras = ["database"], marker = "extra == 'authz'" },
|
|
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
|
|
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
|
{python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/msgpack.py
RENAMED
|
File without changes
|
{python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons/serializers/msgspec.py
RENAMED
|
File without changes
|
|
File without changes
|
{python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons.egg-info/dependency_links.txt
RENAMED
|
File without changes
|
{python3_commons-0.17.2 → python3_commons-0.17.4}/src/python3_commons.egg-info/top_level.txt
RENAMED
|
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
|