{"id":15136011,"url":"https://github.com/gri-gus/decohints","last_synced_at":"2026-03-04T22:31:03.578Z","repository":{"id":57674427,"uuid":"482231094","full_name":"gri-gus/decohints","owner":"gri-gus","description":"A decorator for decorators that allows you to see the parameters of a decorated function when using it in PyCharm.","archived":false,"fork":false,"pushed_at":"2023-04-03T08:34:35.000Z","size":124,"stargazers_count":40,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-08T21:58:24.346Z","etag":null,"topics":["decohints","decorators","decorators-python","pycharm","python","python3"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gri-gus.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":"2022-04-16T11:05:52.000Z","updated_at":"2025-08-06T09:27:56.000Z","dependencies_parsed_at":"2024-06-21T18:56:40.851Z","dependency_job_id":"a6f7af69-e4cf-4afa-bad3-72a74e0540cc","html_url":"https://github.com/gri-gus/decohints","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/gri-gus/decohints","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri-gus%2Fdecohints","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri-gus%2Fdecohints/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri-gus%2Fdecohints/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri-gus%2Fdecohints/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gri-gus","download_url":"https://codeload.github.com/gri-gus/decohints/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gri-gus%2Fdecohints/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30096724,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T21:59:23.547Z","status":"ssl_error","status_checked_at":"2026-03-04T21:57:50.415Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["decohints","decorators","decorators-python","pycharm","python","python3"],"created_at":"2024-09-26T06:03:26.904Z","updated_at":"2026-03-04T22:31:03.139Z","avatar_url":"https://github.com/gri-gus.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003ca\u003e\n        \u003cimg src=\"https://raw.githubusercontent.com/gri-gus/decohints/main/assets/images/cover.png\" alt=\"decohints\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\n    \u003ca href=\"https://pypi.org/project/decohints\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/pypi/v/decohints\" alt=\"PyPI\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://pypi.org/project/decohints\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://static.pepy.tech/badge/decohints\" alt=\"PyPI\"\u003e\n    \u003c/a\u003e\n    \u003ca href=\"https://opensource.org/licenses/Apache-2.0\" target=\"_blank\"\u003e\n        \u003cimg src=\"https://img.shields.io/badge/License-Apache_2.0-blue.svg\" alt=\"PyPI\"\u003e\n    \u003c/a\u003e\n\u003c/p\u003e\n\n# decohints\n\n\u003ca href=\"https://github.com/gri-gus/decohints/blob/main/README.ru.md\" target=\"_blank\"\u003e\u003cb\u003e🇷🇺 Версия на русском\u003c/b\u003e\u003c/a\u003e\n\nA decorator for decorators that allows you to see the parameters of a decorated function when using it in PyCharm.\n\n**PyPi**: https://pypi.org/project/decohints/\n\n## Reasons for creation\n\nBelow is an example of a decorator with parameters without the use of `decohints`:\n\n```python\nfrom functools import wraps\n\n\ndef decorator_with_params(aa=None, bb=None, cc=None):\n    def _decorator(func):\n        @wraps(func)\n        def wrapper(*args, **kwargs):\n            try:\n                result = func(*args, **kwargs)\n            except Exception:\n                print(\"Error\")\n                return\n            return result\n\n        return wrapper\n\n    return _decorator\n\n\n@decorator_with_params()\ndef test(a: int, b: int) -\u003e int:\n    return a + b\n```\n\nIf you type below `test()` in PyCharm and wait, it will show decorator wrapper parameter hints as `test` function\nparameter hints:\n\n\u003cimg width=\"150\" height=\"105\" src=\"https://raw.githubusercontent.com/gri-gus/decohints/main/assets/images/1.png\" alt=\"test() (*args, **kwargs)\"\u003e\n\nThis is not convenient and can confuse developers, which is why this library was made.\n\n## Installation\n\n```shell\npip install decohints\n```\n\n## Usage\n\n\u003e ✅ Works with all kinds of decorators \\\n\u003e ⚠️ If your decorator is already wrapped in another decorator, then `decohints` should be on top\n\nTo use, you need to follow two simple steps:\n\n1. Import the `decohints` decorator from the `decohints` library:\n\n```python\nfrom decohints import decohints\n```\n\n2. Wrap your decorator with a `decohints` decorator:\n\n```python\n@decohints\ndef your_decorator():\n    ...\n```\n\nThe following is an example of a decorator with parameters, with using `decohints`:\n\n```python\nfrom functools import wraps\n\nfrom decohints import decohints\n\n\n@decohints\ndef decorator_with_params(aa=None, bb=None, cc=None):\n    def _decorator(func):\n        @wraps(func)\n        def wrapper(*args, **kwargs):\n            try:\n                result = func(*args, **kwargs)\n            except Exception:\n                print(\"Error\")\n                return\n            return result\n\n        return wrapper\n\n    return _decorator\n\n\n@decorator_with_params()\ndef test(a: int, b: int) -\u003e int:\n    return a + b\n```\n\nIf you type below `test()` in PyCharm and wait, it will show `test` function parameter hints:\n\n\u003cimg width=\"150\" height=\"105\" src=\"https://raw.githubusercontent.com/gri-gus/decohints/main/assets/images/2.png\" alt=\"test() (a: int, b: int)\"\u003e\n\n\u003e ❕Examples of use with decorator class, class decorators, and more are found at here:\n\u003ca href=\"https://github.com/gri-gus/decohints/tree/main/examples/decohints\" target=\"_blank\"\u003e\u003cb\u003eclick\u003c/b\u003e\u003c/a\u003e\n\n## Alternatives\n\n### Specifying the type of wrapper\n\n\u003e ✅ Works with all kinds of decorator functions\n\nSpecifying the type `wrapper: func` will have the same behavior as using `decohints`.\n\nExample:\n\n```python\nfrom functools import wraps\n\n\ndef decorator(func):\n    @wraps(func)\n    def wrapper(*args, **kwargs):\n        try:\n            result = func(*args, **kwargs)\n        except Exception:\n            print(\"Error\")\n            return\n        return result\n\n    wrapper: func\n    return wrapper\n\n\n@decorator\ndef test(a: int, b: int) -\u003e int:\n    return a + b\n```\n\nIf you type below `test()` in PyCharm and wait, it will show `test` function parameter hints:\n\n\u003cimg width=\"150\" height=\"105\" src=\"https://raw.githubusercontent.com/gri-gus/decohints/main/assets/images/2.png\" alt=\"test() (a: int, b: int)\"\u003e\n\n### Specifying an output type in a decorator with parameters\n\n\u003e ❗️This method only works in decorator functions with parameters\n\nIf you specify the `Callable` type from the `typing` module for the result of the decorator with parameters, then the\nbehavior will be the same as using `decohints`.\n\nExample:\n\n```python\nfrom functools import wraps\nfrom typing import Callable\n\n\ndef decorator_with_params(aa=None, bb=None, cc=None) -\u003e Callable:\n    def _decorator(func):\n        @wraps(func)\n        def wrapper(*args, **kwargs):\n            try:\n                result = func(*args, **kwargs)\n            except Exception:\n                print(\"Error\")\n                return\n            return result\n\n        return wrapper\n\n    return _decorator\n\n\n@decorator_with_params()\ndef test(a: int, b: int) -\u003e int:\n    return a + b\n```\n\nIf you type below `test()` in PyCharm and wait, it will show `test` function parameter hints:\n\n\u003cimg width=\"150\" height=\"105\" src=\"https://raw.githubusercontent.com/gri-gus/decohints/main/assets/images/2.png\" alt=\"test() (a: int, b: int)\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgri-gus%2Fdecohints","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgri-gus%2Fdecohints","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgri-gus%2Fdecohints/lists"}