kebbie


Namekebbie JSON
Version 0.3.1 PyPI version JSON
download
home_pagehttps://github.com/FleksySDK/kebbie
SummaryA small framework to test and compare mobile keyboards
upload_time2024-05-30 10:25:03
maintainerNone
docs_urlNone
authorNicolas REMOND
requires_python>=3.9
licenseNone
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <h1 align="center">kebbie</h1>
<p align="center">
A small framework to test and compare mobile keyboards
</p>

<p align="center">
    <a href="https://github.com/FleksySDK/kebbie/releases"><img src="https://img.shields.io/github/release/FleksySDK/kebbie.svg" alt="GitHub release" /></a>
    <a href="https://github.com/FleksySDK/kebbie/actions/workflows/pytest.yaml"><img src="https://github.com/FleksySDK/kebbie/actions/workflows/pytest.yaml/badge.svg" alt="Test status" /></a>
    <a href="https://github.com/FleksySDK/kebbie/actions/workflows/lint.yaml"><img src="https://github.com/FleksySDK/kebbie/actions/workflows/lint.yaml/badge.svg" alt="Lint status" /></a>
    <img src=".github/badges/coverage.svg" alt="Coverage status" />
    <a href="https://FleksySDK.github.io/kebbie"><img src="https://img.shields.io/website?down_message=failing&label=docs&up_color=green&up_message=passing&url=https%3A%2F%2FFleksySDK.github.io%2Fkebbie" alt="Docs" /></a>
    <a href="https://github.com/FleksySDK/kebbie/blob/main/LICENSE"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="licence" /></a>
</p>

<p align="center">
  <a href="#description">Description</a> •
  <a href="#install">Install</a> •
  <a href="#usage">Usage</a> •
  <a href="#contribute">Contribute</a>
  <br>
  <a href="https://FleksySDK.github.io/kebbie/" target="_blank">Documentation</a>
</p>

<p align="center">
    <img src="docs/assets/kebbie_logo.gif" alt="kebbie_logo" />
</p>

<h2 align="center">Description</h2>

`kebbie` is a small framework for **testing and benchmarking mobile keyboards**.  
The primary goal of this package is to establish a *cohesive* and *standardized* method for evaluating the various NLP capabilities of a mobile keyboard and comparing them to existing alternatives.

`kebbie` achieves this through the following two features :

* An easy-to-use evaluation function that facilitates the testing of multiple NLP functionalities offered by a mobile keyboard : *auto-correction*, *auto-completion*, *next-word prediction*, and *swipe gesture recognition*.
* A command-line interface for running the evaluation on established keyboards, operated within emulator.


<h2 align="center">Install</h2>

Install `kebbie` by running :


```
pip install kebbie
```

---

For development, you can install it locally by first cloning the repository :

```
git clone https://github.com/FleksySDK/kebbie.git
cd kebbie
pip install -e .
```

<h2 align="center">Usage</h2>

If you want to test how well your custom code performs, just declare your own instance of `Corrector`, and run the `evaluate()` function !

