Skip to main content

Hyperbeam is a Python library designed to provide intelligent search tooling.

Project description

hyperbeam

Hyperbeam is a Python library designed to provide intelligent search tooling.

Features

  • Search via DuckDuckGo for text, news, videos, and images.
  • Optional integration with ScraperAPI for proxied requests.
  • Standardized output schema for search results across different modes.
  • Site-specific search limiting.

Prerequisites

  • Python 3.10+ (as seen in your virtual environment path)
  • uv: A fast Python package installer and resolver, written in Rust.
  • A ScraperAPI API key.

Installation

  1. Clone the repository:

    git clone https://github.com/hyprbm/hyperbeam.git
    cd hyperbeam
    
  2. Set up the environment variable for ScraperAPI: Create a .env file in the root of the project directory and add your ScraperAPI key:

    SCRAPERAPI_API_KEY="your_actual_api_key_here"
    

    Alternatively, you can set this environment variable directly in your system. The src/web_search.py module will raise a ValueError if this key is not set.

  3. Create a virtual environment and install dependencies using uv:

    uv venv # Create a virtual environment (e.g., .venv)
    source .venv/bin/activate # Activate the virtual environment (Linux/macOS)
    # For Windows (PowerShell): .venv\Scripts\Activate.ps1
    # For Windows (CMD): .venv\Scripts\activate.bat
    

    If you have a requirements.txt file:

    uv pip install -r requirements.txt
    

    If your project is packaged with pyproject.toml and you want to install it (e.g., in editable mode for development):

    uv pip install -e .
    

    (Ensure your pyproject.toml is configured correctly for this.)

Usage

The primary search functionality can be accessed via the web_search function in src/web_search.py.

Example (from src/example.ipynb or a Python script):

from src.web_search import web_search, ddgs_scraperapi_patch

# Important: If you want to use ScraperAPI for all DDGS calls,
# ensure SCRAPERAPI_API_KEY is set in your environment and then call the patch:
ddgs_scraperapi_patch()

# Perform a text search
text_results = web_search(keywords="latest advancements in AI", mode="text")
for result in text_results[:2]: # Print first two results
    print(result)

# Perform a news search for the last week
news_results = web_search(keywords="python programming news", mode="news", timeframe="w")
for result in news_results[:2]:
    print(result)

# Perform a video search
video_results = web_search(keywords="uv python tutorial", mode="video")
for result in video_results[:2]:
    print(result)

Refer to the src/example.ipynb notebook for more detailed examples and to experiment with the different search modes and parameters.

Development

(Optional: Add details about running tests, linters, or contributing guidelines here if applicable.)

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

hyperbeam-0.1.2.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

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

hyperbeam-0.1.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

Details for the file hyperbeam-0.1.2.tar.gz.

File metadata

  • Download URL: hyperbeam-0.1.2.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for hyperbeam-0.1.2.tar.gz
Algorithm Hash digest
SHA256 5b18ba6e3944fa8d688ff91a1c6bbe0d5f4cecdf066e18f92004f6dca23ee862
MD5 79907d3f19f31c0501b2efc6bf5ccc6d
BLAKE2b-256 92030a7885b0617f6fccbc9ede30e913848f62fb1efda56ee8ab458d47b01861

See more details on using hashes here.

File details

Details for the file hyperbeam-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: hyperbeam-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.13

File hashes

Hashes for hyperbeam-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 b6e7fa7e672e2653b32c2000857e4d0cba4495e6819fc8141cfff65932ac3c23
MD5 d946226cd3afdd332ea79cf33ed77b67
BLAKE2b-256 946676fd9c08e8a04ed54c82ceaafd9039e20dece26c5dcaafb6ee92d93d1f7e

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