isrpa 0.9.8__py3-none-any.whl → 0.9.9__py3-none-any.whl

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/credentials.py CHANGED
@@ -14,9 +14,7 @@ def store_key(key_name,key_value,user_name):
14
14
 
15
15
  """
16
16
  # address = os.environ.get("address", "192.168.12.249")
17
- print(address)
18
17
  url = f"{address}/console/api/user_credentials"
19
- print(url)
20
18
  headers = {
21
19
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
22
20
  }
@@ -26,11 +24,8 @@ def store_key(key_name,key_value,user_name):
26
24
  'certificate_value': encode(key_value),
27
25
  'user_name': user_name
28
26
  }
29
- print(data)
30
27
  response = requests.post(url, headers=headers, json=data)
31
28
  if response.status_code != 200:
32
- print("请求失败,状态码:", response.status_code)
33
- print(response.text)
34
29
  return "failure"
35
30
  json = response.json()
36
31
  return json['certificate_key']
@@ -43,11 +38,8 @@ def get_key(key_name, user_name):
43
38
  """
44
39
  # address = os.environ.get("address", "192.168.12.249")
45
40
  url = f"{address}/console/api/user_credentials?certificate_key={key_name}&user_name={user_name}"
46
- print(url)
47
41
  response = requests.get(url)
48
42
  if response.status_code != 200:
49
- print("请求失败,状态码:", response.status_code)
50
- print(response.text)
51
43
  return "failure"
52
44
  json = response.json()
53
45
 
@@ -61,7 +53,6 @@ def delete_key(key_name,user_name):
61
53
  """
62
54
  # address = os.environ.get("address", "192.168.12.249")
63
55
  url = f"{address}/console/api/user_credentials"
64
- print(url)
65
56
  headers = {
66
57
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
67
58
  }
@@ -70,7 +61,6 @@ def delete_key(key_name,user_name):
70
61
  'certificate_key': key_name,
71
62
  'user_name': user_name
72
63
  }
73
- print(data)
74
64
  requests.delete(url, headers=headers, json=data)
75
65
 
76
66
  def list(user_name):
@@ -80,11 +70,8 @@ def list(user_name):
80
70
  """
81
71
  # address = os.environ.get("address", "192.168.12.249")
82
72
  url = f"{address}/console/api/user_credentials/list?user_name={user_name}"
83
- print(url)
84
73
  response = requests.get(url)
85
74
  if response.status_code != 200:
86
- print("请求失败,状态码:", response.status_code)
87
- print(response.text)
88
75
  return "failure"
89
76
  json = response.json()
90
77
 
@@ -98,11 +85,8 @@ def exist(key_name, user_name):
98
85
  """
99
86
  # address = os.environ.get("address", "192.168.12.249")
100
87
  url = f"{address}/console/api/user_credentials?certificate_key={key_name}&user_name={user_name}"
101
- print(url)
102
88
  response = requests.get(url)
103
89
  if response.status_code != 200:
104
- print("请求失败,状态码:", response.status_code)
105
- print(response.text)
106
90
  return False
107
91
 
108
92
 
@@ -114,7 +98,6 @@ def encode(certificate_value):
114
98
  key_name:凭证key
115
99
  """
116
100
  url = f"{address}/console/api/get_encode_credentials"
117
- print(url)
118
101
  headers = {
119
102
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
120
103
  }
@@ -122,11 +105,8 @@ def encode(certificate_value):
122
105
  data = {
123
106
  'certificate_value': certificate_value,
124
107
  }
125
- print(data)
126
108
  response = requests.post(url, headers=headers, json=data)
127
109
  if response.status_code != 200:
128
- print("请求失败,状态码:", response.status_code)
129
- print(response.text)
130
110
  return "failure"
131
111
  json = response.json()
132
112
  return json['certificate_value']
isrpa/utils.py CHANGED
@@ -22,7 +22,6 @@ def getPath(user_name):
22
22
  # address = os.environ.get("address", "192.168.12.249")
23
23
 
24
24
  url = f"{address}/client/getPath"
25
- print(url)
26
25
  headers = {
27
26
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
28
27
  }
@@ -30,10 +29,8 @@ def getPath(user_name):
30
29
  data = {
31
30
  'user_name': user_name
32
31
  }
33
- print(data)
34
32
  response = requests.post(url, headers=headers, json=data)
35
33
  if response.status_code != 200:
36
- print("请求失败,状态码:", response.status_code)
37
34
  return "failure"
