pyaws-s3 1.0.7__tar.gz → 1.0.8__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaws_s3
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: A Python package for AWS S3 utilities
5
5
  Author-email: Giuseppe Zileni <giuseppe.zileni@gmail.com>
6
6
  Keywords: aws,s3,utilities
@@ -190,11 +190,16 @@ class S3Client:
190
190
  """
191
191
  try:
192
192
 
193
- fig = args[0] if len(args) > 0 else None
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
- df = args[0] if len(args) > 0 else None
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
- text = args[0] if len(args) > 0 else None
356
- if text is None:
357
- raise Exception("Text is None")
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
- object_name = args[1] if len(args) > 1 else None
374
+ if text is None:
375
+ raise Exception("Text is None")
376
+
360
377
  if object_name is None:
361
- raise Exception("Object name is None")
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
- object_name = args[0] if len(args) > 0 else None
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
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaws_s3
3
- Version: 1.0.7
3
+ Version: 1.0.8
4
4
  Summary: A Python package for AWS S3 utilities
5
5
  Author-email: Giuseppe Zileni <giuseppe.zileni@gmail.com>
6
6
  Keywords: aws,s3,utilities
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "pyaws_s3"
7
- version = "1.0.7"
7
+ version = "1.0.8"
8
8
  description = "A Python package for AWS S3 utilities"
9
9
  authors = [
10
10
  { name="Giuseppe Zileni", email="giuseppe.zileni@gmail.com" }
File without changes
File without changes
File without changes
File without changes