Small module to work with SauceNAO locally
Project description
SauceNAO
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:
- BeautifulSoup - html parser
- requests - http library
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.saucenao import SauceNao
saucenao = SauceNao('directory', databases=999, minimum_similarity=65, combine_api_types=False, api_key='',
exclude_categories='', move_to_categories=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] [--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('test.jpg')
or get a generator object for a bulk of files:
results = saucenao.check_files(('test.jpg', 'test2.jpg'))
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.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.