Wrapper for SauceNAO JSON API
Project description
saucenao_api
“The rough edges are a part of its charm”
Unofficial wrapper for the SauceNAO JSON API
Installation
This package requires Python 3.6 or later
pip install saucenao_api
Dependencies
Usage
from saucenao_api import SauceNao
from saucenao_api.params import DB, Hide, Bgcolor
# Parameters from https://saucenao.com/user.php?page=search-api
sauce = SauceNao(api_key=None,
testmode=0,
dbmask=None,
dbmaski=None,
db=DB.ALL,
numres=6,
hide=Hide.NONE,
bgcolor=Bgcolor.NONE)
# results = sauce.from_file(file)
results = sauce.from_url('https://i.imgur.com/oZjCxGo.jpg')
results.short_remaining # 30 seconds limit
results.long_remaining # 24 hours limit
len(results) # 6
print(repr(results))
<SauceResponse(results_count=6, long_remaining=99, short_remaining=3)>
The library provides common parameters, such as similarity
, title
, url
, author
and some others for almost all results:
from saucenao_api import SauceNao
sauce = SauceNao()
results = sauce.from_url('https://i.imgur.com/oZjCxGo.jpg')
results[0].similarity # 93.3
results[0].title # めぐみん
results[0].url # https://www.pixiv.net/member_illust.php?mode=medium&illust_id=77630170
results[0].author # frgs
There are also special VideoSauce
and BookSauce
containers with extra parameters:
from saucenao_api import SauceNao, VideoSauce, BookSauce
sauce = SauceNao()
result = sauce.from_url('https://i.imgur.com/k9xlw6f.jpg')[0]
if isinstance(result, VideoSauce):
result.part # 02
result.year # 2009-2009
result.est_time # 00:05:32 / 00:21:10
elif isinstance(result, BookSauce):
result.part
License
This package is based on pysaucenao.
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.
Source Distribution
saucenao_api-1.0.2.tar.gz
(6.2 kB
view hashes)
Built Distribution
Close
Hashes for saucenao_api-1.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d18d3e0f8b47c9fba87e6e00cb190f2645c5f0a0df529a8db8dc3c1b7526c13 |
|
MD5 | 92376d569827a6663f7d2a2596778422 |
|
BLAKE2b-256 | 6f21ab35a3398294c57e11334c37fac81f9d104ae8d9fea79f53c4cee725ebe0 |