data-manipulation 0.43__tar.gz → 0.45__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.
Files changed (31) hide show
  1. {data_manipulation-0.43/data_manipulation.egg-info → data_manipulation-0.45}/PKG-INFO +2 -1
  2. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/_version.py +3 -3
  3. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/boto3_.py +41 -0
  4. {data_manipulation-0.43 → data_manipulation-0.45/data_manipulation.egg-info}/PKG-INFO +2 -1
  5. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation.egg-info/requires.txt +1 -0
  6. {data_manipulation-0.43 → data_manipulation-0.45}/setup.py +1 -0
  7. {data_manipulation-0.43 → data_manipulation-0.45}/LICENSE +0 -0
  8. {data_manipulation-0.43 → data_manipulation-0.45}/MANIFEST.in +0 -0
  9. {data_manipulation-0.43 → data_manipulation-0.45}/README.md +0 -0
  10. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/__init__.py +0 -0
  11. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/base.py +0 -0
  12. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/beautifulsoup_.py +0 -0
  13. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/cryptography_.py +0 -0
  14. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/django_.py +0 -0
  15. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/flask_.py +0 -0
  16. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/geopandas_.py +0 -0
  17. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/kerberos_.py +0 -0
  18. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/mysql_connector_python_.py +0 -0
  19. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/openldap_.py +0 -0
  20. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/pandas_.py +0 -0
  21. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/prometheus_.py +0 -0
  22. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/psycopg2_.py +0 -0
  23. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/psycopg_.py +0 -0
  24. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/pyspark_.py +0 -0
  25. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/smtplib_.py +0 -0
  26. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation/sqlalchemy_.py +0 -0
  27. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation.egg-info/SOURCES.txt +0 -0
  28. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation.egg-info/dependency_links.txt +0 -0
  29. {data_manipulation-0.43 → data_manipulation-0.45}/data_manipulation.egg-info/top_level.txt +0 -0
  30. {data_manipulation-0.43 → data_manipulation-0.45}/setup.cfg +0 -0
  31. {data_manipulation-0.43 → data_manipulation-0.45}/versioneer.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: data_manipulation
3
- Version: 0.43
3
+ Version: 0.45
4
4
  Summary: Powerful data manipulation
5
5
  Home-page: https://github.com/shawnngtq/data-manipulation
6
6
  Author: Shawn Ng
@@ -21,6 +21,7 @@ Classifier: Topic :: Scientific/Engineering
21
21
  License-File: LICENSE
22
22
  Requires-Dist: beautifulsoup4
23
23
  Requires-Dist: boto3
24
+ Requires-Dist: cryptography
24
25
  Requires-Dist: django
25
26
  Requires-Dist: flask
26
27
  Requires-Dist: geopandas
@@ -8,11 +8,11 @@ import json
8
8
 
9
9
  version_json = '''
10
10
  {
11
- "date": "2024-09-02T21:39:52+0800",
11
+ "date": "2024-09-08T09:24:53+0800",
12
12
  "dirty": false,
13
13
  "error": null,
14
- "full-revisionid": "f2d4c730c96dee3f05eb05b05a1b29a8f92d40a1",
15
- "version": "0.43"
14
+ "full-revisionid": "60bea1e3117837fae0b5506910b8006d348b5b81",
15
+ "version": "0.45"
16
16
  }
17
17
  ''' # END VERSION_JSON
18
18
 
@@ -83,6 +83,47 @@ def send_aws_ses_email(
83
83
  return
84
84
 
85
85
 
86
+ def list_s3_bucket_files(
87
+ bucket: str,
88
+ to_dateframe: bool = False,
89
+ ):
90
+ """
91
+ List s3 bucket files
92
+
93
+ Parameters
94
+ ----------
95
+ bucket : str
96
+ bucket name
97
+ to_dateframe : bool, optional
98
+ to convert to pandas dataframe, by default False
99
+
100
+ Returns
101
+ -------
102
+ list | pandas.DataFrame
103
+ default list, pandas.DataFrame if requested
104
+ """
105
+
106
+ import boto3
107
+
108
+ s3_client = boto3.client("s3")
109
+ paginator = s3_client.get_paginator("list_objects_v2")
110
+ keys = list()
111
+
112
+ for page in paginator.paginate(Bucket=bucket):
113
+ for obj in page["Contents"]:
114
+ if obj["Key"].endswith("/"):
115
+ continue
116
+ keys.append(obj["Key"])
117
+
118
+ if to_dateframe:
119
+ import pandas as pd
120
+
121
+ df = pd.DataFrame(keys, columns=["key"])
122
+ return df
123
+ else:
124
+ return keys
125
+
126
+
86
127
  if __name__ == "__main__":
87
128
  import doctest
88
129
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: data_manipulation
3
- Version: 0.43
3
+ Version: 0.45
4
4
  Summary: Powerful data manipulation
5
5
  Home-page: https://github.com/shawnngtq/data-manipulation
6
6
  Author: Shawn Ng
@@ -21,6 +21,7 @@ Classifier: Topic :: Scientific/Engineering
21
21
  License-File: LICENSE
22
22
  Requires-Dist: beautifulsoup4
23
23
  Requires-Dist: boto3
24
+ Requires-Dist: cryptography
24
25
  Requires-Dist: django
25
26
  Requires-Dist: flask
26
27
  Requires-Dist: geopandas
@@ -1,5 +1,6 @@
1
1
  beautifulsoup4
2
2
  boto3
3
+ cryptography
3
4
  django
4
5
  flask
5
6
  geopandas
@@ -24,6 +24,7 @@ CLASSIFIERS = [
24
24
  DEPENDENCIES = [
25
25
  "beautifulsoup4",
26
26
  "boto3",
27
+ "cryptography",
27
28
  "django",
28
29
  "flask",
29
30
  "geopandas",