eyeTestUtils


NameeyeTestUtils JSON
Version 0.1.1 PyPI version JSON
download
home_pageNone
SummaryEye prescription validation and conversion tools for eyeglasses and contact lenses.
upload_time2025-11-02 17:47:49
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseMIT
keywords eye optometry contact-lens validation python
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # ๐Ÿ‘๏ธ EyeTestUtils โ€” Eye Test & Contact Lens Utilities

**EyeTestUtils** is a Python library that helps you validate, convert, and format eye test and contact lens data easily.  
Itโ€™s designed for developers building optical systems, clinics, or vision-related applications.

---

## ๐Ÿš€ Features
- โœ… Validate eye test values (SPH, CYL, AXIS, PD, ADD)
- ๐Ÿ”„ Convert prescription data to contact lens parameters (Spheric / Toric)
- ๐Ÿงฎ Calculate and validate vertex distance
- ๐Ÿง  Normalize numeric formats (ยฑ00.00)
- โš™๏ธ Ready to integrate with Django, FastAPI, or desktop apps

---

## ๐Ÿ“ฆ Installation

From PyPI:
```bash
pip install eyeTestUtils
```

From source:
```bash
pip install -e .
```

## ๐Ÿงฐ Basic Usage
### 1๏ธโƒฃ Validate eye test values
```python
    from eyetools import EyeTestValidator

    validator = EyeTestValidator()

    print(validator.is_multiple_of_quarter(1.25))  # โœ… True
    print(validator.is_multiple_of_quarter(1.33))  # โŒ False

    # Axis validation
    print(validator.check_axis(180))  # โœ… True
    print(validator.check_axis(-1))    # โŒ False
    print(validator.check_axis(190))    # โŒ False

    # Add validation
    print(validator.check_add(2.25))  # โœ… True
    print(validator.check_add(-2.25))  # โŒ False
```

### 2๏ธโƒฃ Convert to contact lens values
```python
    from eyetools import ContactLensValidator

    validator = ContactLensValidator()
    data = {
    "SPH": "3.00",
    "CY": "-1.25",
    "AX": "90",
    "BV": "12", # optional
    "ADD": "0.00" # optional
    }

    toric_lens = validator.convert_to_toric(data)
    print(toric_lens)
    # Expected output:
    # {
    #   "Exact SPH": "+03.11",
    #   "Exact CY": "-1.32",
    #   "SPH": "+03.00",
    #   "CY": "-1.25",
    #   "AX": "090",
    #   "BV": "12",
    #   "ADD": "0.00" 
    # }
    
    spheric_lens = validator.convert_to_spheric(data)
    print(spheric_lens)
    # Expected output:
    # {
    #   "Exact SPH": "+02.38",
    #   "SPH": "+02.50",
    #   "BV": "12",
    #   "ADD": "0.00" 
    # }
```

### Format powers
```python
    from eyetools import EyeTestValidator

    validator = EyeTestValidator()

    print(validator.is_valida_eye_test_power(-1.25))   # "-01.25"
    print(validator.remove_sign("-2.50"))              # "2.50"
```

### Vertex distance check
```python
    from eyetools import EyeTestValidator

    validator = EyeTestValidator()

    print(validator.Check_vertex_distance(12))  # โœ… True
    print(validator.Check_vertex_distance(20))  # โŒ False
```

## ๐Ÿงช Testing
Run all tests using pytest:
```bash
pytest -v
```



eyetools/
โ”œโ”€โ”€ eyetools/
โ”‚   โ”œโ”€โ”€ __init__.py
โ”‚   โ””โ”€โ”€ validators.py
โ”œโ”€โ”€ tests/
โ”‚   โ”œโ”€โ”€ test_eye_validator.py
โ”‚   โ””โ”€โ”€ test_contact_validator.py
โ”œโ”€โ”€ LICENSE  
โ”œโ”€โ”€ pyproject.toml
โ””โ”€โ”€ README.md




## ๐Ÿ’ก Contributing

We welcome contributions! If you have suggestions for improving validation rules, finding bugs, or adding new features, please open an issue or submit a Pull Request.

