Skip to main content

ONLINK: Operational Network Linkage Interface Navigator Kit - A simplified Python module for network interaction, search, and image fetching.

Project description

ONLINK: Operational Network Linkage Interface Navigator Kit

PyPI Version License: MIT

onlink is a powerful Python utility module designed to simplify common networking, search, and web-scraping tasks. Following the "simplify one thing" philosophy, search abstracts away the complexity of managing HTTP requests, parsing responses, handling errors, and integrating search APIs, making external data retrieval clean and Pythonic.


🌟 Features

  • Simplified HTTP: One-line functions for fetching webpage content.
  • Intelligent Search: Seamless integration with DuckDuckGo Search (DDGS) for text and image results.
  • Clean Parsing: Extracts clean, readable text from complex HTML pages.
  • Image Handling: Loads and displays web images directly using OpenCV, perfect for quick visualization and testing.
  • Robust Input: Automatically cleans and sanitizes URLs and handles common errors internally.

📥 Installation

Install the package using pip:

# Standard installation command
pip install onlink

🚀 Quick Start Example

Retrieve the top 3 search results for a query, then read the content of the first result, and finally display images from a secondary search.

import onlink as net

# 1. Perform a Search
search_urls = net.Search('latest python utility modules', results=3)
print("--- Search Results ---")
for i, url in enumerate(search_urls):
    print(f"{i+1}. {url}")

# 2. Read Clean Text from the first result (requires a valid URL)
if search_urls:
    first_url = search_urls[0]
    print(f"\n--- Reading Text from: {first_url} ---")
    readable_text = net.Read(first_url)
    print(readable_text[:500] + "...") # Print first 500 characters of the wrapped text

# 3. Display Images (requires OpenCV windows to close to continue)
print("\n--- Displaying Images for 'Python Logo' ---")
image_urls = net.Image('Python Logo', results=2)
# The net.Show() function handles loading the URLs and displaying the OpenCV windows.
net.Show(image_urls, size='640x480') 

print("\nFinished example.")

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

onlink-0.1.0.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

onlink-0.1.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

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