tracktolib 0.66.3__tar.gz → 0.67.0__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.
- {tracktolib-0.66.3 → tracktolib-0.67.0}/PKG-INFO +1 -1
- {tracktolib-0.66.3 → tracktolib-0.67.0}/pyproject.toml +4 -2
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/s3/niquests.py +11 -2
- {tracktolib-0.66.3 → tracktolib-0.67.0}/README.md +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/__init__.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/api.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/http_utils.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/logs.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/notion/__init__.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/notion/fetch.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/notion/models.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/pg/__init__.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/pg/query.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/pg/utils.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/pg_sync.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/pg_utils.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/s3/__init__.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/s3/minio.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/s3/s3.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/tests.py +0 -0
- {tracktolib-0.66.3 → tracktolib-0.67.0}/tracktolib/utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "tracktolib"
|
|
3
|
-
version = "0.
|
|
3
|
+
version = "0.67.0"
|
|
4
4
|
authors = [
|
|
5
5
|
{ email = "julien.brayere@tracktor.fr" }
|
|
6
6
|
]
|
|
@@ -108,12 +108,14 @@ pythonPlatform = "Linux"
|
|
|
108
108
|
|
|
109
109
|
[tool.commitizen]
|
|
110
110
|
name = "cz_conventional_commits"
|
|
111
|
-
version = "0.
|
|
111
|
+
version = "0.67.0"
|
|
112
112
|
tag_format = "$version"
|
|
113
113
|
version_files = [
|
|
114
114
|
"pyproject.toml:version"
|
|
115
115
|
]
|
|
116
116
|
bump_message = "release $current_version → $new_version [skip ci]"
|
|
117
|
+
update_changelog_on_bump = true
|
|
118
|
+
changelog_file = "CHANGELOG.md"
|
|
117
119
|
|
|
118
120
|
|
|
119
121
|
[tool.ruff]
|
|
@@ -272,9 +272,12 @@ class S3Session:
|
|
|
272
272
|
key: str,
|
|
273
273
|
on_chunk: Callable[[bytes], None] | None = None,
|
|
274
274
|
chunk_size: int = 1024 * 1024,
|
|
275
|
+
on_start: OnDownloadStartFn | None = None,
|
|
275
276
|
) -> AsyncIterator[bytes]:
|
|
276
277
|
"""Download a file from S3 with streaming support."""
|
|
277
|
-
async for chunk in s3_download_file(
|
|
278
|
+
async for chunk in s3_download_file(
|
|
279
|
+
self._s3, self.http_client, bucket, key, chunk_size=chunk_size, on_start=on_start
|
|
280
|
+
):
|
|
278
281
|
if on_chunk:
|
|
279
282
|
on_chunk(chunk)
|
|
280
283
|
yield chunk
|
|
@@ -433,10 +436,10 @@ async def s3_put_object(
|
|
|
433
436
|
|
|
434
437
|
See: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html
|
|
435
438
|
"""
|
|
439
|
+
|
|
436
440
|
obj_params: S3ObjectParams = kwargs
|
|
437
441
|
presigned_params = build_s3_presigned_params(bucket, key, obj_params)
|
|
438
442
|
headers = build_s3_headers(obj_params)
|
|
439
|
-
|
|
440
443
|
url = s3.generate_presigned_url(
|
|
441
444
|
ClientMethod="put_object",
|
|
442
445
|
Params=presigned_params,
|
|
@@ -478,6 +481,9 @@ async def s3_get_object(
|
|
|
478
481
|
return resp.content
|
|
479
482
|
|
|
480
483
|
|
|
484
|
+
type OnDownloadStartFn = Callable[[niquests.AsyncResponse], None]
|
|
485
|
+
|
|
486
|
+
|
|
481
487
|
async def s3_download_file(
|
|
482
488
|
s3: botocore.client.BaseClient,
|
|
483
489
|
client: niquests.AsyncSession,
|
|
@@ -485,6 +491,7 @@ async def s3_download_file(
|
|
|
485
491
|
key: str,
|
|
486
492
|
*,
|
|
487
493
|
chunk_size: int = 1024 * 1024,
|
|
494
|
+
on_start: OnDownloadStartFn | None = None,
|
|
488
495
|
) -> AsyncIterator[bytes]:
|
|
489
496
|
"""Download an object from S3 with streaming support."""
|
|
490
497
|
url = s3.generate_presigned_url(
|
|
@@ -493,6 +500,8 @@ async def s3_download_file(
|
|
|
493
500
|
)
|
|
494
501
|
resp = await client.get(url, stream=True)
|
|
495
502
|
resp.raise_for_status()
|
|
503
|
+
if on_start:
|
|
504
|
+
on_start(resp)
|
|
496
505
|
async for chunk in await resp.iter_content(chunk_size):
|
|
497
506
|
yield chunk
|
|
498
507
|
|
|
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
|