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.
Files changed (35) hide show
  1. {libdev-0.75 → libdev-0.77}/PKG-INFO +4 -4
  2. {libdev-0.75 → libdev-0.77}/libdev/__init__.py +1 -1
  3. {libdev-0.75 → libdev-0.77}/libdev/s3.py +20 -17
  4. {libdev-0.75 → libdev-0.77}/libdev.egg-info/PKG-INFO +4 -4
  5. libdev-0.77/libdev.egg-info/requires.txt +4 -0
  6. {libdev-0.75 → libdev-0.77}/setup.py +3 -3
  7. libdev-0.75/libdev.egg-info/requires.txt +0 -4
  8. {libdev-0.75 → libdev-0.77}/LICENSE +0 -0
  9. {libdev-0.75 → libdev-0.77}/README.md +0 -0
  10. {libdev-0.75 → libdev-0.77}/libdev/cfg.py +0 -0
  11. {libdev-0.75 → libdev-0.77}/libdev/check.py +0 -0
  12. {libdev-0.75 → libdev-0.77}/libdev/codes.py +0 -0
  13. {libdev-0.75 → libdev-0.77}/libdev/dev.py +0 -0
  14. {libdev-0.75 → libdev-0.77}/libdev/doc.py +0 -0
  15. {libdev-0.75 → libdev-0.77}/libdev/fin.py +0 -0
  16. {libdev-0.75 → libdev-0.77}/libdev/gen.py +0 -0
  17. {libdev-0.75 → libdev-0.77}/libdev/img.py +0 -0
  18. {libdev-0.75 → libdev-0.77}/libdev/lang.py +0 -0
  19. {libdev-0.75 → libdev-0.77}/libdev/num.py +0 -0
  20. {libdev-0.75 → libdev-0.77}/libdev/time.py +0 -0
  21. {libdev-0.75 → libdev-0.77}/libdev.egg-info/SOURCES.txt +0 -0
  22. {libdev-0.75 → libdev-0.77}/libdev.egg-info/dependency_links.txt +0 -0
  23. {libdev-0.75 → libdev-0.77}/libdev.egg-info/top_level.txt +0 -0
  24. {libdev-0.75 → libdev-0.77}/setup.cfg +0 -0
  25. {libdev-0.75 → libdev-0.77}/tests/test_cfg.py +0 -0
  26. {libdev-0.75 → libdev-0.77}/tests/test_check.py +0 -0
  27. {libdev-0.75 → libdev-0.77}/tests/test_codes.py +0 -0
  28. {libdev-0.75 → libdev-0.77}/tests/test_dev.py +0 -0
  29. {libdev-0.75 → libdev-0.77}/tests/test_doc.py +0 -0
  30. {libdev-0.75 → libdev-0.77}/tests/test_gen.py +0 -0
  31. {libdev-0.75 → libdev-0.77}/tests/test_img.py +0 -0
  32. {libdev-0.75 → libdev-0.77}/tests/test_lang.py +0 -0
  33. {libdev-0.75 → libdev-0.77}/tests/test_num.py +0 -0
  34. {libdev-0.75 → libdev-0.77}/tests/test_s3.py +0 -0
  35. {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.75
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.0
23
- Requires-Dist: boto3==1.28.46
24
- Requires-Dist: Pillow==10.0.0
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
@@ -2,6 +2,6 @@
2
2
  Initializing the Python package
3
3
  """
4
4
 
5
- __version__ = "0.75"
5
+ __version__ = "0.77"
6
6
 
7
7
  __all__ = ("__version__",)
@@ -15,22 +15,24 @@ from .cfg import cfg
15
15
  from .gen import generate
16
16
 
17
17
 
18
- s3 = boto3.client(
19
- 's3',
20
- endpoint_url=cfg('s3.host'),
21
- aws_access_key_id=cfg('s3.user'),
22
- aws_secret_access_key=cfg('s3.pass'),
23
- region_name='us-east-1',
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('mode').lower(),
30
- bucket=cfg('project_name'),
31
+ directory=cfg("mode").lower(),
32
+ bucket=cfg("project_name"),
31
33
  file_type=None,
32
34
  ):
33
- """ Upload file """
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('Content-Type')
46
- file_type = guess_extension(content_type.split(';')[0])
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
- """ Get list of buckets """
79
- return [bucket['Name'] for bucket in s3.list_buckets()['Buckets']]
81
+ """Get list of buckets"""
82
+ return [bucket["Name"] for bucket in s3.list_buckets()["Buckets"]]
80
83
 
81
84
 
82
85
  __all__ = (
83
- 's3',
84
- 'upload_file',
85
- 'get_buckets',
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.75
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.0
23
- Requires-Dist: boto3==1.28.46
24
- Requires-Dist: Pillow==10.0.0
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
@@ -0,0 +1,4 @@
1
+ requests
2
+ python-dotenv==1.0.1
3
+ boto3==1.34.136
4
+ Pillow==10.3.0
@@ -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.0",
55
- "boto3==1.28.46",
56
- "Pillow==10.0.0",
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",
@@ -1,4 +0,0 @@
1
- requests
2
- python-dotenv==1.0.0
3
- boto3==1.28.46
4
- Pillow==10.0.0
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