pyaws-s3 1.0.12__py3-none-any.whl → 1.0.16__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 CHANGED
@@ -470,7 +470,7 @@ class S3Client:
470
470
  logger.error(f"Error downloading file: {str(e)}")
471
471
  raise Exception(f"Error downloading file: {str(e)}")
472
472
 
473
- def list_files(self, *args : Any) -> list[str]:
473
+ def list_files(self, *args: Any, **kwargs : Any) -> list[str]:
474
474
  """
475
475
  List all files in the S3 bucket.
476
476
 
@@ -482,9 +482,17 @@ class S3Client:
482
482
  list[str]: List of file names in the S3 bucket.
483
483
  """
484
484
  try:
485
- filter = args[0] if len(args) > 0 else None
485
+ prefix = args[0] if args else None
486
+ if prefix is None:
487
+ prefix = kwargs.get("prefix", None)
488
+
489
+ if prefix is None:
490
+ raise Exception("Prefix is None")
491
+
492
+ filter = kwargs.get("filter", None)
493
+
486
494
  s3_client = self._get_s3_client()
487
- objects = s3_client.list_objects_v2(Bucket=self.bucket_name)
495
+ objects = s3_client.list_objects_v2(Bucket=self.bucket_name, Prefix=prefix)
488
496
 
489
497
  # Check if the bucket contains any objects
490
498
  if 'Contents' in objects:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: pyaws_s3
3
- Version: 1.0.12
3
+ Version: 1.0.16
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
@@ -33,8 +33,7 @@ Requires-Dist: kiwisolver==1.4.8
33
33
  Requires-Dist: matplotlib==3.10.3
34
34
  Requires-Dist: multidict==6.4.3
35
35
  Requires-Dist: narwhals==1.39.1
36
- Requires-Dist: numpy==2.2.5
37
- Requires-Dist: packaging==23.2
36
+ Requires-Dist: packaging>=23.2
38
37
  Requires-Dist: pandas==2.2.3
39
38
  Requires-Dist: pillow==11.2.1
40
39
  Requires-Dist: plotly==6.1.0
@@ -0,0 +1,7 @@
1
+ pyaws_s3/__init__.py,sha256=Tr7xJiCKOMWYydOJ4kxHlA7AR1X3pRsJ8MjxJev2wsw,24
2
+ pyaws_s3/s3.py,sha256=0suRKzfPyWSlQk1IWzbCruyyHTKV5mW9jZ7RBtwGCCA,20008
3
+ pyaws_s3-1.0.16.dist-info/licenses/LICENSE.md,sha256=7WXohDebeZpcVn_nH2aIaLhFZRvZBdcPSqWsO12lhwM,1074
4
+ pyaws_s3-1.0.16.dist-info/METADATA,sha256=KvwlP3WqEe96Mvcq-cvsRFI06yHAxTjhSJYEr0brg-I,5465
5
+ pyaws_s3-1.0.16.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
6
+ pyaws_s3-1.0.16.dist-info/top_level.txt,sha256=MxSSC4Q8Vr32wKgrUAlwT4BTXwqUaG_CAWoBuPeXYjQ,9
7
+ pyaws_s3-1.0.16.dist-info/RECORD,,
@@ -1,7 +0,0 @@
1
- pyaws_s3/__init__.py,sha256=Tr7xJiCKOMWYydOJ4kxHlA7AR1X3pRsJ8MjxJev2wsw,24
2
- pyaws_s3/s3.py,sha256=ZkYeD96LeoovDHR49G9LE1jhCssAN_bObmG9n85euWI,19723
3
- pyaws_s3-1.0.12.dist-info/licenses/LICENSE.md,sha256=7WXohDebeZpcVn_nH2aIaLhFZRvZBdcPSqWsO12lhwM,1074
4
- pyaws_s3-1.0.12.dist-info/METADATA,sha256=p-RlVIVY4nqB0b6eS6AXPIgmsyvMBRlAPZewHOaV2C4,5493
5
- pyaws_s3-1.0.12.dist-info/WHEEL,sha256=Nw36Djuh_5VDukK0H78QzOX-_FQEo6V37m3nkm96gtU,91
6
- pyaws_s3-1.0.12.dist-info/top_level.txt,sha256=MxSSC4Q8Vr32wKgrUAlwT4BTXwqUaG_CAWoBuPeXYjQ,9
7
- pyaws_s3-1.0.12.dist-info/RECORD,,