Skip to main content

SauceNAO

Build Status Scrutinizer Code Quality Coverage Status
unofficial python module to make working with SauceNAO in projects easier

Installing

This script runs with Python 3.
There is a currently working Python 2 branch, but I'm not going to update it anymore.
Download this repository and run the setup.py to install all necessary dependencies

Dependencies

Required:

Optional:

  • Pillow - Python Imaging Library, used to generate images for unittests
  • python-dotenv - .env file loader used for unittests
  • requests-mock - requests mock responses used for unittests

Usage

You can run SauceNAO either as module:

import logging
from saucenao import SauceNao

saucenao = SauceNao(directory='directory', databases=999, minimum_similarity=65, combine_api_types=False, api_key='',
                    exclude_categories='', move_to_categories=False,  use_author_as_category=False,
                    output_type=SauceNao.API_HTML_TYPE, start_file='', log_level=logging.ERROR,
                    title_minimum_similarity=90)

or as application:

python usage.py --dir [--databases] [--minimum-similarity] [--combine-api-types] [--api-key] [--exclude-categories] [--move-to-categories] [--use-author-as-category] [--output-type] [--start-file] [--log-level] [--filter-creation-date] [--filter-modified-date] [--title-minimum-similarity]

you can also use it to get the gathered information for your own script:

filtered_results = saucenao.check_file(file_name='test.jpg')

or get a generator object for a bulk of files using the worker class, all parameters work here too:

from saucenao import Worker

results = Worker(directory='directory', files=('test.jpg', 'test2.jpg')).run()

Running the tests

In the tests folder you can run each unittest individually.
The test cases should be self-explanatory.

Development

Want to contribute? Great!
I'm always glad hearing about bugs or pull requests.

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Thanks

A big thanks to SauceNAO who are indexing all the images and compare them.
This script would be completely useless without them.

Release files for SauceNAO 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for SauceNAO 1.0.1
File Size Uploaded
SauceNAO-1.0.1.tar.gz 14.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for SauceNAO 1.0.1
File Interpreter ABI Platform
SauceNAO-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 37.2 kB

Release files / SauceNAO-1.0.1.tar.gz

Download URL SauceNAO-1.0.1.tar.gz
Size 14.8 kB
Tags Source
SHA-256 checksum
How to use checksums
62f81b81c6cd178fc51570e40e68671fb03f6a774d2cdbe0df6b521143e832bc
BLAKE2b-256 checksum
How to use checksums
cea38a71a820bd51e1b33111578e35d39b7c8dc60df7e43b983c88494165f053
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

Release files / SauceNAO-1.0.1-py3-none-any.whl

Download URL SauceNAO-1.0.1-py3-none-any.whl
Size 22.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
90f4879fd753928210d7febce4646f525241e3250d39634bf84da263984a203f
BLAKE2b-256 checksum
How to use checksums
5993c3ca33394ea0b60deaab2dd52259a6dc1a65db8bae2d091ab1b4e2d85ba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.20.0 setuptools/40.5.0 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

Release history Release notifications | RSS feed

1.1.0

2 release files

1.0.6

2 release files

1.0.5

2 release files

1.0.4

2 release files

1.0.3

2 release files

1.0.2

2 release files

This release

1.0.1 This release

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page