Search in Google, Searx, Rambler. Explore VK, Facebook, Telegram, Twitter, Snapchat, Instagram, Tumblr, YouTube.
Project description
ASYNC SEARCH-ME
Search
- Rambler
- Searx.
Explore
- Snapchat
- Telegram
- Tumblr
- VK
- YouTube.
PRE-INSTALLING
- For generating pdf files setup wkhtmltopdf
- For downloading videos from youtube setup youtube-dl
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.1.tar.gz
(16.7 kB
view hashes)
Built Distribution
search_me-2.0.1-py3-none-any.whl
(15.0 kB
view hashes)
Close
Hashes for search_me-2.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e3f46ed7f722941ad39a8378a638ef601995a54fdf774ec3e8b07ce566423277 |
|
MD5 | 2fde92ffdeb8d561244100d3b6e16cd1 |
|
BLAKE2b-256 | 6b3183496ac5590d569909b662d7dc632df9aa20013840d6eb08141fdaa94027 |