# AFKode - Speak it, Save it, AFKode it!
AFKode allows users to interact with AI and file system using only voice, allowing you to work away from keyboard.
Works on iPhone with pythonista, or on MacOS.
Powered by Whisper and ChatGPT.
This project was inspired by long walks on the beach while ruminating and organizing ones thoughts.
Users of this program should be comfortable using pythonista/python.
You are required to BYO OpenAI secret key in variable `OPENAI_KEY` using environment variables or within `afkcode/secrets.py`.
Key features:
- Detection of start/stop dictation for transcription
- Uses ChatGPT create smart file naming for your notes
Interfaces:
* At home: Supports MacOS with base speakers/microphone or AirPods. May not work with other bluetooth headsets like Bose headphones.
* Out and about: Supports Pythonista iOS with base speakers/microphones, or plugged in lightning wired heaphones. Bluetooth headsets like AirPods and Bose headphones currently not working.
## Contents
* [Instructions for users](#instructions-for-users)
* [Installation](#installation)
* [Usage documentation](#usage-documentation)
* [Bug reports](#bug-reports)
* [Instructions for developers](#instructions-for-developers)
* [Poetry](#environment-1-poetry)
* [Testing with Nox](#testing-with-nox)
* [Code formatting with Pre-commit](#code-formatting-with-pre-commit)
* [Contributors](#contributors)
## Instructions for users
The following are the quick start instructions for using the project as an end-user.
Follow the [Instructions for developers](#instructions-for-developers) to set up the virtual environment and dependency management.
### Installation
MacOS requirements:
- Python 3.8
- pyaudio
- ffmpeg for mp3 text-to-speech, `brew install ffmpeg`
```
brew install portaudio
```
Note: Instructions marked with %% are not functioning and are for demo purposes only.
Install the project using pip %%:
```bash
pip install afkode
```
To replicate the data transformations and model results, run the following commands from the project root.
These should be run from the `poetry shell`, or `conda` environment, or with the `poetry run` prefix.
```bash
python -m afkode.run
```
### Usage documentation
The user guides can be found on [github pages](https://ndjenkins85.github.io/afkode).
This includes overview of features, discussion of `afkode` framework, and API reference.
### Bug reports
Please raise an [issue](https://github.com/ndjenkins85/afkode/issues) with `bug` label and I will look into it!
## Instructions for developers
The following are the setup instructions for developers looking to improve this project.
For information on current contributors and guidelines see the [contributors](#contributors) section.
Follow each step here and ensure tests are working.
### Poetry
[Poetry](https://python-poetry.org/docs/) handles virtual environment management, dev and optional extra libraries, library development, builds and publishing.
Check the poetry website for the latest instructions on how to install poetry.
You can use the following command on OS/linux to install poetry 1.1.9 used in this project.
```bash
curl -sSL https://install.python-poetry.org | python - --version 1.1.9
```
It is recommended to set virtual environment creation to within project using the following command.
This adds a `.venv` directory to project to handle cache and virtual environment.
```bash
poetry config virtualenvs.in-project true
```
You can set up the virtual environment in the repo using the following command.
Make sure that any other virtual environments (i.e. `conda deactivate`) are deactivated before running.
```bash
poetry install
```
Troubleshooting: You may need to point poetry to the correct python interpreter using the following command.
In another terminal and in conda, run `which python`.
```bash
poetry env use /path/to/python3
```
When the environment is correctly installed, you can enter the virtual environment using `poetry shell`. Library can be built using `poetry build`.
### Testing with Nox
[Nox](https://nox.thea.codes/en/stable/index.html) is a command-line tool that automates testing in multiple Python environments, similar to tox, Makefiles or scripts. Unlike tox, Nox uses a standard Python file for configuration.
Here it is used for code quality, testing, and generating documentation.
The following command can be used to run mypy, lint, and tests.
It is recommended to run these before pushing code, as this is run with Github Actions.
Some checks such as black are run more frequently with [pre-commit](#code-formatting-with-pre-commit).
```bash
poetry run nox
```
Local Sphinx documentation can be generated with the following command.
Documentation publishing using Github Actions to Github pages is enabled by default.
```bash
poetry run nox -s docs
```
Other available commands include:
```bash
poetry run nox -rs coverage
```
### Code formatting with Pre-commit
[Pre-commit](https://pre-commit.com/) is a framework for managing and maintaining multi-language pre-commit hooks.
It intercepts the `git commit` command to run checks of staged code before the commit is finalized.
The checks are specified in `.pre-commit-config.yaml`.
Checks in use are quick, pragmatic, and apply automatic formatting checks.
If checks fail, it is usually only a matter of re-staging the files (`git add`) and attempting to commit again.
The aim is to provide a lightweight way to keep some code standards automatically in line with standards.
This does not replace the need to run nox tests, although pre-commits will satisfy some of the nox test checks.
On first time use of the repository, pre-commit will need to be installed locally.
You will need to be in the `poetry shell` or `conda` environment.
Run the following command to perform a first time install.
```bash
pre-commit install
```
This will cache several code assets used in the checks.
When you have new code to commit, pre-commit will kick in and check the code.
Alternatively, you can run the following command to run for all files in repo.
``` bash
pre-commit run --all-files
```
## Contributors
* [Nick Jenkins](https://www.ndjenkins.com) - Data Scientist, API & Web dev, Team lead, Writer
See [CONTRIBUTING.md](CONTRIBUTING.md) in Github repo for specific instructions on contributing to project.
Usage rights governed by [LICENSE](LICENSE) in Github repo or page footer.
Raw data
{
"_id": null,
"home_page": "https://www.ndjenkins.com/",
"name": "afkode",
"maintainer": "",
"docs_url": null,
"requires_python": ">=3.8.1,<3.9",
"maintainer_email": "",
"keywords": "quick_start,python_packaging,whisper,chatgpt,openai",
"author": "Nick Jenkins",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/0e/2f/ab2fcb44e5413206255bbc4c58cc9d63d290c69b1366fa7c8aa0b5330182/afkode-0.4.4.tar.gz",
"platform": null,
"description": "# AFKode - Speak it, Save it, AFKode it!\n\nAFKode allows users to interact with AI and file system using only voice, allowing you to work away from keyboard.\nWorks on iPhone with pythonista, or on MacOS.\nPowered by Whisper and ChatGPT.\n\nThis project was inspired by long walks on the beach while ruminating and organizing ones thoughts.\n\nUsers of this program should be comfortable using pythonista/python.\nYou are required to BYO OpenAI secret key in variable `OPENAI_KEY` using environment variables or within `afkcode/secrets.py`.\n\nKey features:\n\n- Detection of start/stop dictation for transcription\n- Uses ChatGPT create smart file naming for your notes\n\nInterfaces:\n\n* At home: Supports MacOS with base speakers/microphone or AirPods. May not work with other bluetooth headsets like Bose headphones.\n* Out and about: Supports Pythonista iOS with base speakers/microphones, or plugged in lightning wired heaphones. Bluetooth headsets like AirPods and Bose headphones currently not working.\n\n## Contents\n\n* [Instructions for users](#instructions-for-users)\n * [Installation](#installation)\n * [Usage documentation](#usage-documentation)\n * [Bug reports](#bug-reports)\n* [Instructions for developers](#instructions-for-developers)\n * [Poetry](#environment-1-poetry)\n * [Testing with Nox](#testing-with-nox)\n * [Code formatting with Pre-commit](#code-formatting-with-pre-commit)\n* [Contributors](#contributors)\n\n## Instructions for users\n\nThe following are the quick start instructions for using the project as an end-user.\n\nFollow the [Instructions for developers](#instructions-for-developers) to set up the virtual environment and dependency management.\n\n### Installation\n\nMacOS requirements:\n\n- Python 3.8\n- pyaudio\n- ffmpeg for mp3 text-to-speech, `brew install ffmpeg`\n\n```\nbrew install portaudio\n```\n\nNote: Instructions marked with %% are not functioning and are for demo purposes only.\n\nInstall the project using pip %%:\n\n```bash\npip install afkode\n```\n\nTo replicate the data transformations and model results, run the following commands from the project root.\nThese should be run from the `poetry shell`, or `conda` environment, or with the `poetry run` prefix.\n```bash\npython -m afkode.run\n```\n\n### Usage documentation\n\nThe user guides can be found on [github pages](https://ndjenkins85.github.io/afkode).\nThis includes overview of features, discussion of `afkode` framework, and API reference.\n\n### Bug reports\n\nPlease raise an [issue](https://github.com/ndjenkins85/afkode/issues) with `bug` label and I will look into it!\n\n## Instructions for developers\n\nThe following are the setup instructions for developers looking to improve this project.\nFor information on current contributors and guidelines see the [contributors](#contributors) section.\nFollow each step here and ensure tests are working.\n\n### Poetry\n\n[Poetry](https://python-poetry.org/docs/) handles virtual environment management, dev and optional extra libraries, library development, builds and publishing.\n\nCheck the poetry website for the latest instructions on how to install poetry.\nYou can use the following command on OS/linux to install poetry 1.1.9 used in this project.\n\n```bash\ncurl -sSL https://install.python-poetry.org | python - --version 1.1.9\n```\n\nIt is recommended to set virtual environment creation to within project using the following command.\nThis adds a `.venv` directory to project to handle cache and virtual environment.\n```bash\npoetry config virtualenvs.in-project true\n```\n\nYou can set up the virtual environment in the repo using the following command.\nMake sure that any other virtual environments (i.e. `conda deactivate`) are deactivated before running.\n\n```bash\npoetry install\n```\n\nTroubleshooting: You may need to point poetry to the correct python interpreter using the following command.\nIn another terminal and in conda, run `which python`.\n```bash\npoetry env use /path/to/python3\n```\n\nWhen the environment is correctly installed, you can enter the virtual environment using `poetry shell`. Library can be built using `poetry build`.\n\n### Testing with Nox\n\n[Nox](https://nox.thea.codes/en/stable/index.html) is a command-line tool that automates testing in multiple Python environments, similar to tox, Makefiles or scripts. Unlike tox, Nox uses a standard Python file for configuration.\n\nHere it is used for code quality, testing, and generating documentation.\n\nThe following command can be used to run mypy, lint, and tests.\nIt is recommended to run these before pushing code, as this is run with Github Actions.\nSome checks such as black are run more frequently with [pre-commit](#code-formatting-with-pre-commit).\n\n```bash\npoetry run nox\n```\n\nLocal Sphinx documentation can be generated with the following command.\nDocumentation publishing using Github Actions to Github pages is enabled by default.\n\n```bash\npoetry run nox -s docs\n```\n\nOther available commands include:\n\n```bash\npoetry run nox -rs coverage\n```\n\n### Code formatting with Pre-commit\n\n[Pre-commit](https://pre-commit.com/) is a framework for managing and maintaining multi-language pre-commit hooks.\n\nIt intercepts the `git commit` command to run checks of staged code before the commit is finalized.\nThe checks are specified in `.pre-commit-config.yaml`.\nChecks in use are quick, pragmatic, and apply automatic formatting checks.\nIf checks fail, it is usually only a matter of re-staging the files (`git add`) and attempting to commit again.\n\nThe aim is to provide a lightweight way to keep some code standards automatically in line with standards.\nThis does not replace the need to run nox tests, although pre-commits will satisfy some of the nox test checks.\n\nOn first time use of the repository, pre-commit will need to be installed locally.\nYou will need to be in the `poetry shell` or `conda` environment.\nRun the following command to perform a first time install.\n\n```bash\npre-commit install\n```\n\nThis will cache several code assets used in the checks.\n\nWhen you have new code to commit, pre-commit will kick in and check the code.\nAlternatively, you can run the following command to run for all files in repo.\n\n``` bash\npre-commit run --all-files\n```\n\n## Contributors\n\n* [Nick Jenkins](https://www.ndjenkins.com) - Data Scientist, API & Web dev, Team lead, Writer\n\nSee [CONTRIBUTING.md](CONTRIBUTING.md) in Github repo for specific instructions on contributing to project.\n\nUsage rights governed by [LICENSE](LICENSE) in Github repo or page footer.\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "Personal voice command interface for iPhone on pythonista powered by Whisper and ChatGPT.",
"version": "0.4.4",
"project_urls": {
"Documentation": "https://ndjenkins85.github.io/afkode/",
"Homepage": "https://www.ndjenkins.com/",
"Repository": "https://github.com/ndjenkins85/afkode/"
},
"split_keywords": [
"quick_start",
"python_packaging",
"whisper",
"chatgpt",
"openai"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "85841b26238267429c29778e0ae3cbcae61c5cbd0b9b62b8743179379a780f61",
"md5": "97c3a1cfc313a39118d0fff97a465574",
"sha256": "f8bb45e953f045ab868eaa31e0d219ad7791492b9260fa59e7634911c2dd4804"
},
"downloads": -1,
"filename": "afkode-0.4.4-py3-none-any.whl",
"has_sig": false,
"md5_digest": "97c3a1cfc313a39118d0fff97a465574",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.8.1,<3.9",
"size": 42957,
"upload_time": "2023-07-16T00:26:16",
"upload_time_iso_8601": "2023-07-16T00:26:16.474688Z",
"url": "https://files.pythonhosted.org/packages/85/84/1b26238267429c29778e0ae3cbcae61c5cbd0b9b62b8743179379a780f61/afkode-0.4.4-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "0e2fab2fcb44e5413206255bbc4c58cc9d63d290c69b1366fa7c8aa0b5330182",
"md5": "3bb7b51ad5dae9e62b53917fe7a40713",
"sha256": "e106efa3c9d8f6875f385985e0366ea9fe0ce265df15e701042d241cc29f641e"
},
"downloads": -1,
"filename": "afkode-0.4.4.tar.gz",
"has_sig": false,
"md5_digest": "3bb7b51ad5dae9e62b53917fe7a40713",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.8.1,<3.9",
"size": 29677,
"upload_time": "2023-07-16T00:26:17",
"upload_time_iso_8601": "2023-07-16T00:26:17.699688Z",
"url": "https://files.pythonhosted.org/packages/0e/2f/ab2fcb44e5413206255bbc4c58cc9d63d290c69b1366fa7c8aa0b5330182/afkode-0.4.4.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-07-16 00:26:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "ndjenkins85",
"github_project": "afkode",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "afkode"
}