## Motivation
RevImg is a lightweight package to interact with Google Reverse Image Search. I created this package as an adequate other solution did not exist. Although [MRISA](https://github.com/vivithemage/mrisa) is quite good, there are three major shortcomings:
* It only allows returns the first page of Google Reverse Image results
* It adds unnecessary overhead in that you need to run a flask server
* Individual results are not intuitively grouped (i.e. MRISA returns a list of links, a list of titles, and a list of descriptions. I think it makes more intuitive sense for each individual result to be grouped, with the result containing its link, description, and title together as one logical grouping).
This library attempts to fix these issues. For the most part, this library is very similar to MRISA: in fact, much of the BS4 code is lifted directly from it. As a minor update, I switched out the use of pycurl for requests. While this could theoretically slow down the package somewhat, in experimentation, the major bottleneck is the Google response, not the difference in library. I think that the gain in simplicity (and thus user customization) is worth the minor performance hit.
## Usage
Initialization is simple:
```
from RevImg import RevImg
ri = RevImg()
```
You then have access to three methods.
#### get\_best_guess()
To retrieve Google's best guess:
```
ri.get_best_guess("https://via.placeholder.com/350x150")
```
This returns a string for what Google believes the image to be.
#### get_similar()
To get a list of similar images:
```
ri.get_similar("https://via.placeholder.com/350x150")
```
This returns a list of urls, with each url being a string.
#### get\_related_results()
To get a list of sites that have images similar to the one searched for:
```
ri.get_related_results("https://via.placeholder.com/350x150")
```
This creates a generator, with each next element being a dictionary of the form:
```
{
"title": "title here",
"link": "link.com",
"description": "description..."
}
```
We utilize a generator in order to decrease the need for useless page loads (given that this is the most expensive cost). As a result, should a list be necessary, we recommend simply processing it as a list comprehension:
```
results = [ret for ret in ri.get_reelated_results("https://via.placeholder.com/350x150")
```
### Disclaimer
Please note that this library is provided AS IS. Do NOT utilize it in a way that would be against Google's ToS.
Metadata
Release files for RevImg 0.0.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| RevImg-0.0.4.tar.gz | 3.1 kB | Without provenance | Details for RevImg-0.0.4.tar.gz |
Release files / RevImg-0.0.4.tar.gz
| Download URL | RevImg-0.0.4.tar.gz |
|---|---|
| Size | 3.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
6bc686650a066efcf3b1a2031f270973d424d348f375aa6a7c5d7d7022a7d198
|
|
BLAKE2b-256 checksum How to use checksums |
60d317137dffcca0f105458518fcf22bcfe2a109bed9418b82d811a24168ec33
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.7
|
Security for RevImg 0.0.4
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.