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.1.tar.gz (11.7 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.1-py3-none-any.whl (10.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: universal_search_tool-1.1.1.tar.gz
  • Upload date:
  • Size: 11.7 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.1.tar.gz
Algorithm Hash digest
SHA256 3208df538e592eee64de058e8f1e78a3ee590f1765ab4166ca151d55bcca0ce7
MD5 7af7e0b6383bf7c7c6e6c587a307c22a
BLAKE2b-256 56f74d8a7d5950d4abcdfcf99a515268d32eb9bd948364fd50975be532ae5623

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for universal_search_tool-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1e06c3986375de49411de1ff3e6bfa3fdd3599bc94935f361230637f774853f8
MD5 79c5067b179cc881ea321abb189d7799
BLAKE2b-256 38daa09536555d3b731def231f3fe8bd00eb0f6e34385030b904f09894cd1cdb

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