libdev 0.75__tar.gz → 0.77__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.
- {libdev-0.75 → libdev-0.77}/PKG-INFO +4 -4
- {libdev-0.75 → libdev-0.77}/libdev/__init__.py +1 -1
- {libdev-0.75 → libdev-0.77}/libdev/s3.py +20 -17
- {libdev-0.75 → libdev-0.77}/libdev.egg-info/PKG-INFO +4 -4
- libdev-0.77/libdev.egg-info/requires.txt +4 -0
- {libdev-0.75 → libdev-0.77}/setup.py +3 -3
- libdev-0.75/libdev.egg-info/requires.txt +0 -4
- {libdev-0.75 → libdev-0.77}/LICENSE +0 -0
- {libdev-0.75 → libdev-0.77}/README.md +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/cfg.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/check.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/codes.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/dev.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/doc.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/fin.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/gen.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/img.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/lang.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/num.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev/time.py +0 -0
- {libdev-0.75 → libdev-0.77}/libdev.egg-info/SOURCES.txt +0 -0
- {libdev-0.75 → libdev-0.77}/libdev.egg-info/dependency_links.txt +0 -0
- {libdev-0.75 → libdev-0.77}/libdev.egg-info/top_level.txt +0 -0
- {libdev-0.75 → libdev-0.77}/setup.cfg +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_cfg.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_check.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_codes.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_dev.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_doc.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_gen.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_img.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_lang.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_num.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_s3.py +0 -0
- {libdev-0.75 → libdev-0.77}/tests/test_time.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: libdev
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.77
|
|
4
4
|
Summary: Set of standard functions for development
|
|
5
5
|
Home-page: https://github.com/kosyachniy/lib
|
|
6
6
|
Author: Alexey Poloz
|
|
@@ -19,9 +19,9 @@ Requires-Python: >=3.7, <4
|
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: requests
|
|
22
|
-
Requires-Dist: python-dotenv==1.0.
|
|
23
|
-
Requires-Dist: boto3==1.
|
|
24
|
-
Requires-Dist: Pillow==10.
|
|
22
|
+
Requires-Dist: python-dotenv==1.0.1
|
|
23
|
+
Requires-Dist: boto3==1.34.136
|
|
24
|
+
Requires-Dist: Pillow==10.3.0
|
|
25
25
|
|
|
26
26
|
# LibDev
|
|
27
27
|
Development library — Set of standard functions for development
|
|
@@ -15,22 +15,24 @@ from .cfg import cfg
|
|
|
15
15
|
from .gen import generate
|
|
16
16
|
|
|
17
17
|
|
|
18
|
-
s3 =
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
18
|
+
s3 = None
|
|
19
|
+
if cfg("s3.pass"):
|
|
20
|
+
s3 = boto3.client(
|
|
21
|
+
"s3",
|
|
22
|
+
endpoint_url=cfg("s3.host"),
|
|
23
|
+
aws_access_key_id=cfg("s3.user"),
|
|
24
|
+
aws_secret_access_key=cfg("s3.pass"),
|
|
25
|
+
region_name="us-east-1",
|
|
26
|
+
)
|
|
25
27
|
|
|
26
28
|
|
|
27
29
|
def upload_file(
|
|
28
30
|
file,
|
|
29
|
-
directory=cfg(
|
|
30
|
-
bucket=cfg(
|
|
31
|
+
directory=cfg("mode").lower(),
|
|
32
|
+
bucket=cfg("project_name"),
|
|
31
33
|
file_type=None,
|
|
32
34
|
):
|
|
33
|
-
"""
|
|
35
|
+
"""Upload file"""
|
|
34
36
|
|
|
35
37
|
name = f"{directory}/{generate()}"
|
|
36
38
|
|
|
@@ -42,8 +44,8 @@ def upload_file(
|
|
|
42
44
|
if not file_type:
|
|
43
45
|
file_type = os.path.splitext(parsed_url.path)[-1]
|
|
44
46
|
if not file_type:
|
|
45
|
-
content_type = response.headers.get(
|
|
46
|
-
file_type = guess_extension(content_type.split(
|
|
47
|
+
content_type = response.headers.get("Content-Type")
|
|
48
|
+
file_type = guess_extension(content_type.split(";")[0])
|
|
47
49
|
|
|
48
50
|
file = BytesIO(response.content)
|
|
49
51
|
handler = s3.upload_fileobj
|
|
@@ -74,13 +76,14 @@ def upload_file(
|
|
|
74
76
|
|
|
75
77
|
return f"{cfg('s3.host')}{bucket}/{name}"
|
|
76
78
|
|
|
79
|
+
|
|
77
80
|
def get_buckets():
|
|
78
|
-
"""
|
|
79
|
-
return [bucket[
|
|
81
|
+
"""Get list of buckets"""
|
|
82
|
+
return [bucket["Name"] for bucket in s3.list_buckets()["Buckets"]]
|
|
80
83
|
|
|
81
84
|
|
|
82
85
|
__all__ = (
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
"s3",
|
|
87
|
+
"upload_file",
|
|
88
|
+
"get_buckets",
|
|
86
89
|
)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: libdev
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.77
|
|
4
4
|
Summary: Set of standard functions for development
|
|
5
5
|
Home-page: https://github.com/kosyachniy/lib
|
|
6
6
|
Author: Alexey Poloz
|
|
@@ -19,9 +19,9 @@ Requires-Python: >=3.7, <4
|
|
|
19
19
|
Description-Content-Type: text/markdown
|
|
20
20
|
License-File: LICENSE
|
|
21
21
|
Requires-Dist: requests
|
|
22
|
-
Requires-Dist: python-dotenv==1.0.
|
|
23
|
-
Requires-Dist: boto3==1.
|
|
24
|
-
Requires-Dist: Pillow==10.
|
|
22
|
+
Requires-Dist: python-dotenv==1.0.1
|
|
23
|
+
Requires-Dist: boto3==1.34.136
|
|
24
|
+
Requires-Dist: Pillow==10.3.0
|
|
25
25
|
|
|
26
26
|
# LibDev
|
|
27
27
|
Development library — Set of standard functions for development
|
|
@@ -51,9 +51,9 @@ setup(
|
|
|
51
51
|
python_requires=">=3.7, <4",
|
|
52
52
|
install_requires=[
|
|
53
53
|
"requests", # Because of conflicts with main repo
|
|
54
|
-
"python-dotenv==1.0.
|
|
55
|
-
"boto3==1.
|
|
56
|
-
"Pillow==10.
|
|
54
|
+
"python-dotenv==1.0.1",
|
|
55
|
+
"boto3==1.34.136",
|
|
56
|
+
"Pillow==10.3.0",
|
|
57
57
|
],
|
|
58
58
|
project_urls={
|
|
59
59
|
"Source": "https://github.com/kosyachniy/lib",
|
|
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
|
|
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
|