{"id":15621632,"url":"https://github.com/jeertmans/strong","last_synced_at":"2025-03-29T15:46:51.644Z","repository":{"id":57471916,"uuid":"301770810","full_name":"jeertmans/strong","owner":"jeertmans","description":"Simple dynamic Python type checker","archived":false,"fork":false,"pushed_at":"2021-01-17T17:44:43.000Z","size":862,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T16:42:45.781Z","etag":null,"topics":["dynamic","function-signatures","python","type-checker"],"latest_commit_sha":null,"homepage":"","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/jeertmans.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-10-06T15:24:09.000Z","updated_at":"2024-07-31T12:33:19.000Z","dependencies_parsed_at":"2022-09-19T09:30:27.949Z","dependency_job_id":null,"html_url":"https://github.com/jeertmans/strong","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fstrong","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fstrong/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fstrong/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jeertmans%2Fstrong/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jeertmans","download_url":"https://codeload.github.com/jeertmans/strong/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246207492,"owners_count":20740723,"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","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":["dynamic","function-signatures","python","type-checker"],"created_at":"2024-10-03T09:51:21.155Z","updated_at":"2025-03-29T15:46:51.617Z","avatar_url":"https://github.com/jeertmans.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://raw.githubusercontent.com/jeertmans/strong/main/img/logo.png\" width=300\u003e\u003c/img\u003e\n\u003c/p\u003e\n\n![](https://img.shields.io/readthedocs/strong) ![](https://img.shields.io/pypi/v/strong) ![](https://img.shields.io/pypi/pyversions/strong)\n\n# Strong - Dynamic type checker for function signatures\nStrong embraces the builtin `typing` package by providing dynamic type checking for function signatures.\n\n## Install:\n\nSimply use:\n\n`pip install strong`\n\n## Documentation:\n\nThe documentation is hosted [here](https://strong.readthedocs.io/en/latest/).\n\n## Example:\n\nLet's say you have a function taking two inputs, `a` and `b`, and returning one output. In Python, you can use type-hint in order to give clue about the type the parameters should have. Nonetheless, Python will not block inputs with the wrong type.\n\nThis package is here to provide tools to make the task of checking input parameters type easy.\n\n```python\n\u003e\u003e\u003e from strong.core.decorators import assert_correct_typing\n\n\u003e\u003e\u003e @assert_correct_typing\n\u003e\u003e\u003e def f(a: int, b: int) -\u003e int:\n\u003e\u003e\u003e     return a + b\n\n\u003e\u003e\u003e x = f(1, 2)  # O.K.\n\n\u003e\u003e\u003e y = f(1, '2')  # K.O.\nAssertionError: Function f defined in \"\u003cfunction_file\u003e\", line 3\n    Argument `b` does not match typing: '2' is not an instance of \u003cclass 'int'\u003e\n\u003e\u003e\u003e from strong.core.decorators import measure_overhead\n\u003e\u003e\u003e import numpy as np\n\n\u003e\u003e\u003e @measure_overhead(assert_correct_typing)\n\u003e\u003e\u003e def g(a: int, b: int) -\u003e np.ndarray:\n        return np.random.rand(a, b)\n    \n\u003e\u003e\u003e g(100, 100)\n1.0687804670719938  # Ratio between time taken with @assert_correct_typing and without\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeertmans%2Fstrong","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjeertmans%2Fstrong","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjeertmans%2Fstrong/lists"}