Package: afkode
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 variableOPENAI_KEYusing environment variables or withinafkcode/secrets.py.Key features:Detection of start/stop dictation for transcriptionUses ChatGPT create smart file naming for your notesInterfaces: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.ContentsInstructions for usersInstallationUsage documentationBug reportsInstructions for developersPoetryTesting with NoxCode formatting with Pre-commitContributorsInstructions for usersThe following are the quick start instructions for using the project as an end-user.Follow theInstructions for developersto set up the virtual environment and dependency management.InstallationMacOS requirements:Python 3.8pyaudioffmpeg for mp3 text-to-speech,brew install ffmpegbrew install portaudioNote: Instructions marked with %% are not functioning and are for demo purposes only.Install the project using pip %%:pipinstallafkodeTo replicate the data transformations and model results, run the following commands from the project root.
These should be run from thepoetry shell, orcondaenvironment, or with thepoetry runprefix.python-mafkode.runUsage documentationThe user guides can be found ongithub pages.
This includes overview of features, discussion ofafkodeframework, and API reference.Bug reportsPlease raise anissuewithbuglabel and I will look into it!Instructions for developersThe following are the setup instructions for developers looking to improve this project.
For information on current contributors and guidelines see thecontributorssection.
Follow each step here and ensure tests are working.PoetryPoetryhandles 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.curl-sSLhttps://install.python-poetry.org|python---version1.1.9It is recommended to set virtual environment creation to within project using the following command.
This adds a.venvdirectory to project to handle cache and virtual environment.poetryconfigvirtualenvs.in-projecttrueYou 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.poetryinstallTroubleshooting: You may need to point poetry to the correct python interpreter using the following command.
In another terminal and in conda, runwhich python.poetryenvuse/path/to/python3When the environment is correctly installed, you can enter the virtual environment usingpoetry shell. Library can be built usingpoetry build.Testing with NoxNoxis 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 withpre-commit.poetryrunnoxLocal Sphinx documentation can be generated with the following command.
Documentation publishing using Github Actions to Github pages is enabled by default.poetryrunnox-sdocsOther available commands include:poetryrunnox-rscoverageCode formatting with Pre-commitPre-commitis a framework for managing and maintaining multi-language pre-commit hooks.It intercepts thegit commitcommand 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 thepoetry shellorcondaenvironment.
Run the following command to perform a first time install.pre-commitinstallThis 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.pre-commitrun--all-filesContributorsNick Jenkins- Data Scientist, API & Web dev, Team lead, WriterSeeCONTRIBUTING.mdin Github repo for specific instructions on contributing to project.Usage rights governed byLICENSEin Github repo or page footer.