eric-tools 1.2.6__tar.gz → 1.3.1__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 (33) hide show
  1. eric_tools-1.3.1/PKG-INFO +70 -0
  2. eric_tools-1.3.1/README.md +52 -0
  3. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/__init__.py +5 -14
  4. eric_tools-1.3.1/eric_tools/async_queue.py +45 -0
  5. eric_tools-1.3.1/eric_tools/downloader.py +57 -0
  6. eric_tools-1.3.1/eric_tools/excel_generator.py +49 -0
  7. eric_tools-1.3.1/eric_tools/logMixin.py +87 -0
  8. eric_tools-1.3.1/eric_tools/nginx_log.py +44 -0
  9. eric_tools-1.3.1/eric_tools.egg-info/PKG-INFO +70 -0
  10. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools.egg-info/SOURCES.txt +5 -0
  11. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools.egg-info/requires.txt +1 -0
  12. {eric_tools-1.2.6 → eric_tools-1.3.1}/setup.py +2 -1
  13. eric_tools-1.2.6/PKG-INFO +0 -61
  14. eric_tools-1.2.6/README.md +0 -43
  15. eric_tools-1.2.6/eric_tools.egg-info/PKG-INFO +0 -61
  16. {eric_tools-1.2.6 → eric_tools-1.3.1}/LICENSE +0 -0
  17. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/Abstract.py +0 -0
  18. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/convert_json.py +0 -0
  19. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/decorator.py +0 -0
  20. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/encryption_classmethod.py +0 -0
  21. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/exception_class.py +0 -0
  22. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/ip.py +0 -0
  23. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/jwt_encrypt.py +0 -0
  24. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/logger.py +0 -0
  25. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/pgsql.py +0 -0
  26. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/readconfig.py +0 -0
  27. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/remove.py +0 -0
  28. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/resize_image.py +0 -0
  29. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/send_email.py +0 -0
  30. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools/sftp.py +0 -0
  31. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools.egg-info/dependency_links.txt +0 -0
  32. {eric_tools-1.2.6 → eric_tools-1.3.1}/eric_tools.egg-info/top_level.txt +0 -0
  33. {eric_tools-1.2.6 → eric_tools-1.3.1}/setup.cfg +0 -0
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.1
2
+ Name: eric_tools
3
+ Version: 1.3.1
4
+ Summary: Python Daily Development Tools
5
+ Home-page: https://github.com/Eric-jxl/Tools
6
+ Author: Eric
7
+ Author-email: jxleric95@gmail.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.0
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+
17
+ # Tools
18
+ [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
19
+ ![latest 1.3](https://img.shields.io/badge/latest-1.3-green.svg?style=flat)
20
+ ![GitHub commits since latest release](https://img.shields.io/github/commits-since/eric-jxl/Tools/latest)
21
+
22
+
23
+ [New Year](https://eric-jxl.github.io/bak/index.html)
24
+
25
+ #### Project management of Python daily tools
26
+
27
+ ```shell
28
+ pip install eric_tools
29
+ ```
30
+
31
+
32
+
33
+ | 文件名 | 说明 |
34
+ | :----------------------------------------------------------: | :-----------------------------: |
35
+ | [encryption_classmethod.py ](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/Abstract.py) | HMAC+MD5加密签名算法 |
36
+ | [exception_class.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/exception_class.py) | 异常类 |
37
+ | [resize_image.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/resize_image.py) | 图片压缩 |
38
+ | [ip.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/ip.py) | ip地址定位API |
39
+ | [logger.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/logger.py) | 日志模块类和高级日志装饰器 |
40
+ | [remove.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/remove.py) | 删除文件 |
41
+ | [send_email.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/send_email.py) | 发送邮件 |
42
+ | [sftp.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/sftp.py) | ssh远程下载文件 |
43
+ | [pgsql.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/pgsql.py) | postgresql CRUD |
44
+ | [readconfig.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/readconfig.py) | 读取.ini配置文件 |
45
+ | [jwt_encrypt.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/jwt_encrypt.py) | 生成jwt Access Token 加密及解密 |
46
+ | [convert_json.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/convert_json.py) | 支持json和object之间转换 |
47
+ | [Abstract.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/Abstract.py) | 抽象类模型 |
48
+ | [decorator.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/decorator.py) | 惰性属性装饰器 |
49
+ | [async_queue.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/async_queue.py) | 异步队列 |
50
+ | [downloader.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/downloader.py) | 下载器 |
51
+ | [logMixIn.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/logMixIn.py) | 日志元类和高级日志装饰器 |
52
+ | [nginx_log.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/nginx_log.py) | nginx日志解析(默认access.log) |
53
+
54
+
55
+
56
+
57
+
58
+ >[!TIP]
59
+ >
60
+ > * async_queue.py 异步队列操作
61
+ >
62
+ > * downloader.py 下载器
63
+ >
64
+ > * logMixIn.py 日志元类和高级日志装饰器
65
+ >
66
+ > * nginx_log.py nginx日志解析(默认access.log)
67
+ >
68
+ > * [eric-tools==1.3](https://pypi.org/project/eric-tools/1.3/)
69
+
70
+
@@ -0,0 +1,52 @@
1
+ # Tools
2
+ [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
3
+ ![latest 1.3](https://img.shields.io/badge/latest-1.3-green.svg?style=flat)
4
+ ![GitHub commits since latest release](https://img.shields.io/github/commits-since/eric-jxl/Tools/latest)
5
+
6
+
7
+ [New Year](https://eric-jxl.github.io/bak/index.html)
8
+
9
+ #### Project management of Python daily tools
10
+
11
+ ```shell
12
+ pip install eric_tools
13
+ ```
14
+
15
+
16
+
17
+ | 文件名 | 说明 |
18
+ | :----------------------------------------------------------: | :-----------------------------: |
19
+ | [encryption_classmethod.py ](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/Abstract.py) | HMAC+MD5加密签名算法 |
20
+ | [exception_class.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/exception_class.py) | 异常类 |
21
+ | [resize_image.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/resize_image.py) | 图片压缩 |
22
+ | [ip.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/ip.py) | ip地址定位API |
23
+ | [logger.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/logger.py) | 日志模块类和高级日志装饰器 |
24
+ | [remove.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/remove.py) | 删除文件 |
25
+ | [send_email.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/send_email.py) | 发送邮件 |
26
+ | [sftp.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/sftp.py) | ssh远程下载文件 |
27
+ | [pgsql.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/pgsql.py) | postgresql CRUD |
28
+ | [readconfig.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/readconfig.py) | 读取.ini配置文件 |
29
+ | [jwt_encrypt.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/jwt_encrypt.py) | 生成jwt Access Token 加密及解密 |
30
+ | [convert_json.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/convert_json.py) | 支持json和object之间转换 |
31
+ | [Abstract.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/Abstract.py) | 抽象类模型 |
32
+ | [decorator.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/decorator.py) | 惰性属性装饰器 |
33
+ | [async_queue.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/async_queue.py) | 异步队列 |
34
+ | [downloader.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/downloader.py) | 下载器 |
35
+ | [logMixIn.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/logMixIn.py) | 日志元类和高级日志装饰器 |
36
+ | [nginx_log.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/nginx_log.py) | nginx日志解析(默认access.log) |
37
+
38
+
39
+
40
+
41
+
42
+ >[!TIP]
43
+ >
44
+ > * async_queue.py 异步队列操作
45
+ >
46
+ > * downloader.py 下载器
47
+ >
48
+ > * logMixIn.py 日志元类和高级日志装饰器
49
+ >
50
+ > * nginx_log.py nginx日志解析(默认access.log)
51
+ >
52
+ > * [eric-tools==1.3](https://pypi.org/project/eric-tools/1.3/)
@@ -4,24 +4,15 @@
4
4
  @Time : 2020-11-30 17:31
5
5
  @IDE : PyCharm
6
6
  '''
7
- import decorator
8
- import Abstract
9
- import convert_json
10
- import jwt_encrypt
11
- import send_email
12
- import readconfig
13
- import sftp
14
- import pgsql
15
- import encryption_classmethod
16
- import ip
17
- import logger
18
- import resize_image
19
- import exception_class
7
+ from . import decorator, Abstract, convert_json, jwt_encrypt, send_email, readconfig, sftp
8
+ from . import ip, logger, resize_image, exception_class, pgsql, encryption_classmethod
9
+ from . import async_queue, downloader, logMixin, nginx_log, excel_generator
10
+
20
11
 
21
12
  name = 'Eric-Tools'
22
13
  __title__ = 'tools'
23
14
  __description__ = 'Python HTTP for Humans.'
24
- __version__ = "1.2.6"
15
+ __version__ = "1.3.1"
25
16
  __author__ = 'Eric'
26
17
  __doc__ = ["Python Daily Development Tools"]
27
18
  __url__ = "https://github.com/Eric-jxl/Tools"
@@ -0,0 +1,45 @@
1
+ import asyncio
2
+
3
+
4
+ class AsyncMessageQueue:
5
+ def __init__(self, num_workers=3):
6
+ self.queue = asyncio.Queue()
7
+ self.num_workers = num_workers
8
+
9
+ async def process_message(self, message):
10
+ raise NotImplementedError
11
+
12
+ async def worker(self):
13
+ while True:
14
+ message = await self.queue.get()
15
+ await self.process_message(message)
16
+ self.queue.task_done()
17
+
18
+ async def start(self):
19
+ tasks = [asyncio.create_task(self.worker())
20
+ for _ in range(self.num_workers)]
21
+
22
+ # 等待所有任务完成
23
+ await self.queue.join()
24
+ for task in tasks:
25
+ task.cancel()
26
+
27
+
28
+ class EmailMessageQueue(AsyncMessageQueue):
29
+ async def process_message(self, message):
30
+ # 模拟发送邮件的耗时操作
31
+ await asyncio.sleep(2)
32
+ print(f"发送邮件: {message}")
33
+
34
+
35
+ async def main():
36
+ email_queue = EmailMessageQueue()
37
+
38
+ # 向队列中添加消息
39
+ for i in range(5):
40
+ await email_queue.queue.put(f"邮件{i}")
41
+
42
+ await email_queue.start()
43
+
44
+ if __name__ == "__main__":
45
+ asyncio.run(main())
@@ -0,0 +1,57 @@
1
+ import asyncio
2
+ import aiohttp
3
+ import os
4
+ import time
5
+ from collections import deque
6
+
7
+ class Downloader:
8
+ def __init__(self, urls, max_concurrent=5, delay=0):
9
+ self.urls = deque(urls)
10
+ self.max_concurrent = max_concurrent
11
+ self.delay = delay
12
+ self.queue = asyncio.Queue()
13
+ self.session = aiohttp.ClientSession()
14
+
15
+ async def download(self, url):
16
+ async with self.session.get(url) as response:
17
+ filename = os.path.basename(url)
18
+ with open(filename, 'wb') as f:
19
+ while True:
20
+ chunk = await response.content.read(1024)
21
+ if not chunk:
22
+ break
23
+ f.write(chunk)
24
+ print(f"{url} downloaded")
25
+
26
+ async def worker(self):
27
+ while True:
28
+ url = await self.queue.get()
29
+ try:
30
+ if self.delay:
31
+ time.sleep(self.delay)
32
+ await self.download(url)
33
+ except Exception as e:
34
+ print(f"Error downloading {url}: {e}")
35
+ self.queue.task_done()
36
+
37
+ async def run(self):
38
+ for url in self.urls:
39
+ self.queue.put_nowait(url)
40
+
41
+ tasks = []
42
+ for _ in range(self.max_concurrent):
43
+ task = asyncio.create_task(self.worker())
44
+ tasks.append(task)
45
+
46
+ await self.queue.join()
47
+
48
+ for task in tasks:
49
+ task.cancel()
50
+
51
+ await asyncio.gather(*tasks, return_exceptions=True)
52
+ await self.session.close()
53
+
54
+ if __name__ == "__main__":
55
+ urls = ["https://example.com/file1.txt", "https://example.com/file2.txt", "https://example.com/file3.txt"]
56
+ downloader = Downloader(urls, max_concurrent=2, delay=1)
57
+ asyncio.run(downloader.run())
@@ -0,0 +1,49 @@
1
+ import xlsxwriter
2
+
3
+
4
+ class ExcelGenerator:
5
+ def __init__(self, file_name='output.xlsx'):
6
+ self.workbook = xlsxwriter.Workbook(file_name)
7
+ self.current_sheet = None
8
+
9
+ def create_sheet(self, sheet_name='Sheet1'):
10
+ self.current_sheet = self.workbook.add_worksheet(sheet_name)
11
+
12
+ def write_data(self, row, col, data):
13
+ if self.current_sheet:
14
+ self.current_sheet.write(row, col, data)
15
+ else:
16
+ print("No sheet selected. Create a sheet first.")
17
+
18
+ def generate_from_data_structure(self, data_structure):
19
+ if not self.current_sheet:
20
+ self.create_sheet()
21
+
22
+ for row_index, row_data in enumerate(data_structure):
23
+ for col_index, cell_data in enumerate(row_data):
24
+ self.write_data(row_index, col_index, cell_data)
25
+
26
+ def save_file(self):
27
+ if self.workbook:
28
+ self.workbook.close()
29
+ else:
30
+ print("No workbook to save.")
31
+
32
+ def __enter__(self):
33
+ return self
34
+
35
+ def __exit__(self, exc_type, exc_value, exc_traceback):
36
+ self.save_file()
37
+
38
+
39
+ if __name__ == '__main__':
40
+ data_structure = [
41
+ ['Name', 'Age', 'City'],
42
+ ['John', 25, 'New York'],
43
+ ['Alice', 30, 'San Francisco'],
44
+ ]
45
+
46
+ with ExcelGenerator() as f:
47
+ f.create_sheet("Mysheet")
48
+ # TODO:Generate Excel from data structure
49
+ f.generate_from_data_structure(data_structure)
@@ -0,0 +1,87 @@
1
+ class Meta(type):
2
+ """自定义元类,用于动态添加Mixin"""
3
+
4
+ def __new__(meta, name, bases, dct):
5
+ if "use_logging" in dct and dct["use_logging"]:
6
+ dct.update(LogMixin.__dict__) # 动态添加LogMixin的属性和方法
7
+ return super().__new__(meta, name, bases, dct)
8
+
9
+
10
+ class LogMixin:
11
+ def log(self, message):
12
+ print(f"{self.__class__.__name__}: {message}")
13
+
14
+
15
+ class MyClass(metaclass=Meta):
16
+ use_logging = True # 设置标志位,指示是否使用日志Mixin
17
+
18
+ def do_something(self):
19
+ self.log("Doing something...")
20
+
21
+
22
+ class StrategyMeta(type):
23
+ """更智能的元类,根据类属性动态选择Mixin"""
24
+
25
+ def __new__(meta, name, bases, dct):
26
+ mixins_to_apply = []
27
+ if "security_required" in dct and dct["security_required"]:
28
+ mixins_to_apply.append(SecurityMixin)
29
+ if "cache_enabled" in dct and dct["cache_enabled"]:
30
+ mixins_to_apply.extend([CacheMixin, CacheControlMixin])
31
+
32
+ for mixin in mixins_to_apply:
33
+ dct.update(mixin.__dict__)
34
+
35
+ return super().__new__(meta, name, bases, dct)
36
+
37
+ # 假设SecurityMixin, CacheMixin, CacheControlMixin已定义
38
+
39
+
40
+ class MySecureClass(metaclass=StrategyMeta):
41
+ security_required = True
42
+ cache_enabled = True
43
+
44
+ def perform_operation(self):
45
+ self.secure_access()
46
+ self.cache_data()
47
+ self.control_cache()
48
+
49
+
50
+ _registry = []
51
+
52
+
53
+ class RegisterMixinMeta(type):
54
+ def __new__(cls, name, bases, dct):
55
+ new_class = super().__new__(cls, name, bases, dct)
56
+ if 'register_me' in dct and dct['register_me']:
57
+ _registry.append(new_class)
58
+ return new_class
59
+
60
+
61
+ class IPlugin(metaclass=RegisterMixinMeta):
62
+ """接口类 ,定义了插件应实现的方法"""
63
+
64
+ def plugin_action(self):
65
+ raise NotImplementedError("Subclasses must implement plugin_action.")
66
+
67
+
68
+ class PluginA(IPlugin):
69
+ register_me = True
70
+
71
+ def plugin_action(self):
72
+ print("Plugin A is active.")
73
+
74
+
75
+ class PluginB(IPlugin):
76
+ def plugin_action(self):
77
+ print("Plugin B is active but not registered explicitly.")
78
+
79
+
80
+ # 使用示例
81
+ for plugin_class in _registry:
82
+ plugin_class().plugin_action()
83
+
84
+
85
+ if __name__ == "__main__":
86
+ my_instance = MyClass()
87
+ my_instance.do_something()
@@ -0,0 +1,44 @@
1
+ import sys
2
+ import os
3
+ import datetime
4
+
5
+ # 定义一个函数来获取用户的输入
6
+
7
+
8
+ def get_user_input(prompt):
9
+ return input(prompt)
10
+
11
+
12
+ # 获取当前日期
13
+ today = datetime.date.today()
14
+
15
+ # 获取过去三天的日期
16
+ three_days_ago = today - datetime.timedelta(days=3)
17
+
18
+ # 获取要切割的日志文件路径
19
+ log_file_path = '/var/log/nginx/access.log'
20
+
21
+ # 获取要匹配的IP地址
22
+ ip_address = get_user_input("Enter the IP address to match: ")
23
+
24
+ # 创建一个新文件来存储切割后的日志
25
+ output_file_path = 'nginx_access_log_cut.txt'
26
+ with open(output_file_path, 'w') as output_file:
27
+ # 逐行读取日志文件
28
+ with open(log_file_path, 'r') as log_file:
29
+ for line in log_file:
30
+ # 分割日志行
31
+ parts = line.split()
32
+
33
+ # 获取日志日期
34
+ log_date = parts[3][1:]
35
+
36
+ # 检查日志日期是否在过去三天内
37
+ if log_date >= three_days_ago.strftime('%d/%b/%Y'):
38
+ # 检查日志行是否包含匹配的IP地址
39
+ if ip_address in line:
40
+ # 将日志行写入输出文件
41
+ output_file.write(line)
42
+
43
+ # 打印切割后的日志文件路径
44
+ print(f"Cut nginx access log saved to: {output_file_path}")
@@ -0,0 +1,70 @@
1
+ Metadata-Version: 2.1
2
+ Name: eric-tools
3
+ Version: 1.3.1
4
+ Summary: Python Daily Development Tools
5
+ Home-page: https://github.com/Eric-jxl/Tools
6
+ Author: Eric
7
+ Author-email: jxleric95@gmail.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+ Classifier: Programming Language :: Python :: 3
11
+ Classifier: License :: OSI Approved :: MIT License
12
+ Classifier: Operating System :: OS Independent
13
+ Requires-Python: >=3.0
14
+ Description-Content-Type: text/markdown
15
+ License-File: LICENSE
16
+
17
+ # Tools
18
+ [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
19
+ ![latest 1.3](https://img.shields.io/badge/latest-1.3-green.svg?style=flat)
20
+ ![GitHub commits since latest release](https://img.shields.io/github/commits-since/eric-jxl/Tools/latest)
21
+
22
+
23
+ [New Year](https://eric-jxl.github.io/bak/index.html)
24
+
25
+ #### Project management of Python daily tools
26
+
27
+ ```shell
28
+ pip install eric_tools
29
+ ```
30
+
31
+
32
+
33
+ | 文件名 | 说明 |
34
+ | :----------------------------------------------------------: | :-----------------------------: |
35
+ | [encryption_classmethod.py ](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/Abstract.py) | HMAC+MD5加密签名算法 |
36
+ | [exception_class.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/exception_class.py) | 异常类 |
37
+ | [resize_image.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/resize_image.py) | 图片压缩 |
38
+ | [ip.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/ip.py) | ip地址定位API |
39
+ | [logger.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/logger.py) | 日志模块类和高级日志装饰器 |
40
+ | [remove.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/remove.py) | 删除文件 |
41
+ | [send_email.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/send_email.py) | 发送邮件 |
42
+ | [sftp.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/sftp.py) | ssh远程下载文件 |
43
+ | [pgsql.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/pgsql.py) | postgresql CRUD |
44
+ | [readconfig.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/readconfig.py) | 读取.ini配置文件 |
45
+ | [jwt_encrypt.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/jwt_encrypt.py) | 生成jwt Access Token 加密及解密 |
46
+ | [convert_json.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/convert_json.py) | 支持json和object之间转换 |
47
+ | [Abstract.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/Abstract.py) | 抽象类模型 |
48
+ | [decorator.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/decorator.py) | 惰性属性装饰器 |
49
+ | [async_queue.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/async_queue.py) | 异步队列 |
50
+ | [downloader.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/downloader.py) | 下载器 |
51
+ | [logMixIn.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/logMixIn.py) | 日志元类和高级日志装饰器 |
52
+ | [nginx_log.py](https://github.com/eric-jxl/Tools/blob/62f538a1d34df869722c68e3ea5df222bdd1605e/eric_tools/nginx_log.py) | nginx日志解析(默认access.log) |
53
+
54
+
55
+
56
+
57
+
58
+ >[!TIP]
59
+ >
60
+ > * async_queue.py 异步队列操作
61
+ >
62
+ > * downloader.py 下载器
63
+ >
64
+ > * logMixIn.py 日志元类和高级日志装饰器
65
+ >
66
+ > * nginx_log.py nginx日志解析(默认access.log)
67
+ >
68
+ > * [eric-tools==1.3](https://pypi.org/project/eric-tools/1.3/)
69
+
70
+
@@ -3,13 +3,18 @@ README.md
3
3
  setup.py
4
4
  eric_tools/Abstract.py
5
5
  eric_tools/__init__.py
6
+ eric_tools/async_queue.py
6
7
  eric_tools/convert_json.py
7
8
  eric_tools/decorator.py
9
+ eric_tools/downloader.py
8
10
  eric_tools/encryption_classmethod.py
11
+ eric_tools/excel_generator.py
9
12
  eric_tools/exception_class.py
10
13
  eric_tools/ip.py
11
14
  eric_tools/jwt_encrypt.py
15
+ eric_tools/logMixin.py
12
16
  eric_tools/logger.py
17
+ eric_tools/nginx_log.py
13
18
  eric_tools/pgsql.py
14
19
  eric_tools/readconfig.py
15
20
  eric_tools/remove.py
@@ -2,3 +2,4 @@ psycopg2
2
2
  requests
3
3
  paramiko
4
4
  Pillow
5
+ xlsxwriter
@@ -7,7 +7,7 @@ with open("README.md", "r") as fh:
7
7
 
8
8
  setuptools.setup(
9
9
  name="eric_tools",
10
- version="1.2.6",
10
+ version="1.3.1",
11
11
  author="Eric",
12
12
  author_email="jxleric95@gmail.com",
13
13
  description="Python Daily Development Tools",
@@ -27,5 +27,6 @@ setuptools.setup(
27
27
  'requests',
28
28
  'paramiko',
29
29
  'Pillow',
30
+ 'xlsxwriter'
30
31
  ]
31
32
  )
eric_tools-1.2.6/PKG-INFO DELETED
@@ -1,61 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: eric_tools
3
- Version: 1.2.6
4
- Summary: Python Daily Development Tools
5
- Home-page: https://github.com/Eric-jxl/Tools
6
- Author: Eric
7
- Author-email: jxleric95@gmail.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.0
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
-
17
- # Tools
18
- [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
19
- ![latest 1.2.6](https://img.shields.io/badge/latest-1.2.6-green.svg?style=flat)
20
- ![GitHub commits since latest release](https://img.shields.io/github/commits-since/eric-jxl/Tools/latest)
21
-
22
-
23
- [New Year](https://eric-jxl.github.io/bak/index.html)
24
-
25
-
26
- #### Project management of Python daily tools
27
- ```shell
28
- pip install eric_tools
29
- ```
30
-
31
- ```
32
- encryption_classmethod.py Python HMAC+MD5加密签名算法
33
-
34
- exception_class.py 异常类
35
-
36
- resize_image.py 图片压缩
37
-
38
- ip.py ip地址定位API
39
-
40
- logger.py 日志模块类和高级日志装饰器
41
-
42
- remove.py 删除文件
43
-
44
- send_email.py 发送邮件
45
-
46
- sftp.py ssh远程下载文件
47
-
48
- pgsql.py 对postgresql 增删改查操作
49
-
50
- readconfig 针对读取配置文件
51
-
52
- jwt_encrypt 生成jwt Access Token 加密及解密
53
-
54
- convert_json 支持json和object之间转换
55
-
56
- Abstract.py 抽象类模型
57
-
58
- decorator.py 惰性属性装饰器
59
- ```
60
-
61
-
@@ -1,43 +0,0 @@
1
- # Tools
2
- [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
3
- ![latest 1.2.6](https://img.shields.io/badge/latest-1.2.6-green.svg?style=flat)
4
- ![GitHub commits since latest release](https://img.shields.io/github/commits-since/eric-jxl/Tools/latest)
5
-
6
-
7
- [New Year](https://eric-jxl.github.io/bak/index.html)
8
-
9
-
10
- #### Project management of Python daily tools
11
- ```shell
12
- pip install eric_tools
13
- ```
14
-
15
- ```
16
- encryption_classmethod.py Python HMAC+MD5加密签名算法
17
-
18
- exception_class.py 异常类
19
-
20
- resize_image.py 图片压缩
21
-
22
- ip.py ip地址定位API
23
-
24
- logger.py 日志模块类和高级日志装饰器
25
-
26
- remove.py 删除文件
27
-
28
- send_email.py 发送邮件
29
-
30
- sftp.py ssh远程下载文件
31
-
32
- pgsql.py 对postgresql 增删改查操作
33
-
34
- readconfig 针对读取配置文件
35
-
36
- jwt_encrypt 生成jwt Access Token 加密及解密
37
-
38
- convert_json 支持json和object之间转换
39
-
40
- Abstract.py 抽象类模型
41
-
42
- decorator.py 惰性属性装饰器
43
- ```
@@ -1,61 +0,0 @@
1
- Metadata-Version: 2.1
2
- Name: eric-tools
3
- Version: 1.2.6
4
- Summary: Python Daily Development Tools
5
- Home-page: https://github.com/Eric-jxl/Tools
6
- Author: Eric
7
- Author-email: jxleric95@gmail.com
8
- License: UNKNOWN
9
- Platform: UNKNOWN
10
- Classifier: Programming Language :: Python :: 3
11
- Classifier: License :: OSI Approved :: MIT License
12
- Classifier: Operating System :: OS Independent
13
- Requires-Python: >=3.0
14
- Description-Content-Type: text/markdown
15
- License-File: LICENSE
16
-
17
- # Tools
18
- [![License](https://img.shields.io/:license-apache-blue.svg)](https://opensource.org/licenses/Apache-2.0)
19
- ![latest 1.2.6](https://img.shields.io/badge/latest-1.2.6-green.svg?style=flat)
20
- ![GitHub commits since latest release](https://img.shields.io/github/commits-since/eric-jxl/Tools/latest)
21
-
22
-
23
- [New Year](https://eric-jxl.github.io/bak/index.html)
24
-
25
-
26
- #### Project management of Python daily tools
27
- ```shell
28
- pip install eric_tools
29
- ```
30
-
31
- ```
32
- encryption_classmethod.py Python HMAC+MD5加密签名算法
33
-
34
- exception_class.py 异常类
35
-
36
- resize_image.py 图片压缩
37
-
38
- ip.py ip地址定位API
39
-
40
- logger.py 日志模块类和高级日志装饰器
41
-
42
- remove.py 删除文件
43
-
44
- send_email.py 发送邮件
45
-
46
- sftp.py ssh远程下载文件
47
-
48
- pgsql.py 对postgresql 增删改查操作
49
-
50
- readconfig 针对读取配置文件
51
-
52
- jwt_encrypt 生成jwt Access Token 加密及解密
53
-
54
- convert_json 支持json和object之间转换
55
-
56
- Abstract.py 抽象类模型
57
-
58
- decorator.py 惰性属性装饰器
59
- ```
60
-
61
-
File without changes
File without changes
File without changes