For example, here is how to test the auto-correction provided by [`pyspellchecker`](https://github.com/barrust/pyspellchecker) :

```python
import json
from typing import List

from spellchecker import SpellChecker
from kebbie import Corrector, evaluate


class ExampleCorrector(Corrector):
    def __init__(self):
        self.spellchecker = SpellChecker()

    def auto_correct(self, context: str, keystrokes, word: str) -> List[str]:
        cands = self.spellchecker.candidates(word)
        return list(cands) if cands is not None else []


if __name__ == "__main__":
    corrector = ExampleCorrector()
    results = evaluate(corrector)

    # Save the results in a local file for later inspection
    with open("results.json", "w") as f:
        json.dump(results, f, ensure_ascii=False, indent=4)
```

> [!TIP]
> Make sure to check the [full documentation](https://FleksySDK.github.io/kebbie/latest/usage/) for a detailed explanations of how to use the code !

---

If instead you want to test an existing keyboard, then you just have to start `appium`, start your emulator and install the keyboard you want to test, and finally run :

```bash
# For GBoard on Android emulator
kebbie evaluate -K gboard --all_tasks

# For iOS keyboard on iOS emulator
kebbie evaluate -K ios --all_tasks
```

> [!TIP]
> Make sure to check the [full documentation](https://FleksySDK.github.io/kebbie/latest/emulated_keyboard/) for a detailed explanations of how to setup emulators and how to use the command line !


<h2 align="center">Contribute</h2>

To contribute, install the package locally, create your own branch, add your code (and tests, and documentation), and open a PR !

### Pre-commit hooks

Pre-commit hooks are set to check the code added whenever you commit something.

> [!NOTE]
> If you never ran the hooks before, install it with :
> ```bash
> pip install -e .[hook]
> pre-commit install
> ```

Then you can just try to commit your code. If your code does not meet the quality required by linters, it will not be committed. You can just fix your code and try to commit again !

> [!TIP]
> You can manually run the pre-commit hooks with :
> ```bash
> pre-commit run --all-files
> ```

### Tests

When you contribute, you need to make sure all the unit-tests pass. You should also add tests if necessary !

> [!NOTE]
> Install the dependencies for testing with :
> ```bash
> pip install -e .[test]
> ```

You can run the tests with :

```bash
pytest
```

---

Tests are not included in the pre-commit hooks, because running the tests might be slow, and for the sake of developers we want the pre-commit hooks to be fast !

Pre-commit hooks will not run the tests, but it will automatically update the coverage badge !

### Documentation

The documentation should be kept up-to-date. You can visualize the documentation locally by running :

```bash
mkdocs serve
```

> [!NOTE]
> Before running this command, you need to install the documentation dependencies :
> ```bash
> pip install -e .[docs]
> ```



            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/FleksySDK/kebbie",
    "name": "kebbie",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Nicolas REMOND",
    "author_email": "nicolas.remond@thingthing.co",
    "download_url": "https://files.pythonhosted.org/packages/26/1e/27458ebde1fe355895e3639cf9bfbe12c2edb7b70df61e0d0fb61f29556e/kebbie-0.3.1.tar.gz",
    "platform": null,
    "description": "<h1 align=\"center\">kebbie</h1>\n<p align=\"center\">\nA small framework to test and compare mobile keyboards\n</p>\n\n<p align=\"center\">\n    <a href=\"https://github.com/FleksySDK/kebbie/releases\"><img src=\"https://img.shields.io/github/release/FleksySDK/kebbie.svg\" alt=\"GitHub release\" /></a>\n    <a href=\"https://github.com/FleksySDK/kebbie/actions/workflows/pytest.yaml\"><img src=\"https://github.com/FleksySDK/kebbie/actions/workflows/pytest.yaml/badge.svg\" alt=\"Test status\" /></a>\n    <a href=\"https://github.com/FleksySDK/kebbie/actions/workflows/lint.yaml\"><img src=\"https://github.com/FleksySDK/kebbie/actions/workflows/lint.yaml/badge.svg\" alt=\"Lint status\" /></a>\n    <img src=\".github/badges/coverage.svg\" alt=\"Coverage status\" />\n    <a href=\"https://FleksySDK.github.io/kebbie\"><img src=\"https://img.shields.io/website?down_message=failing&label=docs&up_color=green&up_message=passing&url=https%3A%2F%2FFleksySDK.github.io%2Fkebbie\" alt=\"Docs\" /></a>\n    <a href=\"https://github.com/FleksySDK/kebbie/blob/main/LICENSE\"><img src=\"https://img.shields.io/badge/License-MIT-yellow.svg\" alt=\"licence\" /></a>\n</p>\n\n<p align=\"center\">\n  <a href=\"#description\">Description</a> \u2022\n  <a href=\"#install\">Install</a> \u2022\n  <a href=\"#usage\">Usage</a> \u2022\n  <a href=\"#contribute\">Contribute</a>\n  <br>\n  <a href=\"https://FleksySDK.github.io/kebbie/\" target=\"_blank\">Documentation</a>\n</p>\n\n<p align=\"center\">\n    <img src=\"docs/assets/kebbie_logo.gif\" alt=\"kebbie_logo\" />\n</p>\n\n<h2 align=\"center\">Description</h2>\n\n`kebbie` is a small framework for **testing and benchmarking mobile keyboards**.  \nThe primary goal of this package is to establish a *cohesive* and *standardized* method for evaluating the various NLP capabilities of a mobile keyboard and comparing them to existing alternatives.\n\n`kebbie` achieves this through the following two features :\n\n* An easy-to-use evaluation function that facilitates the testing of multiple NLP functionalities offered by a mobile keyboard : *auto-correction*, *auto-completion*, *next-word prediction*, and *swipe gesture recognition*.\n* A command-line interface for running the evaluation on established keyboards, operated within emulator.\n\n\n<h2 align=\"center\">Install</h2>\n\nInstall `kebbie` by running :\n\n\n```\npip install kebbie\n```\n\n---\n\nFor development, you can install it locally by first cloning the repository :\n\n```\ngit clone https://github.com/FleksySDK/kebbie.git\ncd kebbie\npip install -e .\n```\n\n<h2 align=\"center\">Usage</h2>\n\nIf you want to test how well your custom code performs, just declare your own instance of `Corrector`, and run the `evaluate()` function !\n\nFor example, here is how to test the auto-correction provided by [`pyspellchecker`](https://github.com/barrust/pyspellchecker) :\n\n```python\nimport json\nfrom typing import List\n\nfrom spellchecker import SpellChecker\nfrom kebbie import Corrector, evaluate\n\n\nclass ExampleCorrector(Corrector):\n    def __init__(self):\n        self.spellchecker = SpellChecker()\n\n    def auto_correct(self, context: str, keystrokes, word: str) -> List[str]:\n        cands = self.spellchecker.candidates(word)\n        return list(cands) if cands is not None else []\n\n\nif __name__ == \"__main__\":\n    corrector = ExampleCorrector()\n    results = evaluate(corrector)\n\n    # Save the results in a local file for later inspection\n    with open(\"results.json\", \"w\") as f:\n        json.dump(results, f, ensure_ascii=False, indent=4)\n```\n\n> [!TIP]\n> Make sure to check the [full documentation](https://FleksySDK.github.io/kebbie/latest/usage/) for a detailed explanations of how to use the code !\n\n---\n\nIf instead you want to test an existing keyboard, then you just have to start `appium`, start your emulator and install the keyboard you want to test, and finally run :\n\n```bash\n# For GBoard on Android emulator\nkebbie evaluate -K gboard --all_tasks\n\n# For iOS keyboard on iOS emulator\nkebbie evaluate -K ios --all_tasks\n```\n\n> [!TIP]\n> Make sure to check the [full documentation](https://FleksySDK.github.io/kebbie/latest/emulated_keyboard/) for a detailed explanations of how to setup emulators and how to use the command line !\n\n\n<h2 align=\"center\">Contribute</h2>\n\nTo contribute, install the package locally, create your own branch, add your code (and tests, and documentation), and open a PR !\n\n### Pre-commit hooks\n\nPre-commit hooks are set to check the code added whenever you commit something.\n\n> [!NOTE]\n> If you never ran the hooks before, install it with :\n> ```bash\n> pip install -e .[hook]\n> pre-commit install\n> ```\n\nThen you can just try to commit your code. If your code does not meet the quality required by linters, it will not be committed. You can just fix your code and try to commit again !\n\n> [!TIP]\n> You can manually run the pre-commit hooks with :\n> ```bash\n> pre-commit run --all-files\n> ```\n\n### Tests\n\nWhen you contribute, you need to make sure all the unit-tests pass. You should also add tests if necessary !\n\n> [!NOTE]\n> Install the dependencies for testing with :\n> ```bash\n> pip install -e .[test]\n> ```\n\nYou can run the tests with :\n\n```bash\npytest\n```\n\n---\n\nTests are not included in the pre-commit hooks, because running the tests might be slow, and for the sake of developers we want the pre-commit hooks to be fast !\n\nPre-commit hooks will not run the tests, but it will automatically update the coverage badge !\n\n### Documentation\n\nThe documentation should be kept up-to-date. You can visualize the documentation locally by running :\n\n```bash\nmkdocs serve\n```\n\n> [!NOTE]\n> Before running this command, you need to install the documentation dependencies :\n> ```bash\n> pip install -e .[docs]\n> ```\n\n\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "A small framework to test and compare mobile keyboards",
    "version": "0.3.1",
    "project_urls": {
        "Homepage": "https://github.com/FleksySDK/kebbie"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "1fead5f58ba839beae79f130529a7a6b9d7123955d812b4953f3bf376bc39bac",
                "md5": "1af67c56cb326fb75bb2eae28144484f",
                "sha256": "884dd43bfe43e65b1ac675211aa491579d6ddc3c497b1e2448fd339f7a1556aa"
            },
            "downloads": -1,
            "filename": "kebbie-0.3.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1af67c56cb326fb75bb2eae28144484f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 60432,
            "upload_time": "2024-05-30T10:25:02",
            "upload_time_iso_8601": "2024-05-30T10:25:02.478950Z",
            "url": "https://files.pythonhosted.org/packages/1f/ea/d5f58ba839beae79f130529a7a6b9d7123955d812b4953f3bf376bc39bac/kebbie-0.3.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "261e27458ebde1fe355895e3639cf9bfbe12c2edb7b70df61e0d0fb61f29556e",
                "md5": "fcad4ae3ce72430bb3b3845e04608135",
                "sha256": "f5f270b3ff6f5c26079186195e99e3868b455b7b4aa6144f7ffce3e578cb4052"
            },
            "downloads": -1,
            "filename": "kebbie-0.3.1.tar.gz",
            "has_sig": false,
            "md5_digest": "fcad4ae3ce72430bb3b3845e04608135",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 43066,
            "upload_time": "2024-05-30T10:25:03",
            "upload_time_iso_8601": "2024-05-30T10:25:03.951470Z",
            "url": "https://files.pythonhosted.org/packages/26/1e/27458ebde1fe355895e3639cf9bfbe12c2edb7b70df61e0d0fb61f29556e/kebbie-0.3.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-30 10:25:03",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "FleksySDK",
    "github_project": "kebbie",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "kebbie"
}
        
Elapsed time: 0.23882s