QuickStart-Rhy
English Document | 中文文档
Install
Click here to get the installation documentation
1 | pip3 install quickstart-rhy [--upgrade] |
qs profile:.qsrc
- Starting with VERSION 0.3.0, when you first install QuickStart_Rhy and run
qs
from the command,qs
will generate the qs configuration table.qsrc
at the following location:
System | Location |
---|---|
Windows | C:\Users\YOUR_NAME \.qsrc |
*nix | /Users/YOUR_NAME /.qsrc or /root/.qsrc |
.qsrc
is a configuration table stored in JSON format. When it is first generated, the contents are as follows:
1 | /* The comment content in the document does not exist in the file */ |
- About the Default language:
Sign | Language | Sign | Language | Sign | Language |
---|---|---|---|---|---|
zh | 🇨🇳 | en | 🇬🇧 | jp | 🇯🇵 |
kor | 🇰🇷 | fra | 🇫🇷 | spa | 🇪🇸 |
th | 🇹🇭 | ara | 阿拉伯 | ru | 🇷🇺 |
pt | 🇵🇹 | de | 🇩🇪 | it | 🇮🇹 |
el | 🇬🇷 | nl | 🇵🇱 | bul | 🇧🇬 |
est | 🇪🇪 | dan | 🇩🇰 | fin | 🇫🇮 |
cs | 🇨🇿 | rom | 🇷🇴 | slo | 🇸🇮 |
swe | 🇸🇪 | hu | 🇭🇺 | vie | 🇻🇳 |
- As for the API, some of the apis rely on officially provided Python third-party libraries, but not every user will use them, and qs does not pre-install these Python third-party libraries as dependencies in order to keep the qs installation fun. Therefore, if you need to use the relevant API, please select install from the API Comparison table below.
*Special notes 1
: qs relies heavily on https://alapI.net for some of its convenience features, so you might want to consider signing up as a free user of ALAPI for a better experience.*Special notes 2
: If you are using a Mac system, qs recommends that you use iTerm as the default terminal to get the best experience.
Communicate
Usage
Command | Means |
---|---|
qs u url |
open url using default browser |
qs a app [files] |
open app or open file by app |
qs f file |
open file by default app |
qs cal exp |
calculate exp |
qs time |
view current time |
qs pcat |
Output the contents of the pasteboard |
qs fcopy file |
Copy the contents of the file to the pasteboard |
qs play file |
play audio in file |
Command | Means |
---|---|
qs top |
cpu and memory monitor |
qs clear |
free memory |
qs go2git |
Go to the directory’s github address |
qs mktar path ... |
create gzipped archive for path(dir/file) |
qs untar path ... |
extract path.tar.* |
qs mkzip path ... |
make a zip for path(dir/file) |
qs unzip path ... |
extract *.zip |
qs unrar path ... |
extract *.rar |
qs mk7z path ... |
make a 7z for path(dir/file) |
qs un7z path ... |
extract *.7z |
qs md5 path ... |
get the md5 value of files |
qs sha1 path ... |
get the sha1 value of files |
qs sha256 path ... |
get the sha256 value of files |
qs sha512 path ... |
get the sha512 value of files |
qs diff dir1 dir2 |
diff between the two directories |
qs mount path |
mount a dmg file |
qs unmount path |
unmount a dmg image |
Command | Means |
---|---|
qs http [ip:port] [-bind url] |
start a simple multithread http server, default ip=LAN:8000 |
qs netinfo [url ...] |
get url (or in clipboard)’s ip information |
qs wifi |
Scan nearby wifi and select connection |
qs dl [urls] [--help] |
download file from url(in clipboard) with smart strategy |
qs upgrade |
update qs |
Command | Means |
---|---|
qs trans [words] |
translate the content of [words] or the content in clipboard |
qs pinyin [words] |
query “pinyin” of the content of [words] or the content in clipboard |
qs rmbg picture |
remove image background |
qs smms picture/*.md |
upload images (or in markdown) to sm.ms |
qs upimg -help |
upload images (or in markdown) to platform (use -help to check) |
qs alioss -help |
get aliyun oss api help menu |
qs txcos -help |
get tencent cos api help menu |
qs qiniu -help |
get qiniu oss api help menu |
qs weather [address] |
check weather (of address) |
qs LG image |
Use Baidu AIPimage to enlarge image |
qs nlp [words] |
Text(or in clipboard) error correction (Baidu Cloud) |
qs bcv [url/video code] |
Download Bilibili video cover |
qs gbc garbage... |
China garbage classification query (only by Chinese) |
qs svi url |
get short video information with share url |
qs svd url |
download short video with share url |
qs acg [--save] |
Get an ACG picture link (or save) |
qs bing [--save] |
Get an bing picture link (or save) |
qs phi url |
get image links in url (preview on Mac::iTerm) |
qs kd courier-number |
Query China express |
qs loli [--save] [-p] |
get an loli picture link [or save (by default proxy)] |
qs setu [--save] [-p] |
get a setu picture link [or save (by default proxy)] |
qs exc number currency |
converts the specified number of currencies queried into the default currency |
qs zhihu |
Get Zhihu Daily |
qs wallhaven [--save] |
Get Wallhaven Anime Toplist |
qs lmgtfy keywords |
Get the “Let me Google for you” link for keywords |
qs d60 [--save] |
Get the daily 60-second morning post |
qs m2t |
transform magnet link to torrent file |
qs d2m |
transform designation to magnet url |
Command | Means |
---|---|
qs stbg picture to [from] |
Replace color from from to to , default from is transparency |
qs icat img |
Preview pictures on iTerm2 |
qs v2gif video [sz] [fps] |
generate gif form video |
qs v2mp4 video |
format video to mp4 |
qs v2mp3 video |
Extracting video and audio to MP3 |
qs rmaudio video |
Remove audio in video (return mp4 only) |
qs i2png imgs... |
Convert the picture to png format |
qs i2jpg imgs... |
Convert the picture to jpg format |
qs fmti img to [exp...] |
Format the color of the img to “to”, ignoring [exp…] Color |
Update Log
latest(2022-02-25)
d2m
— Search for designation and copy magnet url
- remove
cb
andpasteme
2022-01-15
m2t
—transform magnet link to torrent file
2021-08-07
fcopy
—Copy the contents of the file to the pasteboard
pcat
—Output the contents of the pasteboard
go2git
—Go to the warehouse address of the git community according to the current directory
i2png / i2jpg
—Convert the picture format to png or jpg
fmti
—Format the color of the picture to to, except for Colors in [exp…]
wallhaven
—Get the ACG porn diagram in Wallhaven Toplist
lmgtfy
—Generate and copy a “let me google that for you” link for the specified content
d60
—Get the daily 60-second morning post
2021-04-25
zhihu
— Get Zhihu Daily
wallhaven
— Get Wallhaven Anime Toplist
2021-02-26
setu
— 随机调用setu
, acg
获取图片链接
pinyin
— 查询指定内容的拼音(带音标)
exc
— 货币换算,将查询货币换算为设置的默认货币
2021-01-31
loli
— View or save Lori pictures (You need set proxy to access pixiv data)
2021-01-16
kd
- Query China expressDownload interactive optimization
Compression and decompression support
7z
formatfix bugs
API
- QuickStart-Rhy provide apis of some popular online platform, so you can do amazing things with qs!
- You need to register with the appropriate website in person and fill in the required API keys to ensure that qs is properly invoked
- Edit
~/.qsrc
to set your API keys!
Support API
Comparison table
API | Org | Pypi Lib | Key Value |
---|---|---|---|
remove bg | link | None | “rmbg” |
smms | link | None | “smms” |
Aliyun OSS | link | oss2 | “aliyun_oss_acid” “aliyun_oss_ackey” “aliyun_oss_df_bucket” “aliyun_oss_bucket_url” |
Qiniu OSS | link | qiniu | “qiniu_ac_key” “qiniu_sc_key” “qiniu_bk_name” |
Tencent COS | link | cos-python-sdk-v5 | “txyun_scid” “txyun_sckey” “txyun_df_region” “txyun_cos_df_bucket” |
IPinfo | link | ipinfo | “ipinfo” |
Baidu Image Process | link | aip | “AipImageAPP_ID” “AipImageAPP_KEY” “AipImageSECRET_KEY” |
Baidu NLP | link | aip | “AipNlpAPP_ID” “AipNlpAPP_KEY” “AipNlpSECRET_KEY” |
Tencent translate | link | tencentcloud-sdk-python | “txyun_scid” “txyun_sckey” “txyun_df_region” |
API Gallery
Upload Image
smms
- upload image:
1 | ➜ Desktop $ qs smms IMG_4758.jpeg |
- Upload images in markdown file, and replace the images path to urls.
1 | ➜ Desktop $ qs smms test.md |
upimg [Recommended]
upimg
has the same function withsmms
, butupimg
not need API keys. It support multiple platform to upload your image, but I do not guarantee that it is safe to upload pictures to any platform.
Check IP
ipinfo
- Just provide a function:
QuickStart_Rhy.api.ipinfo(ip:str=None)
, and it will return a dict with the ip information. [Notice]
This API positioning is not accurate, but their product managers are very confident
Demo
1 | from QuickStart_Rhy.api import ipinfo |
netinfo
- As the picture showed, you can get ip information by using domain, ip address or
me (keyword)
!
Translate
Tencent Translate
- After going through several unstable calling methods, I decided to use Tencent Cloud Machine Translation Service as the translation engine of
qs
, so you need install some library and set your account information at~/.qsrc
by yourself if you want use translate service.
Demo
1 | qs trans Looking in indexes |
AlAPI Translate
Demo
1 | qs trans Looking in indexes |
Aliyun OSS
Command | Function |
---|---|
qs alioss -up file [bucket] |
upload file to bucket/default bucket |
qs alioss -rm file [bucket] |
remove file in bucket |
qs alioss -dl file [bucket] |
download file from bucket |
qs alioss -ls [bucket] |
get file info of bucket |
Demo
1 | Bucket Url: https://***.aliyuncs.com/ |
Qiniu OSS
Command | Function |
---|---|
qs qiniu -up file [bucket] |
upload file to bucket/default bucket |
qs qiniu -rm file [bucket] |
remove file in bucket |
qs qiniu -cp url [bucket] |
copy file from url to bucket |
qs qiniu -dl file [bucket] |
download file from bucket |
qs qiniu -ls [bucket] |
get file info of bucket |
Demo
1 | ➜ hexo $ qs qiniu -ls |
Tencent COS
Command | Function |
---|---|
qs txcos -up file [bucket] |
upload file to bucket/default bucket |
qs txcos -rm file [bucket] |
remove file in bucket |
qs txcos -dl file [bucket] |
download file from bucket |
qs txcos -ls [bucket] |
get file info of bucket |
Demo
1 | ➜ hexo $ qs txcos -ls |
bcv: BiliBili Cover
Use | Result |
---|---|
- Download Bilibili video image, support
url
likehttps://www.bilibili.com/video/BV1J4y197Ht
orvideo code
likeBV1J4y197Ht
.
gbc:garbage classification
- Only support query by using Chinese.
svi/svd
- svd: Analyze the short video sharing link, output the straight link address of the video and the cover and download it as MP4 (using qs built-in download engine, mp4 is generated depending on ‘Moviepy’ library, it needs to be installed by yourself)
- svi: Only parse short video link, output video related information, do not download.
Tools for developers
Not content to just use qs on the command line? Qs now provides practical tools to help you develop Python applications faster!
ImageTools
ColorTools.py:
QuickStart_Rhy.ImageTools.ColorTools.get_color_from_str(str_color)
: get (R, G, B, A=255) fromstr_color
Examples:
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))
: replace thefrom_color
withto_color
of theImage.open(src)
.Examples:
call | return |
---|---|
transport_back('test.jpg', (0, 0, 0, 255)) |
Replace the transparent color with white |
NetTools
QuickStart_Rhy.NetTools.check_one_page(url)
: Determines whether the url is accessible.QuickStart_Rhy.NetTools.formatUrl(try_url)
: Try adding https:// or http:// to make the try_url accessible (There is no guarantee that the return value will be accessible)QuickStart_Rhy.NetTools.get_ip()
: Gets the IP of the current machine under the LANQuickStart_Rhy.NetTools.size_format(sz, align=False)
: Format size. 1000000 -> “1.000 MB” if not align else “ 1.000 MB”QuickStart_Rhy.NetTools.get_ip_info()
: return dict1
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)
: Return the downloadable links, file names, andrequests.head
return values.
ThreadTools
QuickStart_Rhy.ThreadTools.ThreadFunctionWrapper(threading.Thread)
: Opens a new thread to run the function.__init__(self, function, *args, **kwargs)
run(self)
: Start runget_res(self)
: Get function result
QuickStart_Rhy.ThreadTools.FileWriters
: Write file thread pool__init__(self, filename, workers, mode)
: mode example:r+
,w
,rb+
,wb
wait(self)
: wait all thread donenew_job(self, content, index)
: new write job
filename must have been created and pre-allocated enough space
TuiTools
QuickStart_Rhy.TuiTools.get_console_width()
: just as its name impliesQuickStart_Rhy.TuiTools.Bar.RollBar
: Support for scrolling bar charts on the command line, you can runqs -top
to see the effect.QuickStart_Rhy.TuiTools.Line.Line
: Support for line charts on the command line, you can runqs -weather
to see the effect.
Wrappers
QuickStart_Rhy.Wrapper.set_timeout(num)
: function wrapper to make the function to terminate at a specified timenum
.- Examples:
1
2
3
4
5
6
7
8
9
10
11
12
13from QuickStart_Rhy.Wrapper import set_timeout
import time
def fuck(who):
time.sleep(3)
return 'fuck {}'.format(who)
# run this function and it will return False
def fuck(who):
return 'fuck {}'.format(who)
# run this function and it will return 'fuck {}'.format(who)