{"id":23312420,"url":"https://github.com/user0332/py-default","last_synced_at":"2026-02-04T23:35:52.649Z","repository":{"id":268904380,"uuid":"905429333","full_name":"User0332/py-default","owner":"User0332","description":"Uniform Default Values for Python","archived":false,"fork":false,"pushed_at":"2024-12-19T15:36:04.000Z","size":14,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-01-19T04:55:38.902Z","etag":null,"topics":[],"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/User0332.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":"2024-12-18T20:08:11.000Z","updated_at":"2024-12-19T15:36:07.000Z","dependencies_parsed_at":"2024-12-19T16:40:49.138Z","dependency_job_id":null,"html_url":"https://github.com/User0332/py-default","commit_stats":null,"previous_names":["user0332/py-default"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/User0332%2Fpy-default","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/User0332%2Fpy-default/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/User0332%2Fpy-default/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/User0332%2Fpy-default/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/User0332","download_url":"https://codeload.github.com/User0332/py-default/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238617163,"owners_count":19501985,"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":[],"created_at":"2024-12-20T14:29:37.880Z","updated_at":"2026-02-04T23:35:52.611Z","avatar_url":"https://github.com/User0332.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyDefault - Uniform Default Values for Python\n\nPyDefault allows for uniform assignment/generation of default values for common types in Python. The API comes in two forms - a function and a map.\n\n## Installation\n\nYou can install `pydefault` using `pip` via `pip install py-default`, or you may install it using `pip` using the GitHub repo URL. Distributions are also available from `dist/` at the root of the repository.\n\n## Function API\n\n```py\nfrom pydefault import default\n\nclass Person: ...\n\nmynum = default(int) # initializes to 0\nempty_list = default(list) # initializes to []\n\nobj = default(Person) # initializes to None\n```\n\n## Map API\n\n```py\nfrom pydefault import default\n\nclass Person: ...\n\nmynum = default[int] # initializes to 0\nempty_list = default[list] # initializes to []\n\nobj = default[Person] # initializes to None\n```\n\n## Default Values\n\nThe following types resolve to the following default values:\n- `int` -\u003e `0`\n- `bool` -\u003e `0` (`False`)\n- `complex` -\u003e `complex()`\n- `str` -\u003e `\"\"`\n- `float` -\u003e `0.0`\n- `list` -\u003e `[]`\n- `set` -\u003e `set()`\n- `dict` -\u003e `{}`\n- anything else -\u003e `None`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuser0332%2Fpy-default","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fuser0332%2Fpy-default","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fuser0332%2Fpy-default/lists"}