Skip to main content

Search in Google, Searx, Rambler. Explore VK, Facebook, Telegram, Twitter, Snapchat, Instagram, Tumblr, YouTube.

Project description

SEARCH-ME

PayPal

Version License Python Status Format Downloads


ASYNC SEARCH-ME

Search

  • Google
  • Rambler
  • Searx.

Explore

  • Facebook
  • Instagram
  • Snapchat
  • Telegram
  • Tumblr
  • Twitter
  • VK
  • YouTube.

PRE-INSTALLING

INSTALLING

pip install search-me

USAGE

import asyncio
import logging

# Import engines
from search_me import Google, Searx, Rambler

logging.basicConfig(level=logging.DEBUG)

settings = {
    "pdf_report": False,  # Export search data to pdf-documents
    "pdf_parse": False,  # Parse generated pdf-documents, when pdf_report=True
    "social_search": False,  # Activate search across socials
    "socials": [  # Names of social nets
        "vk",
        "instagram",
        "telegram",
        "twitter",
        "youtube",
        "facebook",
        "tumblr",
        "snapchat"
    ],
    "app": {
        "interactive": True,  # Activate CLI animation
        "cache": True  # Caching data in .json and .pkl files
    },
    "web": {
        "results": 10,  # Number of search results on page
        "retry": 5,  # Number of retries for one query
        "timeout": 60,  # Timeout for one request
        "wait_min": 0.0,  # Minimum time in seconds to sleep after each query
        "wait_max": 1.5  # Maximum time in seconds to sleep after each query
    },
    "pdf": {
        "timeout": 10,  # Waiting time in seconds for create pdf-document
        "summary_params": [
            "ratio",  # Type of summarizing ("ratio" or "words")
            0.2  # Value (percent of text or count of words)
        ],
        "text": True,  # Extract text from pdf
        "summary": True,  # Generate summary from extracted text
        "urls": True,  # Extract urls from pdf
        "keywords": True  # Generate keywords from extracted text
    },
    "social": {
        "posts_limit": 10,  # Number of posts
        "timeout": 100.0,  # Timeout for one mediafile
        "download_media": True,  # Download from Instagram, Tumblr, Youtube, Snapchat
        "export_data": True,  # Export posts data in file
        "export_format": "csv"  # Export file format (.csv, .xls, .html, .json)
    }
}

# Setup engine (similarly Rambler & Searx)
# Missed keys will fill auto
# If settings didn't passed, default configuration will be loaded
# search_engine = Google()
search_engine = Google(**settings)


async def main(engine):
    await engine.search(*["0x0007ee", "社會信用體系"])
    # Iterate over results until next call engine.search(...)
    # Results will save and reset before new search
    async for r in engine.results:
        if not(r is None):
            print(f"{r.q}  |   {r.rating}  |   {r.uri}")
    await engine.search("Виктор Суворов — Аквариум ", "0x0007ee")
    # await engine.test(samples=3)


loop = asyncio.get_event_loop()
loop.run_until_complete(main(search_engine))

LINKS

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

search-me-2.0.tar.gz (16.7 kB view hashes)

Uploaded Source

Built Distribution

search_me-2.0-py3-none-any.whl (15.0 kB view hashes)

Uploaded Python 3

Supported by

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