English Document | 中文文档
安装
1
| pip3 install quickstart-rhy [--upgrade]
|
qs的配置表:.qsrc
- 自qs 0.3.0版本起,当您初次安装QuickStart_Rhy并通过命令运行
qs
时,qs
将在如下位置生成qs的配置表.qsrc
系统 |
位置 |
Windows |
C:\Users\你的用户名 \.qsrc |
*nix |
/Users/你的用户名 /.qsrc |
.qsrc
是以json格式存储的配置表,当它初次被生成时,内容为:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
| { "basic_settings": { "default_language": "zh", "default_translate_engine": { "index": 0, "support": ["default", "TencentCloud"] }, "default_proxy": "用户名:密码@ip:端口 或 ip:端口" }, "API_settings": { "rmbg": "GET: https://www.remove.bg", "smms": "GET: https://sm.ms", "darksky": "GET: https://darksky.net/", "aliyun_oss_acid": "GET: https://www.aliyun.com/product/oss", "aliyun_oss_ackey": "GET: https://www.aliyun.com/product/oss", "aliyun_oss_bucket_url": "GET: https://www.aliyun.com/product/oss", "aliyun_oss_df_bucket": "GET: https://www.aliyun.com/product/oss", "txyun_scid": "GET: https://console.cloud.tencent.com/", "txyun_sckey": "GET: https://console.cloud.tencent.com/", "txyun_cos_df_bucket": "GET: https://console.cloud.tencent.com/", "txyun_df_region": "GET: ap-[location]", "qiniu_ac_key": "GET: http://qiniu.com/", "qiniu_sc_key": "GET: http://qiniu.com/", "qiniu_bk_name": "GET: [Qiniu Bucket Name]", "gitee": "GET: http://gitee.com/", "ipinfo": "GET: https://ipinfo.io/", "AipImageAPP_ID": "GET: https://cloud.baidu.com/product/imageprocess", "AipImageAPP_KEY": "GET: https://cloud.baidu.com/product/imageprocess", "AipImageSECRET_KEY": "GET: https://cloud.baidu.com/product/imageprocess", "AipNlpAPP_ID" : "GET: https://cloud.baidu.com/product/nlp_apply", "AipNlpAPP_KEY": "GET: https://cloud.baidu.com/product/nlp_apply", "AipNlpSECRET_KEY": "GET: https://cloud.baidu.com/product/nlp_apply", "commonClipboardFilePath": "GET: /Path/to/file", "alapi_token": "GET: https://www.alapi.net/" } }
|
标志 |
语言 |
标志 |
语言 |
标志 |
语言 |
zh |
🇨🇳 |
en |
🇬🇧 |
jp |
🇯🇵 |
kor |
🇰🇷 |
fra |
🇫🇷 |
spa |
🇪🇸 |
th |
🇹🇭 |
ara |
阿拉伯 |
ru |
🇷🇺 |
pt |
🇵🇹 |
de |
🇩🇪 |
it |
🇮🇹 |
el |
🇬🇷 |
nl |
🇵🇱 |
bul |
🇧🇬 |
est |
🇪🇪 |
dan |
🇩🇰 |
fin |
🇫🇮 |
cs |
🇨🇿 |
rom |
🇷🇴 |
slo |
🇸🇮 |
swe |
🇸🇪 |
hu |
🇭🇺 |
vie |
🇻🇳 |
- 关于API,某些API需要依赖官方提供的Python第三方库,但并不是每位用户都会用到它们,为了保持qs安装时的轻松畅快,qs在安装时不会将这些Python第三方库作为依赖项预先安装。因此,如果你需要使用相关的API,请在下方的API对照表中选择安装。
*特殊说明 1
:qs的某些方便功能高度依赖alapi.net,因此你可以考虑注册成为alapi的免费用户以获得更好的使用体验。
*特殊说明 2
:如果您在使用Mac系统,qs推荐您使用iTerm作为默认终端以获得最棒的体验。
使用
命令 |
含义 |
类别 |
qs -u url |
使用默认浏览器打开多个链接 |
基础 |
qs -a app [files] |
打开应用或使用应用打开文件(仅支持Mac OS) |
基础 |
qs -f file |
使用合适的应用打开文件 |
基础 |
qs -cal exp |
计算算术表达式 |
基础 |
qs -time |
查看当前时间 |
基础 |
命令 |
含义 |
类别 |
qs -top |
CPU和内存监控器 |
系统 |
qs -clear |
释放本机内存 |
系统 |
qs -mktar path ... |
使用多个文件或文件夹创建tar压缩包 |
系统 |
qs -untar path ... |
解压各种格式的tar包 |
系统 |
qs -mkzip path ... |
使用多个文件或文件夹创建zip压缩包 |
系统 |
qs -unzip path ... |
解压zip压缩包 |
系统 |
qs -unrar path ... |
解压rar压缩包 |
系统 |
qs -mk7z path ... |
使用多个文件或文件夹创建7z压缩包 |
系统 |
qs -un7z path ... |
解压7z压缩包 |
系统 |
qs -md5 path ... |
获取文件的md5值 |
系统 |
qs -sha1 path ... |
获取文件的sha1值 |
系统 |
qs -sha256 path ... |
获取文件的sha256值 |
系统 |
qs -sha512 path ... |
获取文件的sha512值 |
系统 |
命令 |
含义 |
类别 |
qs -http [ip:port] [-bind url] |
在当前路径下开启简单的多线程http服务 |
网络 |
qs -netinfo [url ...] |
获取命令参数或剪切板中链接或ip的信息 |
网络 |
qs -wifi |
扫描附近WiFi并选择连接 |
网络 |
qs -dl [urls] [--help] |
从命令参数或剪切板中链接下载文件 (qs下载策略) |
网络 |
qs -upload |
上传你的pypi仓库 |
网络 |
qs -upgrade |
更新qs |
网络 |
命令 |
含义 |
类别 |
qs -trans [words] |
翻译命令参数或剪切板中的内容 |
API |
qs -rmbg picture |
移除图片背景 |
API |
qs -smms picture/*.md |
将图片或Markdown中图片上传至sm.ms |
API |
qs -upimg -help |
将图片或Markdown中图片上传至多平台(暂无需token) |
API |
qs -alioss -help |
获取阿里云对象存储的使用帮助 |
API |
qs -txcos -help |
获取腾讯云对象存储的使用帮助 |
API |
qs -qiniu -help |
获取七牛云对象存储的使用帮助 |
API |
qs -weather [address] |
获取当地天气(或指定地址天气) |
API |
qs -LG image |
通过百度图像效果增强放大图片 |
API |
qs -nlp [words] |
通过百度NLP对words 或剪切板内容纠错 |
API |
qs -cb get/post [msg] |
通过网络硬盘的本地文件系统get或post信息 |
API |
qs -pasteme get/post [password/content] |
通过pasteme.cn获取或传递内容 |
API |
qs -bcv [url/video code] |
获取B站视频、直播封面图片 |
API |
qs -gbc garbage... |
中国垃圾分类查询 (仅支持中文) |
API |
qs -svi url |
获取命令参数或剪切板内短视频分享链接的信息 |
API |
qs -svd url |
通过命令参数或剪切板内短视频分享链接下载视频 |
API |
qs -acg [save] |
获取一张acg图片链接(或保存) |
API |
qs -bing [save] |
获取一张bing图片链接(或保存) |
API |
qs -phi url |
获取url中的图片链接 (在Mac::iTerm上自动预览) |
API |
qs -kd courier-number |
查询国内快递 |
API |
命令 |
含义 |
类别 |
qs -stbg picture to [from] |
替换图片颜色(from默认为透明) |
图像 |
qs -icat img |
在终端预览图片(仅在MacOS下ITerm支持) |
图像 |
qs -v2gif video [sz] [fps] |
将视频导出为gif |
图像 |
qs -v2mp4 video |
将视频导出为mp4 |
图像 |
qs -v2mp3 video |
提取视频音频为mp3 |
图像 |
qs -rmaudio video |
删除视频的音频(仅返回mp4文件) |
图像 |
更新日志
最近(2020-01-16)
kd
— 查询国内快递!

下载交互优化
压缩与解压缩支持7z
格式
修复bug
API
- QuickStart-Rhy提供一些流行的在线平台的api,所以你可以用qs做令人惊奇的事情!
- 您需要亲自到适当的网站注册,并填写所需的API密钥,以确保正确调用qs
- 编辑的
~ /.qsrc
来设置你的API!
支持的 API
对照表
API |
官网 |
Pypi库 |
键值 |
remove bg |
链接 |
无 |
“rmbg” |
smms |
链接 |
无 |
“smms” |
Aliyun OSS |
链接 |
oss2 |
“aliyun_oss_acid” “aliyun_oss_ackey” “aliyun_oss_df_bucket” “aliyun_oss_bucket_url” |
Qiniu OSS |
链接 |
qiniu |
“qiniu_ac_key” “qiniu_sc_key” “qiniu_bk_name” |
Tencent COS |
链接 |
cos-python-sdk-v5 |
“txyun_scid” “txyun_sckey” “txyun_df_region” “txyun_cos_df_bucket”
|
IPinfo |
链接 |
ipinfo |
“ipinfo” |
Baidu Image Process |
链接 |
aip |
“AipImageAPP_ID” “AipImageAPP_KEY” “AipImageSECRET_KEY” |
Baidu NLP |
链接 |
aip |
“AipNlpAPP_ID” “AipNlpAPP_KEY” “AipNlpSECRET_KEY” |
Tencent translate |
链接 |
tencentcloud-sdk-python |
“txyun_scid” “txyun_sckey” “txyun_df_region” |
alapi |
链接 |
无 |
“alapi_token” |
API 画廊
rmbg
Raw |
Processed |
 |
 |
LG
上传图片
smms
1 2 3 4 5 6
| ➜ Desktop $ qs -smms IMG_4758.jpeg +---------------+--------+---------------------------+ | File | Status | url | +---------------+--------+---------------------------+ | IMG_4758.jpeg | True | https://*.loli.net/*t.jpg | +---------------+--------+---------------------------+
|
- 将markdown文件中图像上传,并将图像路径替换为url。
1 2 3 4 5 6 7 8
| ➜ Desktop $ qs -smms test.md +---------------+--------+---------------------------+ | File | Status | url | +---------------+--------+---------------------------+ | 1.jpg | True | https://*.loli.net/1.jpg | | 2.jpg | True | https://*.loli.net/2.jpg | | 3.jpg | True | https://*.loli.net/3.jpg | +---------------+--------+---------------------------+
|
upimg

upimg
有与smms
相同的功能,但upimg
不需要API键。
它支持多平台上传你的图片,但我不保证它是安全的上传图片到任何平台。
查IP
ipinfo
- 只提供一个函数:
QuickStart_Rhy.api.ipinfo(ip:str=None)
,它将返回一个包含ip信息的dict。
[注意]
这个API定位并不精确,不过他们的产品经理倒是很自信
样例
1 2 3
| >>> from QuickStart_Rhy.api import ipinfo >>> ipinfo('114.114.114.114') {'ip': '114.114.114.114', 'hostname': 'public1.114dns.com', 'city': 'Beijing', 'region': 'Beijing', 'country': 'CN', 'loc': '39.9075,116.3972', 'org': 'AS174 Cogent Communications', 'timezone': 'Asia/Shanghai', 'country_name': 'China', 'latitude': '39.9075', 'longitude': '116.3972'}
|
netinfo

- 如图所示,您可以通过使用网址、ip地址或
me(关键字)
来获取ip信息!
翻译
Tencent Translate
- 在经历了几种不稳定的翻译API后,我决定使用腾讯云机翻译作为qs的翻译引擎之一,所以如果你想使用翻译服务,你需要安装一些库,将你的账号信息设置在
~/.qsrc
。
样例
1 2
| $ qs -trans Looking in indexes 查找索引
|
AlAPI Translate
样例
1 2
| $ qs -trans Looking in indexes 查找索引
|
Aliyun OSS
命令 |
功能 |
qs -alioss -up file [bucket] |
上传文件到桶/默认桶 |
qs -alioss -rm file [bucket] |
删除桶中的文件 |
qs -alioss -dl file [bucket] |
从桶中下载文件 |
qs -alioss -ls [bucket] |
获取桶中的文件信息 |
样例
1 2 3 4 5 6 7 8
| Bucket Url: https://***.aliyuncs.com/ +--------------------------------+------------+ | File | Size | +--------------------------------+------------+ | 单片机原理及应用教程第3版.pdf | 25.156 MB | | 计算机网络(第7版)-谢希仁.pdf | 70.780 MB | | 软件工程导论.pdf | 100.819 MB | +--------------------------------+------------+
|
Qiniu OSS
命令 |
功能 |
qs -qiniu -up file [bucket] |
上传文件到桶/默认桶 |
qs -qiniu -rm file [bucket] |
删除桶中的文件 |
qs -qiniu -cp url [bucket] |
从url拷贝文件到桶中 |
qs -qiniu -dl file [bucket] |
从桶中下载文件 |
qs -qiniu -ls [bucket] |
获取桶中的文件信息 |
样例
1 2 3 4 5 6 7 8 9 10 11 12 13
| ➜ hexo $ qs -qiniu -ls Bucket url: http://***.bkt.clouddn.com/ +----------------------------+------------+ | File | Size | +----------------------------+------------+ | 591918ca03491.jpg | 522.393 KB | | BaiduExporter.zip | 64.810 KB | | BitBar.zip | 6.361 MB | | cover.png | 342.704 KB | | ev-cover.png | 483.959 KB | | google-access-helper-2.zip | 111.958 KB | | weather.15m.py | 13.386 KB | +----------------------------+------------+
|
Tencent COS
命令 |
功能 |
qs -txcos -up file [bucket] |
上传文件到桶/默认桶 |
qs -txcos -rm file [bucket] |
删除桶中的文件 |
qs -txcos -dl file [bucket] |
从桶中下载文件 |
qs -txcos -ls [bucket] |
获取桶中的文件信息 |
样例
1 2 3 4 5 6 7 8 9 10 11 12 13
| ➜ hexo $ qs -txcos -ls Bucket url: http://***.myqcloud.com/ +----------------------------+------------+ | File | Size | +----------------------------+------------+ | 1.jpg | 522.393 KB | | BaiduExporter.zip | 64.810 KB | | BitBar.zip | 6.361 MB | | ev-cover.png | 483.959 KB | | gd-cover.png | 342.704 KB | | google-access-helper-2.zip | 111.958 KB | | weather.15m.py | 13.386 KB | +----------------------------+------------+
|
开发者工具
不满足于只在命令行上使用qs? qs现在提供了实用的工具来帮助您更快地开发Python应用程序!
ColorTools.py:
QuickStart_Rhy.ImageTools.ColorTools.get_color_from_str(str_color)
: get (R, G, B, A=255) from str_color
样例:
call |
return |
get_color_from_str('0,0,0,0') |
(0, 0, 0, 0) |
get_color_from_str('0,0,0') |
(0, 0, 0, 255) |
get_color_from_str('FFFFFF') |
(255, 255, 255, 255) |
QuickStart_Rhy.ImageTools.ColorTools.transport_back(src: str, to_color, from_color=(0, 0, 0, 0))
: 将图片 Image.open(src)
中颜色 from_color
替换为 to_color
。
样例:
call |
return |
transport_back('test.jpg', (0, 0, 0, 255)) |
Replace the transparent color with white |
QuickStart_Rhy.NetTools.check_one_page(url)
: 确定url是否可访问。
QuickStart_Rhy.NetTools.formatUrl(try_url)
: 尝试添加https://或http://以使`try_url`可以访问(不能保证返回值可以访问)
QuickStart_Rhy.NetTools.get_ip()
: 获取局域网下当前机器的IP
QuickStart_Rhy.NetTools.size_format(sz, align=False)
: 格式化文件大小1000000 -> 1.000 MB
(如果不对齐,则为1.000 MB
)
QuickStart_Rhy.NetTools.get_ip_info()
: 返回字典
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| { 'status': 'success', 'country': 'China', 'countryCode': 'CN', 'region': 'Province name abbreviations', 'regionName': 'Province name', 'city': 'City', 'zip': '', 'lat': latitude, 'lon': longitude, 'timezone': 'Asia/Shanghai', 'isp': 'Network operator', 'org': 'Network operator + location', 'as': 'AS4134 Chinanet', 'query': 'Your public IP' }
|
QuickStart_Rhy.NetTools.get_fileinfo(url)
: 返回可下载的链接, 文件名和头部信息.
QuickStart_Rhy.TuiTools.get_console_width()
: 顾名思义,获取控制台宽度
QuickStart_Rhy.TuiTools.Bar.RollBar
:支持在命令行上滚动条形图,您可以运行qs -top
来查看效果。
QuickStart_Rhy.TuiTools.Line.Line
: 在命令行上支持折线图,您可以运行qs -weather
来查看效果。