Skip to main content

🔍 零配置通用搜索工具 - 支持多引擎的命令行搜索

Project description

🔍 Universal Search Tool - 零配置通用搜索工具

Python Version License Build Status

🚀 安全、零配置、开箱即用的命令行搜索工具 - 支持多个搜索引擎,绕过搜索限制

✨ 特色功能

  • 安全配置: 用户使用自己的私密 API key,保护隐私
  • 多引擎支持: Google、Bing、DuckDuckGo 搜索
  • 高质量结果: 绕过搜索限制,获得专业级结果
  • 简单易用: 一行命令即可搜索任何内容
  • 跨平台: 支持 Windows、macOS、Linux、Android(Termux)

🔧 安装

方法1: 通过 pip 安装 (推荐)

pip install universal-search-tool

方法2: 开发模式安装

git clone https://github.com/your-username/universal-search-tool.git
cd universal-search-tool
pip install -e .

🚀 快速开始

安装完成后,直接使用:

# 基本搜索
universal-search "Python教程"

# 指定搜索引擎
universal-search "AI工具" --engine bing --count 5
universal-search "React框架" --engine duckduckgo --count 3

# 站点限制搜索
universal-search "开源项目 site:github.com"
universal-search "API文档 site:readthedocs.io"

📋 使用示例

# 通用搜索
universal-search "Django REST framework"

# Bing 搜索不同结果
universal-search "机器学习课程" --engine bing

# DuckDuckGo 注重隐私
universal-search "隐私工具" --engine duckduckgo

# 获取更多结果
universal-search "JavaScript库" --count 10

# 查看帮助
universal-search --help
universal-search --examples

🏗️ 命令行选项

universal-search [OPTIONS] [QUERY]

OPTIONS:
  -e, --engine {google,bing,duckduckgo}  搜索引擎 (默认: google)
  -c, --count INT                        结果数量 (默认: 5)
  --examples                             显示使用示例
  --version                              显示版本信息
  --help                                 显示帮助信息

🔌 作为 Python 库使用

也可以在 Python 代码中使用:

from universal_search import UniversalSearch

# 创建搜索实例
search = UniversalSearch()

# 执行搜索
results = search.search("Python教程", engine="google", count=5)

# 打印结果
search.print_results("Python教程", engine="bing", count=3)

# 获取原始结果数据
for result in results:
    print(f"标题: {result['title']}")
    print(f"链接: {result['url']}")
    print(f"描述: {result['snippet']}")

🌟 高级用法

自定义 API Key

如果你有自己的 SerpApi API key:

# 使用自定义 API key
search = UniversalSearch(api_key="your_api_key_here")

批量搜索

queries = ["Python教程", "Django框架", "React学习"]
for query in queries:
    search.print_results(query, engine="google", count=3)
    print("---" * 20)

📊 搜索引擎对比

引擎 搜索质量 隐私保护 结果差异化
Google ⭐⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐⭐
Bing ⭐⭐⭐⭐ ⭐⭐⭐ ⭐⭐⭐⭐⭐
DuckDuckGo ⭐⭐⭐⭐ ⭐⭐⭐⭐⭐ ⭐⭐⭐⭐

🔧 技术栈

  • 后端: Python 3.7+
  • 搜索引擎: SerpApi API
  • 依赖: google-search-results
  • 打包: setuptools, wheel

📝 更新日志

v1.0.0 (2024-12-20)

  • ✨ 首次发布
  • ✅ 支持 Google、Bing、DuckDuckGo 搜索
  • ✅ 零配置,内置 API key
  • ✅ 命令行和 Python 库双接口
  • ✅ 跨平台支持

🤝 贡献

欢迎提交 Issue 和 Pull Request!

# 开发环境设置
git clone https://github.com/your-username/universal-search-tool.git
cd universal-search-tool
pip install -e .

# 运行测试
python -m pytest tests/

📄 许可证

本项目采用 MIT 许可证 - 查看 LICENSE 文件了解详情

🔗 相关链接


🎊 使用愉快! 如果这个工具对你有帮助,请给个 ⭐ Star!

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

universal_search_tool-1.1.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

universal_search_tool-1.1.0-py3-none-any.whl (10.6 kB view details)

Uploaded Python 3

File details

Details for the file universal_search_tool-1.1.0.tar.gz.

File metadata

  • Download URL: universal_search_tool-1.1.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.12

File hashes

Hashes for universal_search_tool-1.1.0.tar.gz
Algorithm Hash digest
SHA256 088979943461840cd981c0856c639a80d2952dff4d513c9e644eabd13213eada
MD5 5aa140b32a9845ba77af0e06cef2c3fd
BLAKE2b-256 c498025ecf0a5d9c931e14aced8e68786f1417395f89455a5559d51ceacf777c

See more details on using hashes here.

File details

Details for the file universal_search_tool-1.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for universal_search_tool-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bd6813e6925fc32697d96dd71b8338ed333375afdbc68c0a2495a58769c3f21d
MD5 b0459761a7cad9a18c2f3eb8daf2da30
BLAKE2b-256 499ab2fea565840291625070bb7f40ece920364f75488e1b2dbdb0784d9cb546

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page