# -*- coding: utf-8 -*-
from setuptools import setup

packages = \
['gfzs', 'gfzs.cmd', 'gfzs.config', 'gfzs.utils', 'gfzs.views']

package_data = \
{'': ['*']}

install_requires = \
['flatten-dict>=0.3.0,<0.4.0',
 'fuzzywuzzy>=0.18.0,<0.19.0',
 'python-Levenshtein>=0.12.1,<0.13.0']

entry_points = \
{'console_scripts': ['gfzs = gfzs.cli:main']}

setup_kwargs = {
    'name': 'gfzs',
    'version': '0.2.1',
    'description': 'Google Fuzzy Search',
    'long_description': '![gfzs](https://user-images.githubusercontent.com/11146767/105204059-25556c80-5b87-11eb-862e-828a80aa6a94.png)\n\n`Google Fuzzy Search` is a tool for fuzzy find for the result of searching with [googler](https://github.com/jarun/googler).\n\n![gfzs](https://user-images.githubusercontent.com/11146767/105366627-e2f16580-5c42-11eb-92ef-8cd1aa87ce77.gif)\n\n![image](https://user-images.githubusercontent.com/11146767/105366973-47142980-5c43-11eb-89d1-9e24e6a48106.png)\n\n## ⚠ Warning\n\n![alert_tape](https://user-images.githubusercontent.com/11146767/105363618-93f60100-5c3f-11eb-8cb9-4f01ec49b486.png)\n\nIf you get the following response, stop using it.\nThis is an error from `google`. So [you can\'t do anything with googler](https://github.com/jarun/googler/issues/276#issuecomment-482754595). Please use it after a while.\n\n```\n$ googler --json --count 100 python | gfzs\nError: Expecting value: line 1 column 2 (char 1)\nInput 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.\n```\n\nTo avoid such problems, __it is better not to set `googler\'s count option`.__\n\n__We are not responsible if you ignore the advice and block your IP. please note that.__\n\n![alert_tape](https://user-images.githubusercontent.com/11146767/105363618-93f60100-5c3f-11eb-8cb9-4f01ec49b486.png)\n\n## 🐍 Install\n\n```bash\npip install gfzs\n```\n\n## 😎 Demo\n\nseeing is believing.  \nYou can easily try what kind of app it is.\n\n```bash\ngfzs demo\n```\n\n## 🌍 Environment\n\n- python3 (over Python 3.6.1)\n- poetry\n\n## 📖 Usage\n\nInitialize first. A configuration file (`.gfzsrc`) is created in your home directory.\n\n```bash\n$ gfzs init\nInitialize config in /Users/yukihirop/.gfzsrc\n```\n\nNext, Prepare json with `title`, `url` and `abstract` as keys and pass it.\nFor Example, Assuming that data.json is as follows.\n\n`data.json`\n\n<details>\n\n```json\n[\n  {\n    "abstract": "Rustは非常に高速でメモリ効率が高くランタイムやガベージコレクタがないため、パフォーマンス重視のサービスを実装できますし、組込み機器上で実行したり他の言語との調和も簡単にできます。 信頼性. Rustの豊かな型システムと所有権 ...",\n    "matches": [\n      {\n        "offset": 0,\n        "phrase": "Rust"\n      },\n      {\n        "offset": 97,\n        "phrase": "Rust"\n      }\n    ],\n    "title": "Rustプログラミング言語",\n    "url": "https://www.rust-lang.org/ja"\n  },\n  {\n    "abstract": "Rust（ラスト）はMozillaが支援するオープンソースのシステムプログラミング言語である。 Rust言語は速度、並行性、安全性を言語仕様として保証するC言語、C++に代わるシステムプログラミング（英語版）に適したプログラミング言語を ...",\n    "matches": [\n      {\n        "offset": 0,\n        "phrase": "Rust"\n      },\n      {\n        "offset": 48,\n        "phrase": "Rust"\n      }\n    ],\n    "metadata": "型付け： 静的型付け、強い型付け、型推論、構造... | 登場時期： 2010年7月7日 | ライセンス： Apache-2.0、MIT License | 影響を受けた言語： Alef、C++、C Sharp、Cyclon...",\n    "title": "Rust (プログラミング言語) - Wikipedia",\n    "url": "https://ja.wikipedia.org/wiki/Rust_(%E3%83%97%E3%83%AD%E3%82%B0%E3%83%A9%E3%83%9F%E3%83%B3%E3%82%B0%E8%A8%80%E8%AA%9E)"\n  }\n]\n```\n\n</details>\n\nPipe as standard input\n\n```bash\ncat data.json | gfzs\n```\n\n## 🚀 Practical Example (using googler)\n\n__It is recommended to use [alias](https://github.com/yukihirop/gfzs/wiki/%F0%9F%8D%96-Tips) to avoid accidentally passing the -n (--count) option to googler.__\n\n#### Search python articles on github.com\n\n```bash\ngoogler --json --site github.com python | gfzs\n```\n\n#### Display only those with a score of 50 or more in the search results\n\nPlease see here for [score](https://github.com/seatgeek/fuzzywuzzy).\n\n```bash\ngoogler --json --site github.com python | gfzs -s 50\n```\n\n## ⚙ Configure\n\nThe default setting is the following file, and each key can enter the following values.  \n\nAfter changing the settings, you can check if the settings are correct with the `valid` command. \n\n```bash\n$ gfzs valid\nConfig is valid\n```\n\n`~/.gfzsrc`\n\n```json\n{\n  "view": {\n    "footer": {\n      "message": "QUERY>",\n      "color": {\n        "message": {\n          "text": 2,\n          "background": 0,\n          "style": "normal"\n        },\n        "hline": {\n          "text": 7,\n          "background": 0,\n          "style": "normal"\n        }\n      }\n    },\n    "header": {\n      "color": {\n        "hline": {\n          "text": 7,\n          "background": 0,\n          "style": "normal"\n        }\n      }\n    },\n    "search_result": {\n      "color": {\n        "index": {\n          "text": 6,\n          "background": 0,\n          "style": "normal"\n        },\n        "title": {\n          "text": 2,\n          "background": 0,\n          "style": "bold"\n        },\n        "url": {\n          "text": 3,\n          "background": 0,\n          "style": "link"\n        },\n        "abstract": {\n          "text": 7,\n          "background": 0,\n          "style": "normal"\n        },\n        "markup_partial": {\n          "text": 2,\n          "background": 5,\n          "style": "normal"\n        },\n        "markup_char": {\n          "text": 1,\n          "background": 0,\n          "style": "normal"\n        }\n      }\n    },\n    "paging": {\n      "color": {\n        "common": {\n          "text": 2,\n          "background": 0,\n          "style": "bold"\n        }\n      }\n    }\n  }\n}\n```\n\n|key|description|value|\n|---|-----------|-----|\n|<kbd>text</kbd>|curses color|`0〜7`|\n|<kbd>background</kbd>|curses color|`0〜7`|\n|<kbd>style</kbd>|text style|`"normal", "link", "bold"`|\n\n### curses color\n\n|number|description|\n|------|-----------|\n|`0`|`curses.COLOR_BLACK`|\n|`1`|`curses.COLOR_RED`|\n|`2`|`curses.COLOR_GREEN`|\n|`3`|`curses.COLOR_YELLOW`|\n|`4`|`curses.COLOR_BLUE`|\n|`5`|`curses.COLOR_MAGENTA`|\n|`6`|`curses.COLOR_CYAN`|\n|`7`|`curses.COLOR_WHITE`|\n\n## ⚙ Environment Variable\n\n|name|description|\n|----|-----------|\n|`DEBUG`|You will be able to use the `debug` module.|\n|`EDITOR`|Set the command to open the editor.|\n\n## 💪 Development\n\nFirst, create a virtual environment.\n\n```bash\n$ python3 -m venv .venv\n$ poetry shell\n$ poetry install\n```\n\n```bash\n$ python3 gfzs/controller.py\n```\n\nor\n\n```bash\n$ cat fixtures/rust.json | python3 -m gfzs\n```\n\nor\n\n```bash\n$ cat fixtures/rust.json | bin/gfzs\n```\n\n## 💪 Development (Check Partial View)\n\n### search_result\n\n```bash\n$ python3 gfzs/views/search_result.py\n```\n\n![image](https://user-images.githubusercontent.com/11146767/104927269-8e50af00-59e4-11eb-8fcf-8b18f4db4420.png)\n\n### footer\n\n```bash\n$ python3 gfzs/views/footer.py\n```\n\n![image](https://user-images.githubusercontent.com/11146767/104927398-b93b0300-59e4-11eb-99a8-5b1e85dc000d.png)\n\n### header\n\n```bash\n$ python3 gfzs/views/header.py\n```\n\n![image](https://user-images.githubusercontent.com/11146767/104927550-ed162880-59e4-11eb-8d5c-efca84c58ea6.png)\n\n### not_found\n\n```bash\n$ python3 gfzs/views/not_found.py\n```\n\n![image](https://user-images.githubusercontent.com/11146767/104927669-0d45e780-59e5-11eb-9dc8-76baec0c04ac.png)\n\n\n### paging\n\n```bash\n$ python3 gfzs/views/paging.py\n```\n\n![image](https://user-images.githubusercontent.com/11146767/104927802-36667800-59e5-11eb-9afb-2b3386c4d8c6.png)\n\n\n## 📚 Reference\n\nI really referred to the implementation of the following repository.\n\n- [mooz/percol](https://github.com/mooz/percol)\n- [mingrammer/awesome-finder](https://github.com/mingrammer/awesome-finder)\n- [frankdice/fuzzyui](https://github.com/frankdice/fuzzyui)\n- [NikolaiT/Scripts](https://github.com/NikolaiT/Scripts/blob/master/scripts/python/curses/text_selector.py)\n',
    'author': 'yukihirop',
    'author_email': 'te108186@gmail.com',
    'maintainer': 'yukihirop',
    'maintainer_email': 'te108186@gmail.com',
    'url': 'https://github.com/yukihirop/gfzs',
    'packages': packages,
    'package_data': package_data,
    'install_requires': install_requires,
    'entry_points': entry_points,
    'python_requires': '>=3.6,<4.0',
}


setup(**setup_kwargs)
