A package include all common part,like function,enum,written by zhangwei(zwzw911)
Project description
#zhangwei_helper
zhangwei_helper is a package include all common part,like function,enum,written
by zhang wei(zwzw911)
install
pip install zhangwei-helper
content
enum
SelfEnum
description: a module include self defined enum
usage:
import zhangwei_helper.SelfEnum as self_enum
- CpuBits: bits64/bits32
- OsType: Windows/Linux
- WindowsVersion: Windows7/Windows8/Windows10/Unknown
- WindowsBits: Win32/Win64
- PythonVersion: Python2/Python3/Unknown
- ProxyType: Transparent/Anonymous/High_anonymous
- BrowserType: FireFox/Chrome/All
function
os
description: a module include some functions about os
usage:
import zhangwei_helper.function.Os as zw_os
- get_cpu_bits(): 枚举(CpuBits):cpu的位数
- get_os_type(): 枚举(OsType):os的类型:windows或者linux
- get_windows_ver(): 枚举(WindowsVersion):windows的版本(7/8/10)
- get_windows_bits(): 枚举(WindowsBits):windows的位数:32或者64
- windows_login_as_admin(): Boolean:当前是否以admin登录
- get_python_major_version():枚举(PythonVersion):返回python的大版本号:2或者3或者unknown
WindowsService
description: a module include some functions about os
usage:
import zhangwei_helper.function.WindowsServices as zw_winser
- if_service_exists(): Boolean:服务是否存在
- if_service_running(): Booleans:服务是否运行
Network
description: a module include some functions about network
usage:
import zhangwei_helper.function.Network as zw_network
- extract_protocol_from_url(url):获得协议http或者https
- extract_host_from_url(url):获得host
- extract_base_url_from_url(url):获得基础url https://github.com
- gen_proxies_from_ip(ip): 根据IP生成request/request_html需要的代理
- detect_if_need_proxy(url): Boolean:是否需要代理
- detect_if_proxy_usable(proxies, timeout=5, url='https://www.baidu.com'):Boolean:代理是否有效
- detect_url_exist(url, proxies, headers): url是否存在(返回404)
- send_request_get_response(**args): request_html或者error。同步获得页面html
- async_send_request_get_response(**args): request_html或者error。异步获得页面html
- download_file(url,save_path): Error(下载失败);None(下载成功)
- download_unzip_chrome_driver
- download_unzip_firefox_driver
Software
description: a module include some functions about software
usage:
- check_minimum_python_version(ver=str): Error(python版本不匹配或者未安装);python安装路径
- check_firefox_version(): None(未安装FF);FF版本(自动补齐.0)
- check_chrome_version(): None(未安装):chrome版本
- check_driver_exist(python_dir, browser_type): 检查对应的driver在python目录下是否存在
- unzip_file():解压zip文件到指定目录
- is_valid_zip_file():是否为合格的zip文件
change history
0.0.1 add SelfEnum/Os/WindowsServices
0.0.2 add const/Const.py, function/Network.py, function/Software
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for zhangwei_helper-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 34f2e3a867fe1c07a669130e6ed1400acc640c421a1222786ee1bb18f2eacea7 |
|
MD5 | d5cb32cdfc9cf7c5af6022df18eb54cb |
|
BLAKE2b-256 | fcbfa2ffcaef9a6708ed7ebe70e654a34b455065920598e76b52ca8fdbf3ccec |