{"id":35617641,"url":"https://github.com/mianfg/pvv","last_synced_at":"2026-01-05T06:01:08.804Z","repository":{"id":223694062,"uuid":"761279649","full_name":"mianfg/pvv","owner":"mianfg","description":"Minimal Python decorator to enforce type validation from type hints","archived":false,"fork":false,"pushed_at":"2024-02-23T13:51:41.000Z","size":7,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-09-29T04:21:23.624Z","etag":null,"topics":["python","python-decorators","validation"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/pvv/","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/mianfg.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}},"created_at":"2024-02-21T15:18:44.000Z","updated_at":"2024-02-21T16:06:52.000Z","dependencies_parsed_at":"2024-02-21T17:26:56.412Z","dependency_job_id":"f08b45f9-0ff5-435c-8fb8-106754468706","html_url":"https://github.com/mianfg/pvv","commit_stats":null,"previous_names":["mianfg/pvv","mianfg/pyv"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mianfg/pvv","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mianfg%2Fpvv","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mianfg%2Fpvv/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mianfg%2Fpvv/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mianfg%2Fpvv/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mianfg","download_url":"https://codeload.github.com/mianfg/pvv/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mianfg%2Fpvv/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28214402,"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","status":"online","status_checked_at":"2026-01-05T02:00:06.358Z","response_time":57,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["python","python-decorators","validation"],"created_at":"2026-01-05T06:00:20.608Z","updated_at":"2026-01-05T06:01:08.795Z","avatar_url":"https://github.com/mianfg.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pvv\n\nMinimal Python decorator to enforce type validation from type hints\n\n## Installation\n\nThis library has been created to have zero dependencies, and work with native Python. Use your favorite package manager to install `pvv` from PyPI.\n\n```\npip install pvv\n```\n\n## Usage\n\nThere are two ways to use the `validate` decorator from `pvv`:\n\n### Validate all parameters\n\nJust use the decorator. A `TypeError` will be raised if the function is called with parameters of incorrect type.\n\n\u003e [!NOTE]\n\u003e `pvv` will check if the given parameters to a function are instances of the class annotated as a parameter. If one parameter has no type hints, it will be ignored in the validation.\n\n\u003e [!WARNING]\n\u003e `pvv` will only work with type hints that can be used with class and instance checks.\n\n```python\nfrom pvv import validate\n\n@validate\ndef function(a: str, b: int, c):\n    pass\n```\n\n```\n\u003e\u003e\u003e function(\"a\", 3, 2)\n\u003e\u003e\u003e function(c=2, a=\"a\", b=2)\n\u003e\u003e\u003e function(3, \"a\", 2)\nTypeError: Incorrect type of function arguments: 'a' must be of type 'str', 'b' must be of type 'int'\n```\n\n### Validate some parameters\n\n```python\nfrom pvv import validate\n\n@validate('a', 'c')\ndef function(a: str, b: int, c: bool | None):\n    pass\n```\n\n```\n\u003e\u003e\u003e function(\"a\", 3, True)\n\u003e\u003e\u003e function(3, \"b\", 0)\nTypeError: Incorrect type of function arguments: 'a' must be of type 'str', 'c' must be of type 'bool | None'\n```\n\n### An important note\n\nThe parameters of the `validate` decorator must all be of type `str`, otherwise a `ValidatorError` will be raised:\n\n```\n\u003e\u003e\u003e @validate('a', 1)\n... def func(*args, **kwargs):\n...     pass\npvv.exceptions.ValidatorError: All arguments of decorator must be of type 'str'\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmianfg%2Fpvv","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmianfg%2Fpvv","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmianfg%2Fpvv/lists"}