{"id":18789142,"url":"https://github.com/hmasdev/simple_typing_application","last_synced_at":"2026-02-26T20:09:08.917Z","repository":{"id":195673435,"uuid":"693379707","full_name":"hmasdev/simple_typing_application","owner":"hmasdev","description":"Simple Typing Application","archived":false,"fork":false,"pushed_at":"2024-04-08T12:32:03.000Z","size":211,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-12-29T14:35:00.462Z","etag":null,"topics":["llm","openai-api","typing","typing-game"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hmasdev.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-09-18T23:17:00.000Z","updated_at":"2024-02-03T01:42:25.000Z","dependencies_parsed_at":"2023-09-19T06:31:53.376Z","dependency_job_id":"d0708a95-ac81-4a2a-a4e3-da5a50035ef4","html_url":"https://github.com/hmasdev/simple_typing_application","commit_stats":null,"previous_names":["hmasdev/simple_typing_application"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmasdev%2Fsimple_typing_application","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmasdev%2Fsimple_typing_application/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmasdev%2Fsimple_typing_application/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmasdev%2Fsimple_typing_application/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmasdev","download_url":"https://codeload.github.com/hmasdev/simple_typing_application/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239709213,"owners_count":19684215,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["llm","openai-api","typing","typing-game"],"created_at":"2024-11-07T21:06:47.936Z","updated_at":"2026-02-26T20:09:08.898Z","avatar_url":"https://github.com/hmasdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# 🎯 Simple Typing Application\n\n**Measure and Improve Your Typing Performance with AI-Powered Practice**\n\n![GitHub top language](https://img.shields.io/github/languages/top/hmasdev/simple_typing_application)\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/hmasdev/simple_typing_application?sort=semver)\n![GitHub](https://img.shields.io/github/license/hmasdev/simple_typing_application)\n![GitHub last commit](https://img.shields.io/github/last-commit/hmasdev/simple_typing_application)\n\n![Scheduled Tests](https://github.com/hmasdev/simple_typing_application/actions/workflows/tests-on-schedule.yaml/badge.svg)\n\n![application image](./pics/application.png)\n\n## ✨ Features\n\n- 🤖 **AI-Powered Sentence Generation**: Use OpenAI's GPT models or HuggingFace models to generate dynamic typing targets\n- 📊 **Performance Tracking**: Detailed recording of your typing performance with timestamps and accuracy metrics\n- 🌐 **Multi-Language Support**: Full support for Japanese (Hiragana, Katakana, Kanji) and English\n- ⌨️ **Flexible Input**: Multiple correct input patterns (e.g., both 'ti' and 'chi' for 'ち')\n- 🎨 **Console Interface**: Clean, distraction-free typing practice environment\n- 📈 **Data Analysis Ready**: Export records in JSON format for detailed analysis with pandas/matplotlib\n\n## Requirements\n\n- **Python \u003e= 3.10** (Python 3.10, 3.11, 3.12, and 3.13 are supported)\n\n- **Dependencies** (automatically installed):\n  - `click`\n  - `langchain` (\u003e= 1.0)\n  - `langchain_openai`\n  - `openai`\n  - `pydantic` (\u003e= 2.0)\n  - `pynput`\n  - `python-dotenv`\n  - `requests`\n  - `sshkeyboard`\n  - `types-pynput`\n  - `types-requests`\n\n- **OpenAI API Key** (required for AI-generated typing targets)\n\nSee [`pyproject.toml`](./pyproject.toml) for detailed information.\n\n## Installation\n\n### Quick Install (Recommended)\n\nThe recommended way to install is using [uv](https://docs.astral.sh/uv/), a fast Python package installer:\n\n```bash\n# Clone the repository\ngit clone https://github.com/hmasdev/simple_typing_application.git\ncd simple_typing_application\n\n# Install with uv (recommended)\nuv sync\n```\n\nThis will install all dependencies and set up the application for use.\n\n### Alternative Installation Methods\n\n#### Using pip\n\n```bash\npip install git+https://github.com/hmasdev/simple_typing_application.git\n```\n\n#### Install with Optional Dependencies\n\nYou can specify the following optional dependencies:\n\n- **`[extra]`**: Data analysis packages (`pandas`, `matplotlib`, `jupyterlab`, `seaborn`)\n- **`[huggingface]`**: HuggingFace models support (`torch`, `transformers`, etc.)\n- **`[dev]`**: Development tools (`pytest`, `mypy`, `ruff`, etc.)\n\n**Using uv** (recommended):\n\n```bash\ngit clone https://github.com/hmasdev/simple_typing_application.git\ncd simple_typing_application\n\n# Install with specific optional dependencies\nuv sync --extra extra --extra huggingface\n```\n\n**Using pip**:\n\n```bash\ngit clone https://github.com/hmasdev/simple_typing_application.git\ncd simple_typing_application\n\n# Install with optional dependencies\npip install \".[extra,huggingface]\"\n```\n\nFor more details, see [`./pyproject.toml`](./pyproject.toml).\n\n## 🚀 Quick Start\n\n1. **Clone and install**:\n   ```bash\n   git clone https://github.com/hmasdev/simple_typing_application.git\n   cd simple_typing_application\n   uv sync\n   ```\n\n2. **Set up your OpenAI API key**:\n   ```bash\n   echo \"OPENAI_API_KEY=your-api-key-here\" \u003e .env\n   ```\n\n3. **Run the application**:\n   ```bash\n   python -m simple_typing_application\n   ```\n\n4. **Start typing!** Follow the on-screen prompts and improve your typing skills.\n\n## Usage\n\n### ⚙️ Configuration\n\nYou can specify some parameters with '.json'.\n\nFor example, the following `.json` files are valid:\n\n- [`./sample_config.json`](./sample_config.json)\n- [`./sample_config_huggingface.json`](./sample_config_huggingface.json)\n- [`./sample_config_static.json`](./sample_config_static.json)\n\nThe content of `./sample_config.json` is as follows:\n\n```json\n{\n    \"sentence_generator_type\": \"OPENAI\",\n    \"sentence_generator_config\": {\n        \"model\": \"gpt-5-nano\",\n        \"temperature\": 0.7,\n        \"openai_api_key\": \"HERE_IS_YOUR_API_KEY\",\n        \"memory_size\": 0,\n        \"max_retry\": 5\n    },\n    \"user_interface_type\": \"CONSOLE\",\n    \"user_interface_config\": {},\n    \"key_monitor_type\": \"PYNPUT\",\n    \"key_monitor_config\": {},\n    \"record_direc\": \"./record\"\n}\n```\n\nAs default, the contents of 'sample_config.json' are used except `openai_api_key`.\nIn this case, you should add an environment variable `OPENAI_API_KEY` which contains your API key or create `.env` file like\n\n```bash\nOPENAI_API_KEY={HERE_IS_YOUR_API_KEY}\n```\n\n#### 🤖 Sentence Generator\n\nYou can specify the following as `sentence_generator_type`:\n\n- **`OPENAI`**: Use OpenAI API to generate typing targets (recommended: `gpt-5-nano`, `gpt-4o`, or `gpt-4-turbo`)\n- **`HUGGINGFACE`**: Use models available on HuggingFace to generate typing targets\n- **`STATIC`**: Use predefined typing targets that you have specified\n\nFor each `sentence_generator_type`, you can specify the detailed parameters as `sentence_generator_config`:\n\n- `OPENAI`\n  - `model`: See [langchain.chat_models.openai.ChatOpenAI](#langchain.chat_models.openai.ChatOpenAI)\n  - `temperature`: See [langchain.chat_models.openai.ChatOpenAI](#langchain.chat_models.openai.ChatOpenAI)\n  - `openai_api_key`: See [langchain.chat_models.openai.ChatOpenAI](#langchain.chat_models.openai.ChatOpenAI)\n  - `memory_size`: See [langchain.memory.buffer.ConversationBufferMemory](#langchain.memory.buffer.ConversationBufferMemory)\n  - `max_retry`: Maximum number of times to rerun when an error occurs\n\n- `HUGGINGFACE`\n  - `model`: Model name. For example, \"line-corporation/japanese-large-lm-3.6b\", \"rinna/japanese-gpt-neox-3.6b\", \"rinna/bilingual-gpt-neox-4b\" and \"cyberagent/open-calm-7b\" are available as Japanese LLM. For details, See [huggingface.co/models](#huggingface_models_available_text_generation).\n  - `do_sample`: `true` or `false`. See [huggingface.co/docs/transformers/pipeline_tutorial](#huggingface_pipeline_tutorial).\n  - `max_length`: int. See [huggingface.co/docs/transformers/pipeline_tutorial](#huggingface_pipeline_tutorial).\n  - `top_k`: int. See [huggingface.co/docs/transformers/pipeline_tutorial](#huggingface_pipeline_tutorial).\n  - `top_p`: float between 0 and 1. See [huggingface.co/docs/transformers/pipeline_tutorial](#huggingface_pipeline_tutorial).\n  - `device`: `cpu` or `cuda`\n\n- `STATIC`\n  - `text_kana_map`: key-value pairs whose keys are row typing targets and values are typing targets which do not include kanjis;\n  - `is_random`: whether typing targets are randomly selected or sequentially displayed.\n\nTo see the default values, see [`./simple_typing_application/models/config_models/sentence_generator_config_model.py`](./simple_typing_application/models/config_models/sentence_generator_config_model.py).\n\n\u003e **💡 Tip**: For best results, we recommend using `gpt-5-nano` (fast and cost-effective) or `gpt-4o` (most capable) for OpenAI models.\n\n#### 🖥️ User Interface\n\nYou can specify the followings as `user_interface_type`:\n\n- `CONSOLE`: CUI\n\nFor each `user_interface_type`, you can specify the detailed parameters as `user_interface_config`:\n\n- `CONSOLE`\n  - No parameters\n\nTo see the default values, see [`./simple_typing_application/models/config_models/user_interface_config_model.py`](./simple_typing_application/models/config_models/user_interface_config_model.py).\n\n#### ⌨️ Key Monitor\n\nYou can specity the followings as `key_monitor_type`:\n\n- `PYNPUT`: `pynput`-based local key monitor\n- `SSHKEYBOARD`: `sshkeyboard`-based key monitor\n\nFor each `key_monitor_type`, you can specify the detailed parameters as `key_monitor_config`:\n\n- `PYNPUT`\n  - No parameters\n- `SSHKEYBOARD`\n  - No parameters\n\nTo see the default values, see [`./simple_typing_application/models/config_models/key_monitor_config_model.py`](./simple_typing_application/models/config_models/key_monitor_config_model.py).\n\n### 🎮 Launch the Application\n\nYou can launch this application with the following command:\n\n```bash\npython -m simple_typing_application -c HERE_IS_YOUR_CONFIG_FILE\n```\n\nIf you want to launch this application with debug mode, run the following command:\n\n```bash\npython -m simple_typing_application -c HERE_IS_YOUR_CONFIG_FILE --debug\n```\n\nFor more details, run `python -m simple_typing_application --help`.\n\n### ✍️ Typing Practice\n\n`simple_typing_application` shows typing targets through the interface which you have specified.\nType correct keys.\n\n\u003e **📝 Note**: The `Typing Target (Romaji)` displayed in your interface is one of the correct typing patterns. For example, when `Typing Target (Hiragana)` is 'ち', both 'ti' and 'chi' are correct, although only one of them is displayed.\n\n**Available keyboard shortcuts**:\n\n- `Esc` or `Ctrl+c`: Quit the application\n- `Tab`: Skip the current typing target\n\n### 📊 Analyze Your Typing Performance\n\nThe application records your typing in the following format in the directory specified in you config file for each typing target.\n\n```json\n{\n    \"timestamp\": \"HERE IS TIMESTAMP THE TYPING START WITH FORMAT %Y-%m-%dT%H:%M:%S.%f\",\n    \"typing_target\": {\n        \"text\": \"HERE IS TYPING TARGET\",\n        \"text_hiragana_alphabet_symbol\": \"HERE IS TRANSFORMED STRING WHICH CONTAINS ONLY HIRAGANA, ALPHABET AND SYMBOLS\",\n        \"typing_target\": [[\"CORRECT PATTERN. TYPICALLY ROMANIZED STRING\", ...], ...]\n    },\n    \"records\": [\n        {\n            \"timestamp\": \"HERE IS TIMESTAMP WHEN YOU TYPE %Y-%m-%dT%H:%M:%S.%f\",\n            \"pressed_key\": \"WHICH KEY YOU HAVE PRESSED\",\n            \"correct_keys\": [\"\", ...],\n            \"is_correct\": true or false\n        },\n        ...\n    ]\n}\n```\n\nRefer to [`./sample_record.json`](./sample_record.json) for an example.\n\n## 🛠️ Development\n\n1. Fork this repository:\n   - [https://github.com/hmasdev/simple_typing_application/fork](https://github.com/hmasdev/simple_typing_application/fork)\n\n2. Clone your forked repository:\n\n   ```bash\n   git clone https://github.com/hmasdev/simple_typing_application\n   cd simple_typing_application\n   ```\n\n3. Create your feature branch:\n\n   ```bash\n   git checkout -b feature/your-feature\n   ```\n\n4. Setup your development environment (uv recommended):\n\n   ```bash\n   uv sync\n   ```\n\n   If you want to include optional dependencies for development (e.g., `huggingface`, `pandas`, etc.), run:\n\n   ```bash\n   uv sync --extra huggingface --extra extra\n   ```\n\n   To know which option is available, see [`./pyproject.toml`](./pyproject.toml).\n\n5. Develop your feature and add tests.\n\n6. Test your feature:\n\n   ```bash\n   uv run pytest  # Unit test\n   uv run pytest -m integrate  # integration test\n   ```\n\n7. Check the code style and static type:\n\n   ```bash\n   uv run ruff check simple_typing_application\n   uv run ruff check tests\n   uv run mypy simple_typing_application\n   uv run mypy tests\n   ```\n\n   (Optional) Format code:\n\n   ```bash\n   uv run ruff format simple_typing_application\n   uv run ruff format tests\n   ```\n\n8. Commit your changes:\n\n   ```bash\n   git add .\n   git commit -m \"Add your feature\"\n   ```\n\n9. Push to the branch:\n\n   ```bash\n   git push -u origin feature/your-feature\n   ```\n\n10. Create a new Pull Request:\n    - [https://github.com/hmasdev/simple_typing_application/compare](https://github.com/hmasdev/simple_typing_application/compare)\n\nThank you for your contribution! 🙏\n\n## 📄 LICENSE\n\n`simple_typing_application` is licensed under the [MIT](./LICENSE) License. See the LICENSE file for more details.\n\n## 📚 References\n\n- [1] \u003ca id=\"langchain.chat_models.openai.ChatOpenAI\"\u003e\u003c/a\u003e https://api.python.langchain.com/en/latest/chat_models/langchain.chat_models.openai.ChatOpenAI.html\n- [2] \u003ca id=\"langchain.memory.buffer.ConversationBufferMemory\"\u003e\u003c/a\u003e https://api.python.langchain.com/en/latest/memory/langchain.memory.buffer.ConversationBufferMemory.html\n- [3] \u003ca id=\"huggingface_models_available_text_generation\"\u003e\u003c/a\u003e https://huggingface.co/models?pipeline_tag=text-generation\n- [4] \u003ca id=\"huggingface_pipeline_tutorial\"\u003e\u003c/a\u003e https://huggingface.co/docs/transformers/pipeline_tutorial\n\n## 👨‍💻 Authors\n\n- [hmasdev](https://github.com/hmasdev)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmasdev%2Fsimple_typing_application","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmasdev%2Fsimple_typing_application","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmasdev%2Fsimple_typing_application/lists"}