PicImageSearch Documentation
repository·main·Indexed 20 days ago
https://github.com/kituin/picimagesearchA Python library and aggregator for reverse image search APIs. It provides a unified interface for multiple search engines, including general-purpose tools like Google Lens, Bing, Yandex, and Baidu, as well as specialized anime/manga engines such as SauceNAO, TraceMoe, and AnimeTrace. The library supports both synchronous and asynchronous execution modes and includes utilities for HTTP client lifecycle management via the Network and ClientManager classes.
What's inside PicImageSearch
- PicImageSearch is a Python library designed for aggregated reverse image searching. It integrates multiple mainstream reverse image search engines into a single, unified, and concise API interface. This allows developers to implement image search functionality across various providers without writing custom integration code for each individual engine.
Choose between synchronous and asynchronous usage
mainPicImageSearch supports both synchronous and asynchronous execution modes. Asynchronous usage is recommended.
- Asynchronous (Recommended): Import from the base package:
from PicImageSearch import Network, .... - Synchronous: Import from the sync subpackage:
from PicImageSearch.sync import ....
- Asynchronous (Recommended): Import from the base package:
Use the Tineye model for image searching
mainThe
PicImageSearch.model.tineyemodule provides an interface to perform reverse image searches using the TinEye engine. This model allows you to submit an image and retrieve matching results from the TinEye service.from PicImageSearch.model.tineye import Tineye # Initialize the Tineye model tineye = Tineye() # Perform a search (example usage depends on specific implementation details) # results = tineye.search(image_path_or_url)Use the Yandex search model
mainThe
PicImageSearch.model.yandexmodule provides functionality to perform reverse image searches using the Yandex engine. This model is part of thePicImageSearchlibrary and allows you to pass an image (via URL or local file) to retrieve search results from Yandex.from picimagesearch.model.yandex import YandexModel # Initialize the model model = YandexModel() # Perform a search using an image URL results = model.search("https://example.com/image.jpg")Use the Google Lens search engine
mainThe
google_lensengine allows you to perform visual searches using Google Lens. It is part of thePicImageSearch.enginesmodule. You can use it by initializing theGoogleLensclass and calling its search methods with an image URL or local file path.from PicImageSearch.engines import GoogleLens # Initialize the engine engine = GoogleLens() # Perform a search using an image URL results = engine.search("https://example.com/image.jpg")Use the SauceNAO search engine
mainThePicImageSearch.engines.saucenaomodule allows you to perform reverse image searches using the SauceNAO service. This engine is part of thePicImageSearchlibrary and can be used to find the source of images, particularly anime or manga-related content.Install PicImageSearch
mainInstall PicImageSearch using
pip. This project requires Python 3.10 or higher.Standard installation:
pip install PicImageSearchUsing the Tsinghua mirror:
pip install PicImageSearch -i https://pypi.tuna.tsinghua.edu.cn/simpleUse the AnimeTrace search engine
mainThe
AnimeTraceengine is part of thePicImageSearch.enginesmodule. It can be used to trace anime images through the AnimeTrace service. To use it, you must instantiate theAnimeTraceclass from thePicImageSearch.engines.anime_tracemodule.from PicImageSearch.engines.anime_trace import AnimeTrace # Initialize the engine engine = AnimeTrace() # Perform a search (example usage pattern) # results = await engine.search(image_url='...')Use the EHentai search engine
mainThe
EHentaiengine allows you to search for content on EHentai. It is part of thePicImageSearch.engines.ehentaimodule. To use it, you must instantiate theEHentaiclass from thePicImageSearch.engines.ehentaipackage.from PicImageSearch.engines.ehentai import EHentai engine = EHentai() # Use engine.search() to perform searchesUse the Baidu search engine
mainThe Baidu search engine is available via the
PicImageSearch.engines.baidumodule. You can use it to perform image searches using Baidu's search capabilities.from PicImageSearch.engines.baidu import BaiduEngine # Initialize the engine engine = BaiduEngine() # Perform a search (example usage) # results = await engine.search(image_url='...')Use Google Lens for image search
mainThe
google_lensmodel inPicImageSearchallows you to perform visual searches using Google Lens. This model can identify objects, text, and products within an image by leveraging Google's visual recognition capabilities.from picimagesearch.model import google_lens # Example usage (requires appropriate setup for the model) results = google_lens.search(image_path_or_url)Use the TraceMoe search engine
mainThe
TraceMoeengine is part of thePicImageSearch.enginesmodule. It allows you to perform image searches using the TraceMoe service. To use it, you should import theTraceMoeclass from thePicImageSearch.engines.tracemoemodule.from PicImageSearch.engines.tracemoe import TraceMoe # Initialize the engine trace_moe = TraceMoe() # Perform a search (example usage depends on the engine's API) # results = await trace_moe.search(image_url=...)