pyaws-s3 1.0.7__py3-none-any.whl → 1.0.8__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.
- pyaws_s3/s3.py +33 -11
- {pyaws_s3-1.0.7.dist-info → pyaws_s3-1.0.8.dist-info}/METADATA +1 -1
- pyaws_s3-1.0.8.dist-info/RECORD +7 -0
- pyaws_s3-1.0.7.dist-info/RECORD +0 -7
- {pyaws_s3-1.0.7.dist-info → pyaws_s3-1.0.8.dist-info}/WHEEL +0 -0
- {pyaws_s3-1.0.7.dist-info → pyaws_s3-1.0.8.dist-info}/licenses/LICENSE.md +0 -0
- {pyaws_s3-1.0.7.dist-info → pyaws_s3-1.0.8.dist-info}/top_level.txt +0 -0
pyaws_s3/s3.py
CHANGED
@@ -190,11 +190,16 @@ class S3Client:
|
|
190
190
|
"""
|
191
191
|
try:
|
192
192
|
|
193
|
-
|
193
|
+
if args:
|
194
|
+
fig = args[0] if len(args) > 0 else None
|
195
|
+
object_name = args[1] if len(args) > 1 else None
|
196
|
+
else:
|
197
|
+
fig = kwargs.get("fig", None)
|
198
|
+
object_name = kwargs.get("object_name", None)
|
199
|
+
|
194
200
|
if fig is None:
|
195
201
|
raise Exception("Figure is None")
|
196
202
|
|
197
|
-
object_name = args[1] if len(args) > 1 else None
|
198
203
|
if object_name is None:
|
199
204
|
raise Exception("Object name is None")
|
200
205
|
|
@@ -254,11 +259,18 @@ class S3Client:
|
|
254
259
|
"""
|
255
260
|
try:
|
256
261
|
|
257
|
-
|
262
|
+
if args:
|
263
|
+
# Get the DataFrame and object name from the arguments
|
264
|
+
df = args[0] if len(args) > 0 else None
|
265
|
+
object_name = args[1] if len(args) > 1 else None
|
266
|
+
else:
|
267
|
+
# Get the DataFrame and object name from the keyword arguments
|
268
|
+
df = kwargs.get("df", None)
|
269
|
+
object_name = kwargs.get("object_name", None)
|
270
|
+
|
258
271
|
if df is None:
|
259
272
|
raise Exception("Figure is None")
|
260
273
|
|
261
|
-
object_name = args[1] if len(args) > 1 else None
|
262
274
|
if object_name is None:
|
263
275
|
raise Exception("Object name is None")
|
264
276
|
|
@@ -339,7 +351,7 @@ class S3Client:
|
|
339
351
|
logger.error(f"Error deleting files: {str(e)}")
|
340
352
|
raise Exception(f"Error deleting files: {str(e)}")
|
341
353
|
|
342
|
-
def upload_to_pdf(self, *args : Any) -> str:
|
354
|
+
def upload_to_pdf(self, *args : Any, **kwargs : Any) -> str:
|
343
355
|
"""
|
344
356
|
Export the given text as a PDF and upload it to the S3 bucket.
|
345
357
|
|
@@ -352,13 +364,18 @@ class S3Client:
|
|
352
364
|
str: Pre-signed URL for the uploaded PDF.
|
353
365
|
"""
|
354
366
|
try:
|
355
|
-
|
356
|
-
|
357
|
-
|
367
|
+
if args:
|
368
|
+
text = args[0] if len(args) > 0 else None
|
369
|
+
object_name = args[1] if len(args) > 1 else None
|
370
|
+
else:
|
371
|
+
text = kwargs.get("text", None)
|
372
|
+
object_name = kwargs.get("object_name", None)
|
358
373
|
|
359
|
-
|
374
|
+
if text is None:
|
375
|
+
raise Exception("Text is None")
|
376
|
+
|
360
377
|
if object_name is None:
|
361
|
-
|
378
|
+
raise Exception("Object name is None")
|
362
379
|
|
363
380
|
mimetypes = "application/pdf"
|
364
381
|
s3_client = self._get_s3_client()
|
@@ -401,7 +418,12 @@ class S3Client:
|
|
401
418
|
str: The local path of the downloaded file.
|
402
419
|
"""
|
403
420
|
try:
|
404
|
-
|
421
|
+
|
422
|
+
if args:
|
423
|
+
object_name = args[0] if len(args) > 0 else None
|
424
|
+
else:
|
425
|
+
object_name = kwargs.get("object_name", None)
|
426
|
+
|
405
427
|
if object_name is None:
|
406
428
|
raise Exception("Object name is None")
|
407
429
|
|
@@ -0,0 +1,7 @@
|
|
1
|
+
pyaws_s3/__init__.py,sha256=Tr7xJiCKOMWYydOJ4kxHlA7AR1X3pRsJ8MjxJev2wsw,24
|
2
|
+
pyaws_s3/s3.py,sha256=yC68TzOTeHP7cdDwyOriAhyLeQse5oUFbycS4sl_Iwo,18983
|
3
|
+
pyaws_s3-1.0.8.dist-info/licenses/LICENSE.md,sha256=7WXohDebeZpcVn_nH2aIaLhFZRvZBdcPSqWsO12lhwM,1074
|
4
|
+
pyaws_s3-1.0.8.dist-info/METADATA,sha256=JC1416mfukZieFRxrToJZ2DR6Fa5EOJXkqZ5rKA-Y00,5234
|
5
|
+
pyaws_s3-1.0.8.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
6
|
+
pyaws_s3-1.0.8.dist-info/top_level.txt,sha256=MxSSC4Q8Vr32wKgrUAlwT4BTXwqUaG_CAWoBuPeXYjQ,9
|
7
|
+
pyaws_s3-1.0.8.dist-info/RECORD,,
|
pyaws_s3-1.0.7.dist-info/RECORD
DELETED
@@ -1,7 +0,0 @@
|
|
1
|
-
pyaws_s3/__init__.py,sha256=Tr7xJiCKOMWYydOJ4kxHlA7AR1X3pRsJ8MjxJev2wsw,24
|
2
|
-
pyaws_s3/s3.py,sha256=j8lI1GSsdSWW-aJ_gMfZLUb4WE3j806r49pYvz2syUI,18188
|
3
|
-
pyaws_s3-1.0.7.dist-info/licenses/LICENSE.md,sha256=7WXohDebeZpcVn_nH2aIaLhFZRvZBdcPSqWsO12lhwM,1074
|
4
|
-
pyaws_s3-1.0.7.dist-info/METADATA,sha256=c8b1KQXK80s5rCfDsckV-cjpvsEvlnVMCLdQ-BqMCS0,5234
|
5
|
-
pyaws_s3-1.0.7.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
|
6
|
-
pyaws_s3-1.0.7.dist-info/top_level.txt,sha256=MxSSC4Q8Vr32wKgrUAlwT4BTXwqUaG_CAWoBuPeXYjQ,9
|
7
|
-
pyaws_s3-1.0.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|