jarvis-ui


Namejarvis-ui JSON
Version 2.3.1 PyPI version JSON
download
home_pageNone
SummaryJarvis UI to perform voice commands via API calls
upload_time2024-05-27 03:52:36
maintainerNone
docs_urlNone
authorNone
requires_python<3.12,>=3.10
licenseMIT License Copyright (c) 2020 Vignesh Rao Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
keywords python natural-language-processing text-to-speech speech-recognition jarvis hotword-detection virtual-assistant multiprocessing threadpool
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            ![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)

**Deployments**

[![pages-build-deployment](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/pages/pages-build-deployment)

[![pypi](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/python-publish.yml/badge.svg)](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/python-publish.yml)

# Jarvis UI

Connects to [`Jarvis`](https://github.com/thevickypedia/Jarvis/blob/master/jarvis/api/fast.py) running in the backend to process request and response via API calls.

### Kick off
**Install**
```shell
python -m pip install jarvis-ui
```

**Initiate**
```python
import jarvis_ui


if __name__ == '__main__':
    jarvis_ui.start()
```

### Environment Variables
Env vars are loaded from a `.env` file and validated using `pydantic`
<details>
<summary><strong><i>To use custom .env files</i></strong></summary>

To use a custom `.env` file, set the filename to the env var `env_file` before importing `jarvis_ui` module.

```python
import os
os.environ['env_file'] = "jarvis_ui.env"

import jarvis_ui

if __name__ == '__main__':
    jarvis_ui.start()
```

</details>

#### Mandatory
- **SERVER_URL**: Endpoint URL to which the API call has to be made. Can be `localhost` or a `tunneled` URL behind a reverse proxy/CDN.
- **TOKEN**: Authentication token.

#### Optional
- **HEART_BEAT**: Defaults to `None` - _Interval in seconds to trigger background healthcheck on the server with automatic restart_
- **DEBUG**: Defaults to `False` - _Enable debug level logging_
<br><br>
- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `10` for Windows - _Timeout for speech synthesis_
<br><br>
- **NATIVE_AUDIO**: Defaults to `False` - _If set to `True`, the response is generated in the server's default voice_
- **WAKE_WORDS**: Defaults to `jarvis` (Defaults to `alexa` in macOS older than `10.14`) - _Wake words to initiate Jarvis_
- **SENSITIVITY**: Defaults to `0.5` - _Sensitivity of wake word detection_
<br><br>
- **MICROPHONE_INDEX**: Defaults to `None` - _Use [peripherals.py](https://github.com/thevickypedia/Jarvis_UI/blob/main/modules/peripherals.py) to get the index values_
- **VOICE_NAME**: Defaults to the author's favorite per the OS. _Name of the voice supported by the OperatingSystem_
- **VOICE_RATE**: Defaults to the value in `py3-tts` module - _Speed/rate at which the text should be spoken_
- **VOICE_PITCH**: Defaults to the value in `py3-tts` module - _Currently available only for Linux OS_
<br><br>
- **LISTENER_TIMEOUT**: Defaults to `2` - _Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit_
- **LISTENER_PHRASE_LIMIT**: Defaults to `5` - _Timeout for phrase once listener is activated - Listener will be deactivated after this limit_
- **RECOGNIZER_SETTINGS**: JSON object of customized speech recognition settings.

<details>
<summary><strong>Custom settings for speech recognition</strong></summary>

The default values for **RECOGNIZER_SETTINGS** are customized according to the author's voice pitch.
Please use [test_listener.py](https://github.com/thevickypedia/Jarvis_UI/blob/main/test_listener.py) to figure out the suitable values in a trial and error method.

Sample settings (formatted as JSON object)<br>

**RECOGNIZER_SETTINGS**: `'{"energy_threshold": 1100, "dynamic_energy_threshold": false, "pause_threshold": 1, "phrase_threshold": 0.1}'`

**Description**
- **energy_threshold**: Minimum audio energy to consider for recording. Greater the value, louder the voice should be.
- **dynamic_energy_threshold**: Change considerable audio **energy_threshold** dynamically.
- **pause_threshold**: Seconds of non-speaking audio before a phrase is considered complete.
- **phrase_threshold**: Minimum seconds of speaking audio before it can be considered a phrase - values below this are ignored. This helps to filter out clicks and pops.
- **non_speaking_duration**: Seconds of non-speaking audio to keep on both sides of the recording.

</details>

---

:bulb: &nbsp; **Refer Jarvis' [README](https://github.com/thevickypedia/Jarvis/blob/master/README.md) for more information on setting up the backend server.**

### Coding Standards
Docstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>
Styling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>
Clean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/) and
[`isort`](https://pycqa.github.io/isort/)

### [Release Notes](https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst)
**Requirement**
```shell
python -m pip install gitverse
```

**Usage**
```shell
gitverse-release reverse -f release_notes.rst -t 'Release Notes'
```

### Linting
`PreCommit` will ensure linting, and the doc creation are run on every commit.

**Requirement**
<br>
```bash
python -m pip install sphinx==5.1.1 pre-commit recommonmark
```

**Usage**
<br>
```bash
pre-commit run --all-files
```

### Pypi Package
[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)

[https://pypi.org/project/jarvis-ui/](https://pypi.org/project/jarvis-ui/)

### Runbook
[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)

[https://thevickypedia.github.io/Jarvis_UI/](https://thevickypedia.github.io/Jarvis_UI/)

### License & copyright

&copy; Vignesh Rao

Licensed under the [MIT License](https://github.com/thevickypedia/Jarvis_UI/blob/main/LICENSE)

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "jarvis-ui",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<3.12,>=3.10",
    "maintainer_email": null,
    "keywords": "python, natural-language-processing, text-to-speech, speech-recognition, jarvis, hotword-detection, virtual-assistant, multiprocessing, threadpool",
    "author": null,
    "author_email": "Vignesh Rao <svignesh1793@gmail.com>",
    "download_url": null,
    "platform": null,
    "description": "![Python](https://img.shields.io/badge/python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue)\n\n**Deployments**\n\n[![pages-build-deployment](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/pages/pages-build-deployment/badge.svg)](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/pages/pages-build-deployment)\n\n[![pypi](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/python-publish.yml/badge.svg)](https://github.com/thevickypedia/Jarvis_UI/actions/workflows/python-publish.yml)\n\n# Jarvis UI\n\nConnects to [`Jarvis`](https://github.com/thevickypedia/Jarvis/blob/master/jarvis/api/fast.py) running in the backend to process request and response via API calls.\n\n### Kick off\n**Install**\n```shell\npython -m pip install jarvis-ui\n```\n\n**Initiate**\n```python\nimport jarvis_ui\n\n\nif __name__ == '__main__':\n    jarvis_ui.start()\n```\n\n### Environment Variables\nEnv vars are loaded from a `.env` file and validated using `pydantic`\n<details>\n<summary><strong><i>To use custom .env files</i></strong></summary>\n\nTo use a custom `.env` file, set the filename to the env var `env_file` before importing `jarvis_ui` module.\n\n```python\nimport os\nos.environ['env_file'] = \"jarvis_ui.env\"\n\nimport jarvis_ui\n\nif __name__ == '__main__':\n    jarvis_ui.start()\n```\n\n</details>\n\n#### Mandatory\n- **SERVER_URL**: Endpoint URL to which the API call has to be made. Can be `localhost` or a `tunneled` URL behind a reverse proxy/CDN.\n- **TOKEN**: Authentication token.\n\n#### Optional\n- **HEART_BEAT**: Defaults to `None` - _Interval in seconds to trigger background healthcheck on the server with automatic restart_\n- **DEBUG**: Defaults to `False` - _Enable debug level logging_\n<br><br>\n- **SPEECH_TIMEOUT**: Defaults to `0` for macOS, `10` for Windows - _Timeout for speech synthesis_\n<br><br>\n- **NATIVE_AUDIO**: Defaults to `False` - _If set to `True`, the response is generated in the server's default voice_\n- **WAKE_WORDS**: Defaults to `jarvis` (Defaults to `alexa` in macOS older than `10.14`) - _Wake words to initiate Jarvis_\n- **SENSITIVITY**: Defaults to `0.5` - _Sensitivity of wake word detection_\n<br><br>\n- **MICROPHONE_INDEX**: Defaults to `None` - _Use [peripherals.py](https://github.com/thevickypedia/Jarvis_UI/blob/main/modules/peripherals.py) to get the index values_\n- **VOICE_NAME**: Defaults to the author's favorite per the OS. _Name of the voice supported by the OperatingSystem_\n- **VOICE_RATE**: Defaults to the value in `py3-tts` module - _Speed/rate at which the text should be spoken_\n- **VOICE_PITCH**: Defaults to the value in `py3-tts` module - _Currently available only for Linux OS_\n<br><br>\n- **LISTENER_TIMEOUT**: Defaults to `2` - _Timeout for listener once wake word is detected - Awaits for a speech to begin until this limit_\n- **LISTENER_PHRASE_LIMIT**: Defaults to `5` - _Timeout for phrase once listener is activated - Listener will be deactivated after this limit_\n- **RECOGNIZER_SETTINGS**: JSON object of customized speech recognition settings.\n\n<details>\n<summary><strong>Custom settings for speech recognition</strong></summary>\n\nThe default values for **RECOGNIZER_SETTINGS** are customized according to the author's voice pitch.\nPlease use [test_listener.py](https://github.com/thevickypedia/Jarvis_UI/blob/main/test_listener.py) to figure out the suitable values in a trial and error method.\n\nSample settings (formatted as JSON object)<br>\n\n**RECOGNIZER_SETTINGS**: `'{\"energy_threshold\": 1100, \"dynamic_energy_threshold\": false, \"pause_threshold\": 1, \"phrase_threshold\": 0.1}'`\n\n**Description**\n- **energy_threshold**: Minimum audio energy to consider for recording. Greater the value, louder the voice should be.\n- **dynamic_energy_threshold**: Change considerable audio **energy_threshold** dynamically.\n- **pause_threshold**: Seconds of non-speaking audio before a phrase is considered complete.\n- **phrase_threshold**: Minimum seconds of speaking audio before it can be considered a phrase - values below this are ignored. This helps to filter out clicks and pops.\n- **non_speaking_duration**: Seconds of non-speaking audio to keep on both sides of the recording.\n\n</details>\n\n---\n\n:bulb: &nbsp; **Refer Jarvis' [README](https://github.com/thevickypedia/Jarvis/blob/master/README.md) for more information on setting up the backend server.**\n\n### Coding Standards\nDocstring format: [`Google`](https://google.github.io/styleguide/pyguide.html#38-comments-and-docstrings) <br>\nStyling conventions: [`PEP 8`](https://www.python.org/dev/peps/pep-0008/) <br>\nClean code with pre-commit hooks: [`flake8`](https://flake8.pycqa.org/en/latest/) and\n[`isort`](https://pycqa.github.io/isort/)\n\n### [Release Notes](https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst)\n**Requirement**\n```shell\npython -m pip install gitverse\n```\n\n**Usage**\n```shell\ngitverse-release reverse -f release_notes.rst -t 'Release Notes'\n```\n\n### Linting\n`PreCommit` will ensure linting, and the doc creation are run on every commit.\n\n**Requirement**\n<br>\n```bash\npython -m pip install sphinx==5.1.1 pre-commit recommonmark\n```\n\n**Usage**\n<br>\n```bash\npre-commit run --all-files\n```\n\n### Pypi Package\n[![pypi-module](https://img.shields.io/badge/Software%20Repository-pypi-1f425f.svg)](https://packaging.python.org/tutorials/packaging-projects/)\n\n[https://pypi.org/project/jarvis-ui/](https://pypi.org/project/jarvis-ui/)\n\n### Runbook\n[![made-with-sphinx-doc](https://img.shields.io/badge/Code%20Docs-Sphinx-1f425f.svg)](https://www.sphinx-doc.org/en/master/man/sphinx-autogen.html)\n\n[https://thevickypedia.github.io/Jarvis_UI/](https://thevickypedia.github.io/Jarvis_UI/)\n\n### License & copyright\n\n&copy; Vignesh Rao\n\nLicensed under the [MIT License](https://github.com/thevickypedia/Jarvis_UI/blob/main/LICENSE)\n",
    "bugtrack_url": null,
    "license": "MIT License  Copyright (c) 2020 Vignesh Rao  Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:  The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.  THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ",
    "summary": "Jarvis UI to perform voice commands via API calls",
    "version": "2.3.1",
    "project_urls": {
        "Bug Tracker": "https://github.com/thevickypedia/Jarvis_UI/issues",
        "Docs": "https://thevickypedia.github.io/Jarvis_UI",
        "Homepage": "https://github.com/thevickypedia/Jarvis_UI",
        "Release Notes": "https://github.com/thevickypedia/Jarvis_UI/blob/main/release_notes.rst",
        "Source": "https://github.com/thevickypedia/Jarvis_UI"
    },
    "split_keywords": [
        "python",
        " natural-language-processing",
        " text-to-speech",
        " speech-recognition",
        " jarvis",
        " hotword-detection",
        " virtual-assistant",
        " multiprocessing",
        " threadpool"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "f6091b0280c1061b143b30171a8744cefd3b119962426b0bb31c2b9704d83b39",
                "md5": "9648caf5d5b648fc15e15e032d9821ab",
                "sha256": "d52cba073e428d7749c6caca7d06a2b10138c3a2eada15f97ce74e7036caaa94"
            },
            "downloads": -1,
            "filename": "jarvis_ui-2.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "9648caf5d5b648fc15e15e032d9821ab",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<3.12,>=3.10",
            "size": 1084704,
            "upload_time": "2024-05-27T03:52:36",
            "upload_time_iso_8601": "2024-05-27T03:52:36.294320Z",
            "url": "https://files.pythonhosted.org/packages/f6/09/1b0280c1061b143b30171a8744cefd3b119962426b0bb31c2b9704d83b39/jarvis_ui-2.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-27 03:52:36",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "thevickypedia",
    "github_project": "Jarvis_UI",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jarvis-ui"
}
        
Elapsed time: 3.69988s