easyWechatpy 0.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.
- easyWechatpy-0.0.1/PKG-INFO +20 -0
- easyWechatpy-0.0.1/README.md +2 -0
- easyWechatpy-0.0.1/easyWechatpy/__init__.py +1 -0
- easyWechatpy-0.0.1/easyWechatpy/weChatRobot.py +62 -0
- easyWechatpy-0.0.1/easyWechatpy.egg-info/PKG-INFO +20 -0
- easyWechatpy-0.0.1/easyWechatpy.egg-info/SOURCES.txt +10 -0
- easyWechatpy-0.0.1/easyWechatpy.egg-info/dependency_links.txt +1 -0
- easyWechatpy-0.0.1/easyWechatpy.egg-info/not-zip-safe +1 -0
- easyWechatpy-0.0.1/easyWechatpy.egg-info/requires.txt +1 -0
- easyWechatpy-0.0.1/easyWechatpy.egg-info/top_level.txt +1 -0
- easyWechatpy-0.0.1/setup.cfg +4 -0
- easyWechatpy-0.0.1/setup.py +35 -0
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: easyWechatpy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: The purpose of the creation of this package is to make bioinformatics analysis simpler.
|
|
5
|
+
Home-page: https://github.com/xleizi/easyWechatpy
|
|
6
|
+
Author: Lei Cui
|
|
7
|
+
Author-email: cuilei798@qq.com
|
|
8
|
+
Maintainer: Lei Cui
|
|
9
|
+
Maintainer-email: cuilei798@qq.com
|
|
10
|
+
License: MIT License
|
|
11
|
+
Platform: linux
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Requires-Python: >=3
|
|
16
|
+
|
|
17
|
+
# easyWechatpy
|
|
18
|
+
easyWechatpy
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
from .weChatRobot import WechatRobot
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import requests
|
|
2
|
+
import json
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class WechatRobot:
|
|
6
|
+
def __init__(
|
|
7
|
+
self,
|
|
8
|
+
key="",
|
|
9
|
+
userid="",
|
|
10
|
+
msgtype="text",
|
|
11
|
+
qyapi="https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=",
|
|
12
|
+
):
|
|
13
|
+
self.headers = {"Content-Type": "application/json"}
|
|
14
|
+
self.msgtype = msgtype
|
|
15
|
+
self.qyapi = qyapi
|
|
16
|
+
self.key = key
|
|
17
|
+
self.userid = userid
|
|
18
|
+
self.url = f"{self.qyapi}{self.key}"
|
|
19
|
+
|
|
20
|
+
def do_post(self, payload):
|
|
21
|
+
try:
|
|
22
|
+
r = requests.post(self.url, data=payload, headers=self.headers)
|
|
23
|
+
if r.status_code == 200:
|
|
24
|
+
return True
|
|
25
|
+
else:
|
|
26
|
+
return False
|
|
27
|
+
except Exception as e:
|
|
28
|
+
return False
|
|
29
|
+
|
|
30
|
+
def send_mes(self, mes_info):
|
|
31
|
+
content = {}
|
|
32
|
+
content["msgtype"] = self.msgtype
|
|
33
|
+
msg_type = {"content": mes_info}
|
|
34
|
+
content["text"] = msg_type
|
|
35
|
+
print(content)
|
|
36
|
+
data = json.dumps(content)
|
|
37
|
+
try:
|
|
38
|
+
status = self.do_post(data)
|
|
39
|
+
if status:
|
|
40
|
+
return 0
|
|
41
|
+
else:
|
|
42
|
+
return 1
|
|
43
|
+
except Exception as e:
|
|
44
|
+
return 1
|
|
45
|
+
|
|
46
|
+
def send_custom_msg(self, msg, status=None, name=None, number=None):
|
|
47
|
+
base_url = "http://bj.s1f.ren/gzh/sendMsg"
|
|
48
|
+
query_params = {"userid": self.userid, "text": msg}
|
|
49
|
+
|
|
50
|
+
if status is not None:
|
|
51
|
+
query_params["status"] = status
|
|
52
|
+
if name is not None:
|
|
53
|
+
query_params["name"] = name
|
|
54
|
+
if number is not None:
|
|
55
|
+
query_params["number"] = number
|
|
56
|
+
|
|
57
|
+
response = requests.get(base_url, params=query_params)
|
|
58
|
+
|
|
59
|
+
if response.status_code == 200:
|
|
60
|
+
return response.text
|
|
61
|
+
else:
|
|
62
|
+
raise Exception(f"Request failed with status code: {response.status_code}")
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
Metadata-Version: 2.1
|
|
2
|
+
Name: easyWechatpy
|
|
3
|
+
Version: 0.0.1
|
|
4
|
+
Summary: The purpose of the creation of this package is to make bioinformatics analysis simpler.
|
|
5
|
+
Home-page: https://github.com/xleizi/easyWechatpy
|
|
6
|
+
Author: Lei Cui
|
|
7
|
+
Author-email: cuilei798@qq.com
|
|
8
|
+
Maintainer: Lei Cui
|
|
9
|
+
Maintainer-email: cuilei798@qq.com
|
|
10
|
+
License: MIT License
|
|
11
|
+
Platform: linux
|
|
12
|
+
Classifier: Operating System :: OS Independent
|
|
13
|
+
Classifier: License :: OSI Approved :: MIT License
|
|
14
|
+
Classifier: Programming Language :: Python :: 3
|
|
15
|
+
Requires-Python: >=3
|
|
16
|
+
|
|
17
|
+
# easyWechatpy
|
|
18
|
+
easyWechatpy
|
|
19
|
+
|
|
20
|
+
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
README.md
|
|
2
|
+
setup.py
|
|
3
|
+
easyWechatpy/__init__.py
|
|
4
|
+
easyWechatpy/weChatRobot.py
|
|
5
|
+
easyWechatpy.egg-info/PKG-INFO
|
|
6
|
+
easyWechatpy.egg-info/SOURCES.txt
|
|
7
|
+
easyWechatpy.egg-info/dependency_links.txt
|
|
8
|
+
easyWechatpy.egg-info/not-zip-safe
|
|
9
|
+
easyWechatpy.egg-info/requires.txt
|
|
10
|
+
easyWechatpy.egg-info/top_level.txt
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
requests
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
easyWechatpy
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
from setuptools import setup, find_packages
|
|
3
|
+
|
|
4
|
+
VERSION = '0.0.1'
|
|
5
|
+
|
|
6
|
+
setup(
|
|
7
|
+
name="easyWechatpy", # package name
|
|
8
|
+
version=VERSION, # package version
|
|
9
|
+
author="Lei Cui",
|
|
10
|
+
author_email="cuilei798@qq.com",
|
|
11
|
+
maintainer="Lei Cui",
|
|
12
|
+
maintainer_email="cuilei798@qq.com",
|
|
13
|
+
license="MIT License",
|
|
14
|
+
platforms=["linux"],
|
|
15
|
+
url="https://github.com/xleizi/easyWechatpy",
|
|
16
|
+
description="The purpose of the creation of this package is to make bioinformatics analysis simpler.",
|
|
17
|
+
long_description=open("README.md").read(),
|
|
18
|
+
packages=find_packages(),
|
|
19
|
+
zip_safe=False,
|
|
20
|
+
# entry_points={
|
|
21
|
+
# "console_scripts": [
|
|
22
|
+
# "easyBio=easyBio.easyBio:main",
|
|
23
|
+
# ]
|
|
24
|
+
# },
|
|
25
|
+
install_requires=[
|
|
26
|
+
"requests",
|
|
27
|
+
],
|
|
28
|
+
package_data={"Utils": ["Utils/*"]},
|
|
29
|
+
classifiers=[
|
|
30
|
+
"Operating System :: OS Independent",
|
|
31
|
+
"License :: OSI Approved :: MIT License",
|
|
32
|
+
"Programming Language :: Python :: 3",
|
|
33
|
+
],
|
|
34
|
+
python_requires=">=3",
|
|
35
|
+
)
|