Package: gfzs
Google Fuzzy Searchis a tool for fuzzy find for the result of searching withgoogler.⚠ WarningIf you get the following response, stop using it.
This is an error fromgoogle. Soyou can't do anything with googler. Please use it after a while.$ googler --json --count 100 python | gfzs
Error: Expecting value: line 1 column 2 (char 1)
Input data: [ERROR] Connection blocked due to unusual activity. THIS IS NOT A BUG, please do NOT report it as a bug unless you have specific information that may lead to the development of a workaround. You IP address is temporarily or permanently blocked by Google and requires reCAPTCHA-solving to use the service, which googler is not capable of. Possible causes include issuing too many queries in a short time frame, or operating from a shared / low reputation IP with a history of abuse. Please do NOT use googler for automated scraping.To avoid such problems,it is better not to setgoogler's count option.We are not responsible if you ignore the advice and block your IP. please note that.🐍 Installpipinstallgfzsorpipxinstalgfzs😎 Demoseeing is believing.You can easily try what kind of app it is.gfzsdemo🌍 Environmentpython3 (over Python 3.6.1)poetry📖 Usage$gfzs-h

usage:gfzs[-h][--version][--scoreSCORE][--log-levelLOG_LEVEL][--log-pathLOG_PATH]{init,edit,demo,valid}...

GoogleFuzzySearch.Pipethesearchresult(json)ofgoogleranduseit

optionalarguments:-h,--helpshowthishelpmessageandexit--version,-vshowprogram's version number and exit--score SCORE, -s SCOREfuzzywuzzy'sscore(default:30).pleaseseehttps://github.com/seatgeek/fuzzywuzzy--log-levelLOG_LEVEL,-lLOG_LEVELLogLevel(default:1).[0:DEBUG,1:INFO,2:WARN,3:ERROR,4:FATAL,5:UNKNOWN,6:NULL]--log-pathLOG_PATH,-pLOG_PATHLogPath(default:~/gfzs.log)SubCommands:{init,edit,demo,valid}initInitializegfzseditEditconfigdemoPlaywithDemovalidValidate~/.gfzsrcInitialize first. A configuration file (.gfzsrc) is created in your home directory.$gfzsinit
Initializeconfigin/Users/yukihirop/.gfzsrcNext, Prepare json withtitle,urlandabstractas keys and pass it.
For Example, Assuming that data.json is as follows.data.json[{"abstract":"Python is an interpreted, high-level and general-purpose programming language. Python's design philosophy emphasizes code readability with its notable use ...","matches":[{"offset":0,"phrase":"Python"},{"offset":79,"phrase":"Python's"}],"metadata":"Developer: Python Software Foundation | Designed by: Guido van Rossum | Filename extensions: .py,.pyi,.pyc,.pyd,.pyo ... | Typing discipline: Duck, dynamic, gradual (since ...","title":"Python (programming language) - Wikipedia","url":"https://en.wikipedia.org/wiki/Python_(programming_language)"},{"abstract":"プログラミング言語 Pythonの紹介・ダウンロードとインストール・Python入門講座など.","matches":[{"offset":10,"phrase":"Python"},{"offset":34,"phrase":"Python"}],"title":"プログラミング言語 Python - python.jp","url":"https://www.python.jp/"}]Pipe as standard inputcatdata.json|gfzs🚀 Practical Example (using googler)It is recommended to usealiasto avoid accidentally passing the -n (--count) option to googler.Search python articles on github.comgoogler--json--sitegithub.compython|gfzsDisplay only those with a score of 50 or more in the search resultsPlease see here forscore.googler--json--sitegithub.compython|gfzs-s50⚙ ConfigureThe default setting is the following file, and each key can enter the following values.After changing the settings, you can check if the settings are correct with thevalidcommand.$gfzsvalid
Configisvalid~/.gfzsrc{"view":{"footer":{"message":"QUERY>","color":{"message":{"text":2,"background":0,"style":"normal"},"hline":{"text":7,"background":0,"style":"normal"}}},"header":{"color":{"hline":{"text":7,"background":0,"style":"normal"}}},"search_result":{"color":{"index":{"text":6,"background":0,"style":"normal"},"title":{"text":2,"background":0,"style":"bold"},"url":{"text":3,"background":0,"style":"link"},"abstract":{"text":7,"background":0,"style":"normal"},"markup_partial":{"text":2,"background":5,"style":"normal"},"markup_char":{"text":1,"background":0,"style":"normal"}}},"paging":{"color":{"common":{"text":2,"background":0,"style":"bold"}}}}}keydescriptionvaluetextcurses color0〜7backgroundcurses color0〜7styletext style"normal", "link", "bold"curses colornumberdescription0curses.COLOR_BLACK1curses.COLOR_RED2curses.COLOR_GREEN3curses.COLOR_YELLOW4curses.COLOR_BLUE5curses.COLOR_MAGENTA6curses.COLOR_CYAN7curses.COLOR_WHITE⚙ Environment VariablenamedescriptionDEBUGYou will be able to use thedebugmodule.EDITORSet the command to open the editor.💌 LoggingBy default, logs with alog level of INFOor higher will be sent to~/gfzs.log.Log LevelvaluedescDEBUG0INFO1defaultWARN2ERROR3FATAL4UNKNOWN5NULL6🐛 DebugWhen you want to know the details of the movement or identify the cause of the error, you can change the log level toDEBUG(0)and debug with the log.$catfixtures/python.json|bin/gfzs--log-level0💪 DevelopmentFirst, create a virtual environment.$python3-mvenv.venv
$poetryshell
$poetryinstall$python3gfzs/controller.pyor$catfixtures/python.json|python3-mgfzsor$catfixtures/python.json|bin/gfzs💪 Development (Check Each View)header$python3gfzs/views/header.pysearch_result$python3gfzs/views/search_result.pypaging$python3gfzs/views/paging.pyfooter$python3gfzs/views/footer.pynot_found$python3gfzs/views/not_found.py📚 ReferenceI really referred to the implementation of the following repository.mooz/percolmingrammer/awesome-finderfrankdice/fuzzyuiNikolaiT/Scripts