38
35
  return response.json()
39
36
 
@@ -49,7 +46,6 @@ def upload_file(file_path, dest_file, user_name):
49
46
 
50
47
  # address = os.environ.get("address", "192.168.12.249")
51
48
  url = f"{address}/client/noticeUpload"
52
- print(url)
53
49
  headers = {
54
50
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
55
51
  }
@@ -59,7 +55,6 @@ def upload_file(file_path, dest_file, user_name):
59
55
  'dest_file': dest_file,
60
56
  'user_name': user_name
61
57
  }
62
- print(data)
63
58
  requests.post(url, headers=headers, json=data)
64
59
 
65
60
 
@@ -73,7 +68,6 @@ def vCode(image: str, code_type, apiKey, secretKey):
73
68
  :return:
74
69
  """
75
70
  url = "https://ai.i-search.com.cn/ocr/v2/vCode"
76
- print(url)
77
71
  headers = {
78
72
  'Content-Type': 'application/json', # 说明请求体是 JSON 格式
79
73
  }
@@ -85,11 +79,9 @@ def vCode(image: str, code_type, apiKey, secretKey):
85
79
  'apiKey': apiKey,
86
80
  'secretKey': secretKey
87
81
  }
88
- print(data)
89
82
  response = requests.post(url, headers=headers, json=data)
90
83
  status_code = response.status_code
91
84
  if status_code != 200:
92
- print("请求失败,状态码:", status_code)
93
85
  return {"error_msg": "failure", "error_code": status_code}
94
86
  return response.json()
95
87
 
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: isrpa
3
- Version: 0.9.8
3
+ Version: 0.9.9
4
4
  Summary: isrpa package
5
5
  Home-page: https://github.com/yourusername/mypackage
6
6
  Author: ysq
@@ -2,11 +2,11 @@ isrpa/OCR.py,sha256=nSDmVLo_z9GV7GUY57xBh2kumERG5_xtpUPxeF6ziQE,2509
2
2
  isrpa/Template.py,sha256=UP1uovLvJzXEPGo_hzLrIYOu3vZP8Cf6m3G2hGzQ6XA,1958
3
3
  isrpa/Template_Exception.py,sha256=an6eQ1NMB8a9R-J0yyMdwHIZcZeDtdV5f7fWKZQsZ3s,819
4
4
  isrpa/__init__.py,sha256=pG-YPVG0gJIJ6s4xcAz9S_CnUxpUcz33wl9eNUSgxGk,20
5
- isrpa/credentials.py,sha256=Qgitrm2pKgA1E_iGPg12Qq2Ka52pgTQCBHnT2U62ZHs,3999
5
+ isrpa/credentials.py,sha256=B9CKBgvik7U9YwwXIgtDb1jUfZuNcditLzyaL_-0arw,3342
6
6
  isrpa/llm_chat.py,sha256=jTuK9wcm3X36V9lXuGuTCdNup_zi2NeG2GuYHzO7gm4,1541
7
7
  isrpa/message.py,sha256=N0s6hMaC5S-Pi4EhwcSp-ngfBTBQyW6ymU9sI9dUSeE,11329
8
- isrpa/utils.py,sha256=uPCb1A1vDB0nTlII2BJz9kS0amk7mvzVA7ilI-UYA8Q,51439
9
- isrpa-0.9.8.dist-info/METADATA,sha256=LWf7tYP1P5yEyX8DHayHPmQgV8W_Z2fPZzufCbILKAU,511
10
- isrpa-0.9.8.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
11
- isrpa-0.9.8.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
12
- isrpa-0.9.8.dist-info/RECORD,,
8
+ isrpa/utils.py,sha256=Du2_yQJlB-JBm6Y6a3kT74mOGCtM3XffyX_5_cFudRI,51213
9
+ isrpa-0.9.9.dist-info/METADATA,sha256=BV0HEf3Ixu5wLaOjR4GlbopVrgc5ZmGz_Vtmj1CvE3Q,511
10
+ isrpa-0.9.9.dist-info/WHEEL,sha256=R06PA3UVYHThwHvxuRWMqaGcr-PuniXahwjmQRFMEkY,91
11
+ isrpa-0.9.9.dist-info/top_level.txt,sha256=J5HJbtR2WAeKnW1rrpkiuapwnlswv3RgM-riyZD87o0,6
12
+ isrpa-0.9.9.dist-info/RECORD,,
File without changes