ezKit 1.11.15__tar.gz → 1.11.16__tar.gz

Sign up to get free protection for your applications and to get access to all the features.
Files changed (27) hide show
  1. {ezkit-1.11.15/ezKit.egg-info → ezkit-1.11.16}/PKG-INFO +1 -1
  2. ezkit-1.11.16/ezKit/dockerhub.py +48 -0
  3. {ezkit-1.11.15 → ezkit-1.11.16/ezKit.egg-info}/PKG-INFO +1 -1
  4. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit.egg-info/SOURCES.txt +1 -0
  5. {ezkit-1.11.15 → ezkit-1.11.16}/setup.py +1 -1
  6. {ezkit-1.11.15 → ezkit-1.11.16}/LICENSE +0 -0
  7. {ezkit-1.11.15 → ezkit-1.11.16}/MANIFEST.in +0 -0
  8. {ezkit-1.11.15 → ezkit-1.11.16}/README.md +0 -0
  9. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/__init__.py +0 -0
  10. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/_file.py +0 -0
  11. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/bottle.py +0 -0
  12. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/bottle_extensions.py +0 -0
  13. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/cipher.py +0 -0
  14. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/database.py +0 -0
  15. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/http.py +0 -0
  16. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/markdown_to_html.template +0 -0
  17. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/mongo.py +0 -0
  18. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/qywx.py +0 -0
  19. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/redis.py +0 -0
  20. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/sendemail.py +0 -0
  21. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/token.py +0 -0
  22. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/utils.py +0 -0
  23. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit/xftp.py +0 -0
  24. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit.egg-info/dependency_links.txt +0 -0
  25. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit.egg-info/requires.txt +0 -0
  26. {ezkit-1.11.15 → ezkit-1.11.16}/ezKit.egg-info/top_level.txt +0 -0
  27. {ezkit-1.11.15 → ezkit-1.11.16}/setup.cfg +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ezKit
3
- Version: 1.11.15
3
+ Version: 1.11.16
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -0,0 +1,48 @@
1
+ """Docker Hub"""
2
+ import requests
3
+ from loguru import logger
4
+
5
+
6
+ def get_latest_tags(url: str, limit: int = 20, proxies: dict | None = None) -> list | None:
7
+
8
+ info: str = "获取最新标签"
9
+
10
+ try:
11
+
12
+ logger.info(f"{info} [begin]")
13
+
14
+ # url = "https://hub.docker.com/v2/repositories/library/postgres/tags"
15
+
16
+ # 配置代理
17
+ # proxies = {
18
+ # "http": "http://127.0.0.1:1087",
19
+ # "https": "http://127.0.0.1:1087",
20
+ # }
21
+
22
+ # 请求接口
23
+ response = requests.get(url, params={"page": 1, "page_size": limit}, proxies=proxies, timeout=10)
24
+
25
+ # 检查请求状态码
26
+ if response.status_code != 200:
27
+ logger.error(f"{info} [请求接口错误, 状态码: {response.status_code}]")
28
+ return None
29
+
30
+ # 转换格式
31
+ data: dict = response.json()
32
+
33
+ results = data.get("results")
34
+
35
+ if results is None:
36
+ logger.error(f"{info} [请求结果错误]")
37
+ return None
38
+
39
+ # 提取 tags
40
+ tags = [tag["name"] for tag in results]
41
+
42
+ logger.success(f"{info} [success]")
43
+ return tags
44
+
45
+ except Exception as e:
46
+ logger.error(f"{info} [error]")
47
+ logger.exception(e)
48
+ return None
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: ezKit
3
- Version: 1.11.15
3
+ Version: 1.11.16
4
4
  Summary: Easy Kit
5
5
  Author: septvean
6
6
  Author-email: septvean@gmail.com
@@ -8,6 +8,7 @@ ezKit/bottle.py
8
8
  ezKit/bottle_extensions.py
9
9
  ezKit/cipher.py
10
10
  ezKit/database.py
11
+ ezKit/dockerhub.py
11
12
  ezKit/http.py
12
13
  ezKit/markdown_to_html.template
13
14
  ezKit/mongo.py
@@ -3,7 +3,7 @@ from setuptools import find_packages, setup
3
3
 
4
4
  setup(
5
5
  name='ezKit',
6
- version='1.11.15',
6
+ version='1.11.16',
7
7
  author='septvean',
8
8
  author_email='septvean@gmail.com',
9
9
  description='Easy Kit',
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