├── requirements.txt ├── _assets ├── a.png ├── b.png ├── c.png ├── d.png ├── e.png └── icon.png ├── .env.example ├── main.py ├── PRIVACY.md ├── HOW_TO_GET_KEY.md ├── README.md ├── manifest.yaml ├── provider ├── bark-notify.py └── bark-notify.yaml ├── .github └── workflows │ └── package.yml ├── tools ├── send_to_bark.yaml └── send_to_bark.py ├── .gitignore ├── .difyignore └── LICENSE /requirements.txt: -------------------------------------------------------------------------------- 1 | dify_plugin~=0.1.0 2 | -------------------------------------------------------------------------------- /_assets/a.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/dify-bark-notify-plugin/master/_assets/a.png -------------------------------------------------------------------------------- /_assets/b.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/dify-bark-notify-plugin/master/_assets/b.png -------------------------------------------------------------------------------- /_assets/c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/dify-bark-notify-plugin/master/_assets/c.png -------------------------------------------------------------------------------- /_assets/d.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/dify-bark-notify-plugin/master/_assets/d.png -------------------------------------------------------------------------------- /_assets/e.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/dify-bark-notify-plugin/master/_assets/e.png -------------------------------------------------------------------------------- /_assets/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/itning/dify-bark-notify-plugin/master/_assets/icon.png -------------------------------------------------------------------------------- /.env.example: -------------------------------------------------------------------------------- 1 | INSTALL_METHOD=remote 2 | REMOTE_INSTALL_HOST=debug.dify.ai 3 | REMOTE_INSTALL_PORT=5003 4 | REMOTE_INSTALL_KEY=********-****-****-****-************ 5 | -------------------------------------------------------------------------------- /main.py: -------------------------------------------------------------------------------- 1 | from dify_plugin import Plugin, DifyPluginEnv 2 | 3 | plugin = Plugin(DifyPluginEnv(MAX_REQUEST_TIMEOUT=120)) 4 | 5 | if __name__ == '__main__': 6 | plugin.run() 7 | -------------------------------------------------------------------------------- /PRIVACY.md: -------------------------------------------------------------------------------- 1 | ## Privacy 2 | 3 | The plugin itself will not modify or store any of the data you send. 4 | 5 | For privacy information about the Bark app, please refer to: https://bark.day.app/#/en-us/privacy -------------------------------------------------------------------------------- /HOW_TO_GET_KEY.md: -------------------------------------------------------------------------------- 1 | 1. You need to download the Bark app to your phone 2 | 2. Open the Bark app and click the server button in the lower left corner 3 | 3. You can see the example, click the copy button to copy the URL 4 | 4. The URL is https://api.day.app/key/这里改成你自己的推送内容 this with your own push content, where KEY is the Bark KEY 5 | 6 | ![help](./_assets/e.png) -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Bark Notify 2 | 3 | The Bark Notify tool plugin can push your notifications to your device. 4 | 5 | Repository: https://github.com/itning/dify-bark-notify-plugin 6 | 7 | ![Hits](https://hitcount.itning.com?u=itning&r=dify-bark-notify-plugin) 8 | 9 | ## Overview 10 | 11 | ![Overview](./_assets/a.png) 12 | 13 | ## Usage 14 | 15 | Install the plugin 16 | 17 | After installation, you need to fill in the KEY and server address. 18 | 19 | ![Setup](./_assets/b.png) 20 | 21 | To be used as a tool. 22 | 23 | ![Use1](./_assets/c.png) 24 | 25 | ![Use2](./_assets/d.png) 26 | -------------------------------------------------------------------------------- /manifest.yaml: -------------------------------------------------------------------------------- 1 | version: 0.0.4 2 | type: plugin 3 | author: itning 4 | name: bark-notify 5 | label: 6 | en_US: BarkNotify 7 | zh_Hans: Bark通知 8 | description: 9 | en_US: Used to push messages to the Bark application 10 | zh_Hans: 用于推送消息到Bark应用程序中。 11 | icon: icon.png 12 | resource: 13 | memory: 268435456 14 | permission: 15 | tool: 16 | enabled: true 17 | endpoint: 18 | enabled: true 19 | app: 20 | enabled: true 21 | storage: 22 | enabled: true 23 | size: 1048576 24 | plugins: 25 | tools: 26 | - provider/bark-notify.yaml 27 | meta: 28 | version: 0.0.1 29 | arch: 30 | - amd64 31 | - arm64 32 | runner: 33 | language: python 34 | version: "3.12" 35 | entrypoint: main 36 | created_at: 2025-03-08T14:37:14.2820742+08:00 37 | privacy: PRIVACY.md 38 | verified: false 39 | -------------------------------------------------------------------------------- /provider/bark-notify.py: -------------------------------------------------------------------------------- 1 | from typing import Any 2 | 3 | from dify_plugin import ToolProvider 4 | from dify_plugin.errors.tool import ToolProviderCredentialValidationError 5 | from tools.send_to_bark import SendNotify2Bark 6 | 7 | 8 | class BarkNotifyProvider(ToolProvider): 9 | def _validate_credentials(self, credentials: dict[str, Any]) -> None: 10 | try: 11 | for resp in SendNotify2Bark.from_credentials(credentials).invoke( 12 | {"content": "test push from Dify bark-notify tool plugin"}): 13 | if resp.message.json_object.get("code", -1) != 200: 14 | raise ToolProviderCredentialValidationError(resp.message.json_object.get("message")) 15 | except ToolProviderCredentialValidationError as e: 16 | raise e 17 | except Exception as e: 18 | raise ToolProviderCredentialValidationError(str(e)) 19 | -------------------------------------------------------------------------------- /provider/bark-notify.yaml: -------------------------------------------------------------------------------- 1 | identity: 2 | author: itning 3 | name: bark-notify 4 | label: 5 | en_US: BarkNotify 6 | zh_Hans: Bark通知 7 | description: 8 | en_US: Used to push messages to the Bark application 9 | zh_Hans: 用于推送消息到Bark应用程序中 10 | icon: icon.png 11 | tools: 12 | - tools/send_to_bark.yaml 13 | extra: 14 | python: 15 | source: provider/bark-notify.py 16 | tags: 17 | - utilities 18 | credentials_for_provider: 19 | bark-key: 20 | type: secret-input 21 | required: true 22 | label: 23 | en_US: Bark KEY 24 | zh_Hans: Bark KEY 25 | description: 26 | en_US: Your Bark KEY 27 | zh_Hans: 你的Bark应用KEY 28 | url: https://github.com/itning/dify-bark-notify-plugin/blob/master/HOW_TO_GET_KEY.md 29 | server-url: 30 | type: text-input 31 | required: true 32 | default: https://api.day.app 33 | label: 34 | en_US: Server URL 35 | zh_Hans: 服务器地址 36 | placeholder: 37 | en_US: Please input your Bark server URL 38 | zh_Hans: 请输入你的Bark服务器地址 39 | default-query-params: 40 | type: text-input 41 | required: false 42 | label: 43 | en_US: Custom query parameters carried when initiating a request 44 | zh_Hans: 发起请求时携带的自定义查询参数 45 | placeholder: 46 | en_US: '?sound=minuet&call=1&isArchive=1' 47 | zh_Hans: '?sound=minuet&call=1&isArchive=1' -------------------------------------------------------------------------------- /.github/workflows/package.yml: -------------------------------------------------------------------------------- 1 | name: Package 2 | 3 | on: 4 | workflow_dispatch: 5 | 6 | jobs: 7 | build: 8 | 9 | runs-on: ubuntu-latest 10 | 11 | steps: 12 | - uses: actions/checkout@v4 13 | - name: Set up Python 3.13 14 | uses: actions/setup-python@v3 15 | with: 16 | python-version: "3.13" 17 | - name: Install dependencies 18 | run: | 19 | python -m pip install --upgrade pip 20 | pip install -r requirements.txt 21 | - name: Create a directory and move files to bark-notify 22 | run: | 23 | mkdir bark-notify 24 | find . -maxdepth 1 -not -name '.' -not -name 'bark-notify' -exec mv {} bark-notify/ \; 25 | - name: Download the diify-plugin-linux-amd64 program 26 | run: | 27 | wget https://github.com/langgenius/dify-plugin-daemon/releases/download/0.0.6/dify-plugin-linux-amd64 28 | - name: Grant executable permissions 29 | run: chmod +x dify-plugin-linux-amd64 30 | - name: run dify-plugin 31 | run: | 32 | ./dify-plugin-linux-amd64 plugin package bark-notify 33 | - name: list files 34 | run: ls -la 35 | - name: Create Release 36 | id: create_release 37 | uses: actions/create-release@v1 38 | env: 39 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 40 | with: 41 | tag_name: ${{ github.ref }} 42 | release_name: Release ${{ github.ref }} 43 | body: | 44 | - This Release Build By Github Action. 45 | - [Click Me To See Change Log File.](https://github.com/${{ github.repository }}/blob/master/CHANGELOG.md) 46 | draft: true 47 | prerelease: false 48 | - name: Upload Release Asset 49 | id: upload-release-asset 50 | uses: actions/upload-release-asset@v1 51 | env: 52 | GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} 53 | with: 54 | upload_url: ${{ steps.create_release.outputs.upload_url }} 55 | asset_path: ./bark-notify.difypkg 56 | asset_name: bark-notify.difypkg 57 | asset_content_type: application/octet-stream 58 | -------------------------------------------------------------------------------- /tools/send_to_bark.yaml: -------------------------------------------------------------------------------- 1 | identity: 2 | name: send_to_bark 3 | author: itning 4 | label: 5 | en_US: SendNotify 6 | zh_Hans: 发送通知 7 | description: 8 | human: 9 | en_US: Used to push messages to the Bark application 10 | zh_Hans: 用于推送消息到Bark应用程序中 11 | llm: Used to push messages to the Bark application 12 | parameters: 13 | - name: title 14 | type: string 15 | required: false 16 | label: 17 | en_US: Push title 18 | zh_Hans: 推送标题 19 | human_description: 20 | en_US: Title that needs to be pushed to the Bark application 21 | zh_Hans: 需要推送到Bark应用程序的标题 22 | llm_description: Title that needs to be pushed to the Bark application (not required) 23 | form: llm 24 | - name: content 25 | type: string 26 | required: true 27 | label: 28 | en_US: Push content 29 | zh_Hans: 推送内容 30 | human_description: 31 | en_US: Content that needs to be pushed to the Bark application 32 | zh_Hans: 需要推送到Bark应用程序的内容 33 | llm_description: Content that needs to be pushed to the Bark application (required) 34 | form: llm 35 | - name: query_params 36 | type: string 37 | required: false 38 | label: 39 | en_US: Custom Query Param 40 | zh_Hans: 自定义查询参数 41 | human_description: 42 | en_US: The configuration here will override the query parameters configured during authorization by KEY. For example, if the configuration during authorization is ?sound=minuet&call=1&isArchive=1, and the configuration here is ?sound=alarm, then the final effective configuration will be ?sound=alarm&call=1&isArchive=1 43 | zh_Hans: 此处配置会按KEY覆盖授权时配置的查询参数,例如授权时配置为?sound=minuet&call=1&isArchive=1,此处配置?sound=alarm,则最终生效为?sound=alarm&call=1&isArchive=1 44 | form: form 45 | - name: bark_key 46 | type: secret-input 47 | required: false 48 | label: 49 | en_US: Bark KEY 50 | zh_Hans: Bark KEY 51 | human_description: 52 | en_US: The configuration here will override the KEY set during authorization 53 | zh_Hans: 此处配置会覆盖授权时配置的KEY 54 | form: form 55 | - name: server_url 56 | type: string 57 | required: false 58 | label: 59 | en_US: Server URL 60 | zh_Hans: 服务器地址 61 | human_description: 62 | en_US: The configuration here will override the Server URL set during authorization 63 | zh_Hans: 此处配置会覆盖授权时配置的服务器地址 64 | form: form 65 | extra: 66 | python: 67 | source: tools/send_to_bark.py 68 | -------------------------------------------------------------------------------- /tools/send_to_bark.py: -------------------------------------------------------------------------------- 1 | from collections.abc import Generator 2 | from typing import Any 3 | from urllib.parse import parse_qs, urlencode, urlparse 4 | 5 | import httpx 6 | from dify_plugin import Tool 7 | from dify_plugin.entities.tool import ToolInvokeMessage 8 | 9 | 10 | def _get_http_path(server_url: str, key: str, title: str | None, content: str, query_params: str) -> str: 11 | if not title: 12 | return f"{server_url}/{key}/{content}{query_params}" 13 | return f"{server_url}/{key}/{title}/{content}{query_params}" 14 | 15 | 16 | def _merge_query_params(global_params: str, current_params: str) -> str: 17 | if not current_params or current_params.strip() == "": 18 | return global_params or "" 19 | if not global_params or global_params.strip() == "": 20 | return current_params or "" 21 | 22 | global_dict = parse_qs(urlparse(global_params).query) 23 | current_dict = parse_qs(urlparse(current_params).query) 24 | merged_dict = {**global_dict, **current_dict} 25 | merged_dict = {k: v[0] for k, v in merged_dict.items()} 26 | merged_query = urlencode(merged_dict) 27 | return f"?{merged_query}" 28 | 29 | 30 | class SendNotify2Bark(Tool): 31 | def _invoke(self, tool_parameters: dict[str, Any]) -> Generator[ToolInvokeMessage]: 32 | server_url: str = self.runtime.credentials['server-url'].rstrip('/') 33 | key = self.runtime.credentials['bark-key'] 34 | default_query_params = self.runtime.credentials.get('default-query-params', '') 35 | query_params = tool_parameters.get('query_params', '') 36 | 37 | if 'content' not in tool_parameters: 38 | raise Exception('Send Failed, because push content is missing') 39 | 40 | if query_params and not query_params.startswith('?'): 41 | raise Exception('Send Failed, because query param must start with "?"') 42 | 43 | query_params = _merge_query_params(default_query_params, query_params) 44 | 45 | runtime_key = tool_parameters.get('bark_key', '') 46 | if runtime_key != '': 47 | key = runtime_key 48 | 49 | runtime_server_url = tool_parameters.get('server_url', '') 50 | if runtime_server_url != '': 51 | server_url = runtime_server_url.rstrip('/') 52 | 53 | try: 54 | response = httpx.get( 55 | _get_http_path(server_url, key, tool_parameters.get('title'), tool_parameters['content'], query_params) 56 | ) 57 | response.raise_for_status() 58 | if response.headers["content-type"] == "application/json": 59 | yield self.create_json_message(response.json()) 60 | else: 61 | yield self.create_text_message(response.text) 62 | except httpx.RequestError as e: 63 | raise Exception(f"Send Failed, because of a network error: {e}") 64 | except httpx.HTTPStatusError as e: 65 | raise Exception(f"Send Failed, {e} Response: {e.response.text}") 66 | except Exception as e: 67 | raise Exception(f"Send Failed, {e}") 68 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | build/ 12 | develop-eggs/ 13 | dist/ 14 | downloads/ 15 | eggs/ 16 | .eggs/ 17 | lib/ 18 | lib64/ 19 | parts/ 20 | sdist/ 21 | var/ 22 | wheels/ 23 | share/python-wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | MANIFEST 28 | 29 | # PyInstaller 30 | # Usually these files are written by a python script from a template 31 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 32 | *.manifest 33 | *.spec 34 | 35 | # Installer logs 36 | pip-log.txt 37 | pip-delete-this-directory.txt 38 | 39 | # Unit test / coverage reports 40 | htmlcov/ 41 | .tox/ 42 | .nox/ 43 | .coverage 44 | .coverage.* 45 | .cache 46 | nosetests.xml 47 | coverage.xml 48 | *.cover 49 | *.py,cover 50 | .hypothesis/ 51 | .pytest_cache/ 52 | cover/ 53 | 54 | # Translations 55 | *.mo 56 | *.pot 57 | 58 | # Django stuff: 59 | *.log 60 | local_settings.py 61 | db.sqlite3 62 | db.sqlite3-journal 63 | 64 | # Flask stuff: 65 | instance/ 66 | .webassets-cache 67 | 68 | # Scrapy stuff: 69 | .scrapy 70 | 71 | # Sphinx documentation 72 | docs/_build/ 73 | 74 | # PyBuilder 75 | .pybuilder/ 76 | target/ 77 | 78 | # Jupyter Notebook 79 | .ipynb_checkpoints 80 | 81 | # IPython 82 | profile_default/ 83 | ipython_config.py 84 | 85 | # pyenv 86 | # For a library or package, you might want to ignore these files since the code is 87 | # intended to run in multiple environments; otherwise, check them in: 88 | # .python-version 89 | 90 | # pipenv 91 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 92 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 93 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 94 | # install all needed dependencies. 95 | #Pipfile.lock 96 | 97 | # UV 98 | # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. 99 | # This is especially recommended for binary packages to ensure reproducibility, and is more 100 | # commonly ignored for libraries. 101 | #uv.lock 102 | 103 | # poetry 104 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 105 | # This is especially recommended for binary packages to ensure reproducibility, and is more 106 | # commonly ignored for libraries. 107 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 108 | #poetry.lock 109 | 110 | # pdm 111 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 112 | #pdm.lock 113 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 114 | # in version control. 115 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 116 | .pdm.toml 117 | .pdm-python 118 | .pdm-build/ 119 | 120 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 121 | __pypackages__/ 122 | 123 | # Celery stuff 124 | celerybeat-schedule 125 | celerybeat.pid 126 | 127 | # SageMath parsed files 128 | *.sage.py 129 | 130 | # Environments 131 | .env 132 | .venv 133 | env/ 134 | venv/ 135 | ENV/ 136 | env.bak/ 137 | venv.bak/ 138 | 139 | # Spyder project settings 140 | .spyderproject 141 | .spyproject 142 | 143 | # Rope project settings 144 | .ropeproject 145 | 146 | # mkdocs documentation 147 | /site 148 | 149 | # mypy 150 | .mypy_cache/ 151 | .dmypy.json 152 | dmypy.json 153 | 154 | # Pyre type checker 155 | .pyre/ 156 | 157 | # pytype static type analyzer 158 | .pytype/ 159 | 160 | # Cython debug symbols 161 | cython_debug/ 162 | 163 | # PyCharm 164 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 165 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 166 | # and can be added to the global gitignore or merged into this file. For a more nuclear 167 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 168 | .idea/ 169 | 170 | # Vscode 171 | .vscode/ 172 | -------------------------------------------------------------------------------- /.difyignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # Distribution / packaging 7 | .Python 8 | build/ 9 | develop-eggs/ 10 | dist/ 11 | downloads/ 12 | eggs/ 13 | .eggs/ 14 | lib/ 15 | lib64/ 16 | parts/ 17 | sdist/ 18 | var/ 19 | wheels/ 20 | share/python-wheels/ 21 | *.egg-info/ 22 | .installed.cfg 23 | *.egg 24 | MANIFEST 25 | 26 | # PyInstaller 27 | # Usually these files are written by a python script from a template 28 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 29 | *.manifest 30 | *.spec 31 | 32 | # Installer logs 33 | pip-log.txt 34 | pip-delete-this-directory.txt 35 | 36 | # Unit test / coverage reports 37 | htmlcov/ 38 | .tox/ 39 | .nox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *.cover 46 | *.py,cover 47 | .hypothesis/ 48 | .pytest_cache/ 49 | cover/ 50 | 51 | # Translations 52 | *.mo 53 | *.pot 54 | 55 | # Django stuff: 56 | *.log 57 | local_settings.py 58 | db.sqlite3 59 | db.sqlite3-journal 60 | 61 | # Flask stuff: 62 | instance/ 63 | .webassets-cache 64 | 65 | # Scrapy stuff: 66 | .scrapy 67 | 68 | # Sphinx documentation 69 | docs/_build/ 70 | 71 | # PyBuilder 72 | .pybuilder/ 73 | target/ 74 | 75 | # Jupyter Notebook 76 | .ipynb_checkpoints 77 | 78 | # IPython 79 | profile_default/ 80 | ipython_config.py 81 | 82 | # pyenv 83 | # For a library or package, you might want to ignore these files since the code is 84 | # intended to run in multiple environments; otherwise, check them in: 85 | .python-version 86 | 87 | # pipenv 88 | # According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. 89 | # However, in case of collaboration, if having platform-specific dependencies or dependencies 90 | # having no cross-platform support, pipenv may install dependencies that don't work, or not 91 | # install all needed dependencies. 92 | Pipfile.lock 93 | 94 | # UV 95 | # Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control. 96 | # This is especially recommended for binary packages to ensure reproducibility, and is more 97 | # commonly ignored for libraries. 98 | uv.lock 99 | 100 | # poetry 101 | # Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control. 102 | # This is especially recommended for binary packages to ensure reproducibility, and is more 103 | # commonly ignored for libraries. 104 | # https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control 105 | poetry.lock 106 | 107 | # pdm 108 | # Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control. 109 | #pdm.lock 110 | # pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it 111 | # in version control. 112 | # https://pdm.fming.dev/latest/usage/project/#working-with-version-control 113 | .pdm.toml 114 | .pdm-python 115 | .pdm-build/ 116 | 117 | # PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm 118 | __pypackages__/ 119 | 120 | # Celery stuff 121 | celerybeat-schedule 122 | celerybeat.pid 123 | 124 | # SageMath parsed files 125 | *.sage.py 126 | 127 | # Environments 128 | .env 129 | .venv 130 | env/ 131 | venv/ 132 | ENV/ 133 | env.bak/ 134 | venv.bak/ 135 | 136 | # Spyder project settings 137 | .spyderproject 138 | .spyproject 139 | 140 | # Rope project settings 141 | .ropeproject 142 | 143 | # mkdocs documentation 144 | /site 145 | 146 | # mypy 147 | .mypy_cache/ 148 | .dmypy.json 149 | dmypy.json 150 | 151 | # Pyre type checker 152 | .pyre/ 153 | 154 | # pytype static type analyzer 155 | .pytype/ 156 | 157 | # Cython debug symbols 158 | cython_debug/ 159 | 160 | # PyCharm 161 | # JetBrains specific template is maintained in a separate JetBrains.gitignore that can 162 | # be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore 163 | # and can be added to the global gitignore or merged into this file. For a more nuclear 164 | # option (not recommended) you can uncomment the following to ignore the entire idea folder. 165 | .idea/ 166 | 167 | # Vscode 168 | .vscode/ 169 | 170 | # Git 171 | .git/ 172 | .gitignore 173 | 174 | # Mac 175 | .DS_Store 176 | 177 | # Windows 178 | Thumbs.db 179 | 180 | HOW_TO_GET_KEY.md 181 | _assets/e.png 182 | 183 | .github/ 184 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | --------------------------------------------------------------------------------