opencv-stubs


Nameopencv-stubs JSON
Version 0.1.0 PyPI version JSON
download
home_pageNone
SummaryUnofficial stubs for the opencv-python package.
upload_time2025-08-03 05:06:12
maintainerNone
docs_urlNone
authorBagard Hoel
requires_python>=3.8
licenseMIT
keywords opencv stubs
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # OpenCV stubs

[![PyPI](https://img.shields.io/pypi/v/opencv-stubs?color=green&style=flat)](https://pypi.org/project/opencv-stubs)
[![PyPI - Implementation](https://img.shields.io/pypi/implementation/opencv-stubs?style=flat)](https://pypi.org/project/opencv-stubs)
[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/opencv-stubs?style=flat)](https://pypi.org/project/opencv-stubs)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/opencv-stubs?style=flat-square)](https://pypistats.org/packages/opencv-stubs)
[![License](https://img.shields.io/pypi/l/opencv-stubs?style=flat)](https://opensource.org/licenses/MIT)
![Linting](https://github.com/hoel-bagard/opencv-stubs/actions/workflows/pre-commit.yaml/badge.svg)

Unofficial python stubs for the opencv-python package.

Official OpenCV stubs now exist (in OpenCV>=4.8, cf [this issue](https://github.com/opencv/opencv/issues/14590) and [this PR](https://github.com/opencv/opencv/pull/20370)), so this repo was archived from 2023/03/27 to 2024/04/13.\
However I found the official stubs unhelpful when it came to type hinting, so I'm un-archiving the repo.

This package includes all the functions, classes and constants (please open an issue if you find a missing one).\
For some functions, OpenCV may handle more types than defined in this package. If you would like a type/function to be added or modified, please open an issue or a PR. There may also be a few errors as some types have been added programmatically. Please open an issue/PR if you see one.

The stubs include the docstrings as they are otherwise not available in IDEs (as far as I know).

## Installation

The package is available on pypi [here](https://pypi.org/project/opencv-stubs/), you can install it with:

```bash
pip install opencv-stubs
```

The dependency on opencv is optional, and can be accessed with:

- `pip install opencv-stubs[opencv]`
- `pip install opencv-stubs[opencv-contrib]`
- `pip install opencv-stubs[opencv-headless]`

## Acknowledgements

A stub file with opencv functions can be found on the [Microsoft stubs repo](https://github.com/microsoft/python-type-stubs/tree/main/cv2). This package reused those functions (with some added typing).

## TODO:

- [ ] Do something about `cv2.gapi.cv`, `cv2.utils.cv2` and `cv2.mat_wrapper.cv` (do not duplicate everything if possible).
- [ ] Handle cases like `cv2.misc.version.cv2.misc.version.cv2.misc.get_ocv_version()`.
- [ ] Only include the `opencv-contrib` specific stubs when using `opencv-stubs[opencv-contrib]`.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "opencv-stubs",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "OpenCV, stubs",
    "author": "Bagard Hoel",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/00/ba/c03576a30bbe2c85a9bc6d4ad0675e7119b5a1ab2940502aa23dd12f0fd5/opencv_stubs-0.1.0.tar.gz",
    "platform": null,
    "description": "# OpenCV stubs\n\n[![PyPI](https://img.shields.io/pypi/v/opencv-stubs?color=green&style=flat)](https://pypi.org/project/opencv-stubs)\n[![PyPI - Implementation](https://img.shields.io/pypi/implementation/opencv-stubs?style=flat)](https://pypi.org/project/opencv-stubs)\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/opencv-stubs?style=flat)](https://pypi.org/project/opencv-stubs)\n[![PyPI - Downloads](https://img.shields.io/pypi/dm/opencv-stubs?style=flat-square)](https://pypistats.org/packages/opencv-stubs)\n[![License](https://img.shields.io/pypi/l/opencv-stubs?style=flat)](https://opensource.org/licenses/MIT)\n![Linting](https://github.com/hoel-bagard/opencv-stubs/actions/workflows/pre-commit.yaml/badge.svg)\n\nUnofficial python stubs for the opencv-python package.\n\nOfficial OpenCV stubs now exist (in OpenCV>=4.8, cf [this issue](https://github.com/opencv/opencv/issues/14590) and [this PR](https://github.com/opencv/opencv/pull/20370)), so this repo was archived from 2023/03/27 to 2024/04/13.\\\nHowever I found the official stubs unhelpful when it came to type hinting, so I'm un-archiving the repo.\n\nThis package includes all the functions, classes and constants (please open an issue if you find a missing one).\\\nFor some functions, OpenCV may handle more types than defined in this package. If you would like a type/function to be added or modified, please open an issue or a PR. There may also be a few errors as some types have been added programmatically. Please open an issue/PR if you see one.\n\nThe stubs include the docstrings as they are otherwise not available in IDEs (as far as I know).\n\n## Installation\n\nThe package is available on pypi [here](https://pypi.org/project/opencv-stubs/), you can install it with:\n\n```bash\npip install opencv-stubs\n```\n\nThe dependency on opencv is optional, and can be accessed with:\n\n- `pip install opencv-stubs[opencv]`\n- `pip install opencv-stubs[opencv-contrib]`\n- `pip install opencv-stubs[opencv-headless]`\n\n## Acknowledgements\n\nA stub file with opencv functions can be found on the [Microsoft stubs repo](https://github.com/microsoft/python-type-stubs/tree/main/cv2). This package reused those functions (with some added typing).\n\n## TODO:\n\n- [ ] Do something about `cv2.gapi.cv`, `cv2.utils.cv2` and `cv2.mat_wrapper.cv` (do not duplicate everything if possible).\n- [ ] Handle cases like `cv2.misc.version.cv2.misc.version.cv2.misc.get_ocv_version()`.\n- [ ] Only include the `opencv-contrib` specific stubs when using `opencv-stubs[opencv-contrib]`.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "Unofficial stubs for the opencv-python package.",
    "version": "0.1.0",
    "project_urls": {
        "Bug Tracker": "https://github.com/hoel-bagard/opencv-stubs/issues",
        "Homepage": "https://github.com/hoel-bagard/opencv-stubs"
    },
    "split_keywords": [
        "opencv",
        " stubs"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "ee03af20fef3fa8d898d0f9616353b823380f3b87d2dfb8abc74a3af95b60d7e",
                "md5": "5d15ea4155020d3bf9297cd61b7a4e6f",
                "sha256": "97a372c4fdaed03ae2d103d11293acee257344878ca37a93ab037e26344d2213"
            },
            "downloads": -1,
            "filename": "opencv_stubs-0.1.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "5d15ea4155020d3bf9297cd61b7a4e6f",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 362865,
            "upload_time": "2025-08-03T05:06:11",
            "upload_time_iso_8601": "2025-08-03T05:06:11.116060Z",
            "url": "https://files.pythonhosted.org/packages/ee/03/af20fef3fa8d898d0f9616353b823380f3b87d2dfb8abc74a3af95b60d7e/opencv_stubs-0.1.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "00bac03576a30bbe2c85a9bc6d4ad0675e7119b5a1ab2940502aa23dd12f0fd5",
                "md5": "c91257e5d9252772791c35f666dcb797",
                "sha256": "a15b5c6673dcadcaf95ec91501471274462e2a1822d5c2b9d79629c7e5139089"
            },
            "downloads": -1,
            "filename": "opencv_stubs-0.1.0.tar.gz",
            "has_sig": false,
            "md5_digest": "c91257e5d9252772791c35f666dcb797",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 373763,
            "upload_time": "2025-08-03T05:06:12",
            "upload_time_iso_8601": "2025-08-03T05:06:12.483239Z",
            "url": "https://files.pythonhosted.org/packages/00/ba/c03576a30bbe2c85a9bc6d4ad0675e7119b5a1ab2940502aa23dd12f0fd5/opencv_stubs-0.1.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-08-03 05:06:12",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "hoel-bagard",
    "github_project": "opencv-stubs",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "opencv-stubs"
}
        
Elapsed time: 1.85825s