{"id":22169657,"url":"https://github.com/tombulled/param","last_synced_at":"2025-03-24T17:23:23.123Z","repository":{"id":60007063,"uuid":"525906590","full_name":"tombulled/param","owner":"tombulled","description":"Enhanced function parameters","archived":false,"fork":false,"pushed_at":"2024-03-02T17:41:46.000Z","size":182,"stargazers_count":0,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-29T22:18:00.040Z","etag":null,"topics":["param","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/tombulled-param/","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/tombulled.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-08-17T18:15:37.000Z","updated_at":"2022-08-19T13:06:19.000Z","dependencies_parsed_at":"2023-12-03T22:21:56.517Z","dependency_job_id":"ffb8c2e7-a125-44da-8019-2cf71b57096f","html_url":"https://github.com/tombulled/param","commit_stats":{"total_commits":66,"total_committers":2,"mean_commits":33.0,"dds":0.2272727272727273,"last_synced_commit":"d00699c312ef6f0e9ac2fe2dd1789a871d4224f2"},"previous_names":[],"tags_count":17,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombulled%2Fparam","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombulled%2Fparam/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombulled%2Fparam/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tombulled%2Fparam/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tombulled","download_url":"https://codeload.github.com/tombulled/param/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245316017,"owners_count":20595365,"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":["param","python"],"created_at":"2024-12-02T06:33:51.652Z","updated_at":"2025-03-24T17:23:23.098Z","avatar_url":"https://github.com/tombulled.png","language":"Python","readme":"# param\nEnhanced function parameters\n\n## Installation\n### PyPI\n```console\npip install tombulled-param\n```\n### GitHub\n```console\npip install git+https://github.com/tombulled/param.git@main\n```\n\n## Usage\n### Functions\nThe `@params` annotation works seamlessly with functions:\n```python\nfrom param import Param, params\n\n@params\ndef get(url: str, params: dict = Param(default_factory=dict)):\n    print(\"GET\", url, params)\n```\n```python\n\u003e\u003e\u003e get(\"https://httpbin.com/get\")\nGET https://httpbin.com/get {}\n```\n\n### Classes\nThe `@params` annotation also works seamlessly with classes. Importantly, the `@params` annotation should be specified before `@staticmethod` or `@classmethod`.\n```python\nfrom param import Param, params\n\nclass MyClass:\n    @params\n    def get(self, url: str, params: dict = Param(default_factory=dict)):\n        print(\"GET\", url, params)\n\n    @classmethod\n    @params\n    def post(cls, url: str, params: dict = Param(default_factory=dict)):\n        print(\"POST\", url, params)\n\n    @staticmethod\n    @params\n    def put(url: str, params: dict = Param(default_factory=dict)):\n        print(\"PUT\", url, params)\n```\n```python\n\u003e\u003e\u003e obj = MyClass()\n\u003e\u003e\u003e\n\u003e\u003e\u003e obj.get(\"https://httpbin.com/get\")\nGET https://httpbin.com/get {}\n\u003e\u003e\u003e\n\u003e\u003e\u003e obj.post(\"https://httpbin.com/post\")\nPOST https://httpbin.com/post {}\n\u003e\u003e\u003e MyClass.post(\"https://httpbin.com/post\")\nPOST https://httpbin.com/post {}\n\u003e\u003e\u003e\n\u003e\u003e\u003e obj.put(\"https://httpbin.com/put\")\nPUT https://httpbin.com/put {}\n\u003e\u003e\u003e MyClass.put(\"https://httpbin.com/put\")\nPUT https://httpbin.com/put {}\n```","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombulled%2Fparam","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftombulled%2Fparam","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftombulled%2Fparam/lists"}