从终端搜索startpage.com。

spcli的Python项目详细描述


PyPIPython versionsLicenseBuild status

Asciicast

sp是从终端搜索startpage.com的命令行实用程序。

它的灵感来自于项目ddgrgoogler

目录

安装

$ pip install spcli

用法

命令行

$ sp -h
usage: sp.py [-h] [-d] [-f] [-s SITE] [-t SPAN] [-u] [-v] [-np]
             [--browser BROWSER] [--json] [--no-color]
             [keywords [keywords ...]]

Search Startpage.com from the terminal.

positional arguments:
  keywords              search keywords

optional arguments:
  -h, --help            show this help message and exit
  -d, --debug           enable debug logging
  -f, --first           open the first result in a web browser
  -s SITE, --site SITE  search a site
  -t SPAN, --time SPAN  time limit search to 1 d|w|m|y (day,week,month,year)
  -u, --unsafe          disable the family filter
  -v, --version         show program's version number and exit
  -np, --no-prompt      do not enter interactive mode
  --browser BROWSER     open results using this web browser
  --json                output the results in JSON; implies --no-prompt
  --no-color            disable color output

Version 1.0.2
Copyright © 2018 Gary Blackwood <gary@garyblackwood.co.uk>
License: GPLv3
Website: https://github.com/garee/sp

交互模式

f          view the first set of results
n          view the next set of results
p          view the previous set of results
[index]    open search result in web browser
c [index]  copy the search result link to the clipboard
s KEYWORDS perform a search for KEYWORDS
?          show help
q          exit
*          all other inputs are treated as new search keywords

示例

  1. 搜索术语。
$ sp hello world
    关于BrxIt的消息的搜索^ ^ {CD2> }:
$ sp -s bbc.co.uk brexit
  1. 搜索过去24小时的结果。
$ sp -t d barcelona fc
  1. 自动打开第一个结果
$ sp -f python docs
  1. 禁用安全搜索。
$ sp -u pawn
  1. 以json格式输出。
$ sp --json climate change papers

浏览器支持

如果存在{{ CD3>}环境变量,则将用于打开搜索结果。否则,sp将尝试使用this list中的一个。

您可以使用--browser标志指定要使用的浏览器。它还接受浏览器可执行文件的路径。

$ sp --browser firefox

代理< /H2>

请求库用于执行http请求。您可以通过{a18}^ {< CD6}}和^ {CD7}}来配置代理。

$ exportHTTP_PROXY="http://10.10.1.10:3128"
$ exportHTTPS_PROXY="http://10.10.2.10.1080"

开发快速入门

创建并激活虚拟环境。

$ mkvirtualenv -p python3 sp
$ workon sp

安装依赖项。

$ pip install -r requirements.txt

格式化代码。

$ black sp/*.py

对代码运行静态分析。

$ pylint sp/*.py
$ flake8 sp/*.py

故障排除

如果您遇到任何问题,请create an issue

  1. 如果彩色输出在您的系统上不能正常工作,请将其禁用:
$ sp --no-color

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
java为什么我们不能将ArrayList<Integer>传递给具有(Integer…)的方法参数   java Spring RestTemplate映射JSON对映射的响应引发不匹配的PutException   在系统中找到java Selenium元素,但在Jenkins中未找到   java在Android中使用JavaMail API发送电子邮件,而不使用默认/内置应用程序   数组如何在Java数据结构中同时存储数字和相应的单词?   为什么“+”运算符未定义?JAVA   java如何在游戏中添加高分系统?   java在球门碰撞中区分球和球员   java如何使用SpringSecurity4.0.1使用Auth令牌实现Rest完整Web服务。释放   java如何解决这个错误:Android资源链接失败?   java多线程文件处理和数据库批插入   导致Tomcat失败的java无用块线程   java主线程做了太多的工作,尽管我使用了异步线程(laggy UI)   在Java FX 2.0中滚动锚定节点时,锚定始终可见?   java使用EJB3中的客户机jar和设计模式