Package: iqdb-tagger
OverviewGet result from iqdb.org from CLI using python3.Feature:- Written for python3
- iqdb and danbooru.iqdb parser
- Hydrus integrationUsageUse as Hydrus as cli programTo parse folder of images (e.g. in this exampleimage_folder:) and write tags to text file, use following command:iqdb-taggercli-run--resize--match-filterbest-match--write-tags--input-modefolderimage_folderUse as Hydrus iqdb script serverRuniqdb-tagger runand note the server address.To run it on127.0.0.1on port5006, run the following command:`iqdb-taggerrun-h127.0.0.1-p5006`Import one of the parsing scripts below to Hydrus parsing scripts.Check the server address and edit it as needed.IQDB parsing script[32,"local iqdb",2,["http://127.0.0.1:5006",1,0,[55,1,[[],"some hash bytes"]],"file",{"place":"0","resize":"on"},[[29,1,["link",[27,5,[[["a",{"data-status":"best-match","class":"img-match-detail"},null]],0,"href",[51,1,[3,"",null,null,"example string"]],[55,1,[[],"parsed information"]]]],[[30,2,["",0,[27,5,[[["li",{"class":"tag-creator"},null]],1,"",[51,1,[3,"",null,null,"example string"]],[55,1,[[],"parsed information"]]]],"creator"]],[30,2,["",0,[27,5,[[["li",{"class":"tag-series"},null]],1,"",[51,1,[3,"",null,null,"example string"]],[55,1,[[],"parsed information"]]]],"series"]],[30,2,["",0,[27,5,[[["li",{"class":"tag-character"},null]],1,"",[51,1,[3,"",null,null,"example string"]],[55,1,[[],"parsed information"]]]],"character"]],[30,2,["",0,[27,5,[[["li",{"class":"tag-general"},null]],1,"",[51,1,[3,"",null,null,"example string"]],[55,1,[[],"parsed information"]]]],""]]]]]]]]Every uploaded and match history can be seen on Front page (in this casehttp://127.0.0.1:5006).Using IQDB-tagger with Hydrus APISet up your hydrus to get the access key, which will be used for this feature.Install the required hydrus packagepipinstallhttps://gitlab.com/cryzed/hydrus-api/-/archive/master/hydrus-api-master.zipAfter that you can run the command below. For example to run the command with image tagged as ‘thread:cat’ on hydrus# to get tagsiqdb-taggersearch-hydrus-and-send-tag--access_key1234_your_access_key'thread:cat'# to get matching urlsiqdb-taggersearch-hydrus-and-send-url--access_key1234_your_access_key'thread:cat'Note: hydrus version 349 have default bandwidth of 100 mb data per month,
which may raiseApiErrorwhen the bandwidth reached.to fix it, go toservicesmenu ->manage services-> client api and raise your bandwidth limitSetting Hydrus iqdb script server on NASHere is example for Synology DS1817+ with DSM6.1.7 running on an Intel Atom C2538Make sure SSH is turned on in your control panelInstall python 3 community package:https://synocommunity.com/package/python3Install pip3installpip3with:sudo-iwgethttps://bootstrap.pypa.io/get-pip.pypython3get-pip.pyInstall iqdb-taggercd/volume1/@appstore/py3k/usr/local/bin./pipinstalliqdb_tagger3.1 Addbinfolder to path (optional)exportPATH=$PATH:/volume1/@appstore/py3k/usr/local/binThat command line above can also be put on~/.bashrc, so NAS will run it everytime user login.InstallationInstall it with from pypi$pipinstalliqdb_taggerOr install it manually$gitclonehttps://github.com/softashell/iqdb_tagger.git$cdiqdb_tagger# run the command below$pythonsetup.pyinstall# for windows user: to force it using python3 run following command$python-3setup.pyinstall# or$pipinstall.If you are in windows and get SyntaxError, check your python version.
To install under python3 follow the instruction on this linkhttps://stackoverflow.com/a/18059129/1766261FAQlibxml error in WindowsIf you are encounter this error on WindowsCould not find function xmlCheckVersion in library libxml2. Is libxml2 installed?Please follow this guide to install lxml:StackOverflow - how to install lxml on windows?ContributingTo test the program do the following:$# install required package$pipinstall-e".[dev]"$cddocs$maketestTo upload the new version, do the following:register to pypi and test.pypiupgrade setuptools. setuptools>=38.6.0 is required to produce a distribution with the new metadatamake a source distribution. command: python setup.py sdist. in this example it will produce dist/iqdb_tagger-0.3.2.tar.gzinstall twine>=1.11.0.upload first to test.pypi. command: twine upload –repository-urlhttps://test.pypi.org/legacy/dist/iqdb_tagger-0.3.2.tar.gzif upload success but result is not as intended, change the version with postn-suffix format. fix the program and go to number 5.if upload sucsess and result is as intended:check the program version. maybe rolled it back to original if possibleupload it to pypi. command: twine upload –repository-urlhttps://upload.pypi.org/legacy/dist/iqdb_tagger-0.3.2.tar.gzthis guideline is based on this guidehttps://dustingram.com/articles/2018/03/16/markdown-descriptions-on-pypiLicenceThis project is licensed under the MIT License - see the LICENSE file for detailsAuthorsiqdb_tagger was written by softashell and maintained by Rachmadani Haryono