isrpa 0.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.
isrpa-0.1/PKG-INFO ADDED
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.1
2
+ Name: isrpa
3
+ Version: 0.1
4
+ Summary: isrpa package
5
+ Home-page: https://github.com/yourusername/mypackage
6
+ Author: ysq
7
+ Author-email: wuzhengjun@i-search.com.cn
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
isrpa-0.1/README.md ADDED
File without changes
@@ -0,0 +1,12 @@
1
+ Metadata-Version: 2.1
2
+ Name: isrpa
3
+ Version: 0.1
4
+ Summary: isrpa package
5
+ Home-page: https://github.com/yourusername/mypackage
6
+ Author: ysq
7
+ Author-email: wuzhengjun@i-search.com.cn
8
+ Classifier: Programming Language :: Python :: 3
9
+ Classifier: License :: OSI Approved :: MIT License
10
+ Classifier: Operating System :: OS Independent
11
+ Requires-Python: >=3.6
12
+ Description-Content-Type: text/markdown
@@ -0,0 +1,8 @@
1
+ README.md
2
+ setup.py
3
+ isrpa.egg-info/PKG-INFO
4
+ isrpa.egg-info/SOURCES.txt
5
+ isrpa.egg-info/dependency_links.txt
6
+ isrpa.egg-info/top_level.txt
7
+ wzjpkg/__init__.py
8
+ wzjpkg/isrpaUtil.py
@@ -0,0 +1 @@
1
+ wzjpkg
isrpa-0.1/setup.cfg ADDED
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
isrpa-0.1/setup.py ADDED
@@ -0,0 +1,20 @@
1
+ from setuptools import setup, find_packages
2
+
3
+ setup(
4
+ name='isrpa',
5
+ version='0.1',
6
+ packages=find_packages(),
7
+ install_requires=[],
8
+ author='ysq',
9
+ author_email='wuzhengjun@i-search.com.cn',
10
+ description='isrpa package',
11
+ long_description=open('README.md').read(),
12
+ long_description_content_type='text/markdown',
13
+ url='https://github.com/yourusername/mypackage',
14
+ classifiers=[
15
+ 'Programming Language :: Python :: 3',
16
+ 'License :: OSI Approved :: MIT License',
17
+ 'Operating System :: OS Independent',
18
+ ],
19
+ python_requires='>=3.6',
20
+ )
@@ -0,0 +1 @@
1
+ from .isrpaUtil import *
@@ -0,0 +1,78 @@
1
+ import json
2
+ import os
3
+
4
+ import requests
5
+
6
+
7
+ def getUrl(port="9002"):
8
+ """
9
+ 环境变量设置
10
+ windows
11
+ setx ipAddress "192.168.12.249"
12
+
13
+ linux
14
+ export ipAddress = "192.168.12.249"
15
+ source /etc/profile
16
+ :param port:
17
+ :return:
18
+ """
19
+
20
+ ip_address = os.environ.get("ipAddress", "192.168.12.249")
21
+
22
+ return "ws://" + ip_address + ":" + port
23
+
24
+
25
+ def upload_file(file_path, dic_path, port: str):
26
+ """
27
+ 通知客户端上传文件
28
+ :param file_path:
29
+ :param dic_path:
30
+ :param port:
31
+ :return:
32
+ """
33
+
34
+ path = os.environ.get("ipAddress", "192.168.12.249")
35
+ url = "http://" + path + "/isrpa/executeCmd"
36
+ print(url)
37
+ headers = {
38
+ 'Content-Type': 'application/json', # 说明请求体是 JSON 格式
39
+ }
40
+ cmd_str = "proxy_manager_cli upload --port " + port + " --localfile " + file_path + " --destfile" + dic_path
41
+ # 请求体的数据
42
+ data = {
43
+ 'cmd_str': cmd_str
44
+ }
45
+ print(data)
46
+ requests.post(url, headers=headers, json=data)
47
+
48
+
49
+ def vCode(image: str, code_type, apiKey, secretKey):
50
+ """
51
+ ocr 识别图片验证码
52
+ :param image: 图片base64
53
+ :param code_type: 8000
54
+ :param apiKey:
55
+ :param secretKey:
56
+ :return:
57
+ """
58
+ url = "https://ai.i-search.com.cn/ocr/v2/vCode"
59
+ print(url)
60
+ headers = {
61
+ 'Content-Type': 'application/json', # 说明请求体是 JSON 格式
62
+ }
63
+
64
+ # 请求体的数据
65
+ data = {
66
+ 'image': image,
67
+ 'code_type': code_type,
68
+ 'apiKey': apiKey,
69
+ 'secretKey': secretKey
70
+ }
71
+ print(data)
72
+ response = requests.post(url, headers=headers, json=data)
73
+ status_code = response.status_code
74
+ if status_code != 200:
75
+ print("请求失败,状态码:", status_code)
76
+ return {"error_msg": "failure", "error_code": status_code}
77
+
78
+ return response.json()