English Document | 中文文档


qs running

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:
SystemLocation
WindowsC:\Users\YOUR_NAME\.qsrc
*nix/Users/YOUR_NAME/.qsrc or /root/.qsrc
  • .qsrcis a configuration table stored in JSON format. When it is first generated, the contents are as follows:
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
38
39
/* The comment content in the document does not exist in the file */
{
"basic_settings": {
"default_language": "zh", /* !The default language, ZH for Chinese, EN for English*/
"default_currency": "CNY", /* !The default currency,for Exchange rate conversion */
"default_translate_engine": { /* !Default language engine, do not modify "Support" */
"index": 0,
"support": ["default", "TencentCloud"]
},
"default_proxy": "user:password@ip:port or ip:port"
/* Set the download agent. Qs will not use this proxy to download without `-px` */
},
"API_settings": { /* Fill in the API keys you need to use */
"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/"
}
}
  • About the Default language:
SignLanguageSignLanguageSignLanguage
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(for MacOS X)
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
Command Means
qs top cpu and memory monitor
qs clear free memory
qs go2git 前往目录的git社区地址
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
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 upload upload your pypi library
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 cb get/post [msg] Get Or Post msg by using network disk
qs pasteme [get/post] [password/content] get or post content from/to pasteme.cn
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 Get the daily 60-second morning post
Command Means
qs stbg picture to [from] Replace color from from to to, default from is transparency
qs icat img Preview pictures on terminal (only supported by iterm on MacOS)
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

最近(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
  1. kd - Query China express

  2. Download interactive optimization

  3. Compression and decompression support 7z format

  4. fix 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
APIOrgPypi LibKey Value
remove bglinkNone“rmbg”
smmslinkNone“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”
IPinfolinkipinfo“ipinfo”
Baidu Image
Process

link

aip
“AipImageAPP_ID”
“AipImageAPP_KEY”
“AipImageSECRET_KEY”

Baidu NLP

link

aip
“AipNlpAPP_ID”
“AipNlpAPP_KEY”
“AipNlpSECRET_KEY”
Tencent translatelinktencentcloud-sdk-python“txyun_scid”
“txyun_sckey”
“txyun_df_region”

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) from str_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 the from_color with to_color of the Image.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 LAN

  • QuickStart_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 dict

    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): Return the downloadable links, file names, and requests.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 run
    • get_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 done
    • new_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 implies
  • QuickStart_Rhy.TuiTools.Bar.RollBar: Support for scrolling bar charts on the command line, you can run qs -top to see the effect.
  • QuickStart_Rhy.TuiTools.Line.Line: Support for line charts on the command line, you can run qs -weather to see the effect.

Wrappers

  • QuickStart_Rhy.Wrapper.set_timeout(num): function wrapper to make the function to terminate at a specified time num.

    • Examples:
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    from QuickStart_Rhy.Wrapper import set_timeout
    import time

    @set_timeout(2)
    def fuck(who):
    time.sleep(3)
    return 'fuck {}'.format(who)
    # run this function and it will return False

    @set_timeout(2)
    def fuck(who):
    return 'fuck {}'.format(who)
    # run this function and it will return 'fuck {}'.format(who)