**GitHub Repository:** [https://github.com/Elhussin/eye-test-utils-python.git](https://github.com/Elhussin/eye-test-utils-python.git)

## ๐Ÿ‘จโ€๐Ÿ’ป Author

Elhussini Taha
Optical systems & Web developer ๐Ÿ’ก

[GitHub](https://github.com/Elhussin)

[LinkedIn](https://linkedin.com/in/elhusseini2023)


## ๐Ÿ’ฌ Support & Contact

If you have any questions, need technical support, or want to discuss features, feel free to reach out:

* **Email:** [hasin3112@gmail.com](mailto:hasin3112@gmail.com)
* **GitHub Issues:** [Open an Issue here](https://github.com/Elhussin/eye-test-utils-python/issues) (The preferred way to report bugs)

## ๐Ÿ“œ License
This project is licensed under the **MIT License**.


            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "eyeTestUtils",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "eye, optometry, contact-lens, validation, python",
    "author": null,
    "author_email": "Elhusseini Taha <hasin3112@gmail.com>",
    "download_url": "https://files.pythonhosted.org/packages/51/e0/f4db9d89f8e555addad3f5124a11594197e37803e8f79626907758eaaa33/eyetestutils-0.1.1.tar.gz",
    "platform": null,
    "description": "# \ud83d\udc41\ufe0f EyeTestUtils \u2014 Eye Test & Contact Lens Utilities\n\n**EyeTestUtils** is a Python library that helps you validate, convert, and format eye test and contact lens data easily.  \nIt\u2019s designed for developers building optical systems, clinics, or vision-related applications.\n\n---\n\n## \ud83d\ude80 Features\n- \u2705 Validate eye test values (SPH, CYL, AXIS, PD, ADD)\n- \ud83d\udd04 Convert prescription data to contact lens parameters (Spheric / Toric)\n- \ud83e\uddee Calculate and validate vertex distance\n- \ud83e\udde0 Normalize numeric formats (\u00b100.00)\n- \u2699\ufe0f Ready to integrate with Django, FastAPI, or desktop apps\n\n---\n\n## \ud83d\udce6 Installation\n\nFrom PyPI:\n```bash\npip install eyeTestUtils\n```\n\nFrom source:\n```bash\npip install -e .\n```\n\n## \ud83e\uddf0 Basic Usage\n### 1\ufe0f\u20e3 Validate eye test values\n```python\n    from eyetools import EyeTestValidator\n\n    validator = EyeTestValidator()\n\n    print(validator.is_multiple_of_quarter(1.25))  # \u2705 True\n    print(validator.is_multiple_of_quarter(1.33))  # \u274c False\n\n    # Axis validation\n    print(validator.check_axis(180))  # \u2705 True\n    print(validator.check_axis(-1))    # \u274c False\n    print(validator.check_axis(190))    # \u274c False\n\n    # Add validation\n    print(validator.check_add(2.25))  # \u2705 True\n    print(validator.check_add(-2.25))  # \u274c False\n```\n\n### 2\ufe0f\u20e3 Convert to contact lens values\n```python\n    from eyetools import ContactLensValidator\n\n    validator = ContactLensValidator()\n    data = {\n    \"SPH\": \"3.00\",\n    \"CY\": \"-1.25\",\n    \"AX\": \"90\",\n    \"BV\": \"12\", # optional\n    \"ADD\": \"0.00\" # optional\n    }\n\n    toric_lens = validator.convert_to_toric(data)\n    print(toric_lens)\n    # Expected output:\n    # {\n    #   \"Exact SPH\": \"+03.11\",\n    #   \"Exact CY\": \"-1.32\",\n    #   \"SPH\": \"+03.00\",\n    #   \"CY\": \"-1.25\",\n    #   \"AX\": \"090\",\n    #   \"BV\": \"12\",\n    #   \"ADD\": \"0.00\" \n    # }\n    \n    spheric_lens = validator.convert_to_spheric(data)\n    print(spheric_lens)\n    # Expected output:\n    # {\n    #   \"Exact SPH\": \"+02.38\",\n    #   \"SPH\": \"+02.50\",\n    #   \"BV\": \"12\",\n    #   \"ADD\": \"0.00\" \n    # }\n```\n\n### Format powers\n```python\n    from eyetools import EyeTestValidator\n\n    validator = EyeTestValidator()\n\n    print(validator.is_valida_eye_test_power(-1.25))   # \"-01.25\"\n    print(validator.remove_sign(\"-2.50\"))              # \"2.50\"\n```\n\n### Vertex distance check\n```python\n    from eyetools import EyeTestValidator\n\n    validator = EyeTestValidator()\n\n    print(validator.Check_vertex_distance(12))  # \u2705 True\n    print(validator.Check_vertex_distance(20))  # \u274c False\n```\n\n## \ud83e\uddea Testing\nRun all tests using pytest:\n```bash\npytest -v\n```\n\n\n\neyetools/\n\u251c\u2500\u2500 eyetools/\n\u2502   \u251c\u2500\u2500 __init__.py\n\u2502   \u2514\u2500\u2500 validators.py\n\u251c\u2500\u2500 tests/\n\u2502   \u251c\u2500\u2500 test_eye_validator.py\n\u2502   \u2514\u2500\u2500 test_contact_validator.py\n\u251c\u2500\u2500 LICENSE  \n\u251c\u2500\u2500 pyproject.toml\n\u2514\u2500\u2500 README.md\n\n\n\n\n## \ud83d\udca1 Contributing\n\nWe welcome contributions! If you have suggestions for improving validation rules, finding bugs, or adding new features, please open an issue or submit a Pull Request.\n\n**GitHub Repository:** [https://github.com/Elhussin/eye-test-utils-python.git](https://github.com/Elhussin/eye-test-utils-python.git)\n\n## \ud83d\udc68\u200d\ud83d\udcbb Author\n\nElhussini Taha\nOptical systems & Web developer \ud83d\udca1\n\n[GitHub](https://github.com/Elhussin)\n\n[LinkedIn](https://linkedin.com/in/elhusseini2023)\n\n\n## \ud83d\udcac Support & Contact\n\nIf you have any questions, need technical support, or want to discuss features, feel free to reach out:\n\n* **Email:** [hasin3112@gmail.com](mailto:hasin3112@gmail.com)\n* **GitHub Issues:** [Open an Issue here](https://github.com/Elhussin/eye-test-utils-python/issues) (The preferred way to report bugs)\n\n## \ud83d\udcdc License\nThis project is licensed under the **MIT License**.\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Eye prescription validation and conversion tools for eyeglasses and contact lenses.",
    "version": "0.1.1",
    "project_urls": {
        "Homepage": "https://github.com/Elhussin/eye-test-utils-python",
        "Issues": "https://github.com/Elhussin/eye-test-utils-python/issues"
    },
    "split_keywords": [
        "eye",
        " optometry",
        " contact-lens",
        " validation",
        " python"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "fac4980a3e83f1000d9b7ef155810173f1afef7aef0e44d98aeb18ca1c6ce69e",
                "md5": "c03a913188d0d0f7435f128dca5f42eb",
                "sha256": "a4d0b9d8b41425bc2b0d222e161b23dd38e5f5555b76eab6517c37c5a51fc4a1"
            },
            "downloads": -1,
            "filename": "eyetestutils-0.1.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "c03a913188d0d0f7435f128dca5f42eb",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 7180,
            "upload_time": "2025-11-02T17:47:48",
            "upload_time_iso_8601": "2025-11-02T17:47:48.211367Z",
            "url": "https://files.pythonhosted.org/packages/fa/c4/980a3e83f1000d9b7ef155810173f1afef7aef0e44d98aeb18ca1c6ce69e/eyetestutils-0.1.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "51e0f4db9d89f8e555addad3f5124a11594197e37803e8f79626907758eaaa33",
                "md5": "69fd56ae265ca6e6edb3da08ee1e9b67",
                "sha256": "f98e0d0292a41df8f166ccfc6c061cfef6f5c9c0deb075a0a03d0b408acd7e68"
            },
            "downloads": -1,
            "filename": "eyetestutils-0.1.1.tar.gz",
            "has_sig": false,
            "md5_digest": "69fd56ae265ca6e6edb3da08ee1e9b67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 7456,
            "upload_time": "2025-11-02T17:47:49",
            "upload_time_iso_8601": "2025-11-02T17:47:49.786598Z",
            "url": "https://files.pythonhosted.org/packages/51/e0/f4db9d89f8e555addad3f5124a11594197e37803e8f79626907758eaaa33/eyetestutils-0.1.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-11-02 17:47:49",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "Elhussin",
    "github_project": "eye-test-utils-python",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "eyetestutils"
}
        
Elapsed time: 2.65239s