{"id":21569358,"url":"https://github.com/aweirddev/definitely","last_synced_at":"2026-02-06T18:06:49.990Z","repository":{"id":253376193,"uuid":"843345664","full_name":"AWeirdDev/definitely","owner":"AWeirdDev","description":"Definitely typed. Type any object to any type as you wish.","archived":false,"fork":false,"pushed_at":"2024-08-16T11:07:16.000Z","size":6,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-15T12:02:05.685Z","etag":null,"topics":["definitely-typed","python-typing","typing"],"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/AWeirdDev.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-08-16T10:06:50.000Z","updated_at":"2025-01-26T15:15:01.000Z","dependencies_parsed_at":null,"dependency_job_id":"e2b301ae-eea7-4a69-b20e-46f091a52add","html_url":"https://github.com/AWeirdDev/definitely","commit_stats":null,"previous_names":["aweirddev/definitely"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/AWeirdDev/definitely","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fdefinitely","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fdefinitely/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fdefinitely/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fdefinitely/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AWeirdDev","download_url":"https://codeload.github.com/AWeirdDev/definitely/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AWeirdDev%2Fdefinitely/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265483222,"owners_count":23774168,"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":["definitely-typed","python-typing","typing"],"created_at":"2024-11-24T11:09:15.993Z","updated_at":"2026-02-06T18:06:49.961Z","avatar_url":"https://github.com/AWeirdDev.png","language":"Python","readme":"# definitely\nTyping tricks that make your type checker *a little* more quiet.\n\n**Key features**:\n- `definitely` – Type everything as you wish.\n- `asyncily` – Run a function asynchronously.\n- `asyncily_iterate` – Iterate through an iterator asynchronously.\n- `reversely` – Reverse a dictionary.\n\n```haskell\npip install definitely-typed\n```\n\nI should all be responsible about this, admittedly. Sorry guys.\n\n## Methods\nThey just exist!\n\n### \u003ckbd\u003edef\u003c/kbd\u003e definitely\nDefinitely typed.\n\n```python\nperson = \"Charles\"\n\n# Transforms `person` into any type you desire\nassert definitely(person, int)\n\nreveal_type(person)\n#           ^^^^^^\n# runtime:     str\n# typecheck:   int\n```\n\nThe runtime type **WILL NOT** change, yet when `TYPE_CHECKING`, the variable acts just like the desired type (in this case, `int`).\n\n### \u003ckbd\u003edef\u003c/kbd\u003e asyncily\nAsynchronously run a function.\n\n```python\n# You can use this as a decorator like so:\n@asyncily\ndef buy_stuff(item: str):\n    print(\"dad is going out!\")\n    time.sleep(2 \u003c\u003c 40)\n    print(\"came back with the %s!\" % item)\n\nawait buy_stuff(\"milk\")\n\n# Or, you can use this as a \"async function factory\" like so:\ndef make(name: str):\n    return f\"Made product: {name!r}\"\n\namake = asyncily(make)\nawait amake(\"milk\")\n```\n\n### \u003ckbd\u003edef\u003c/kbd\u003e asyncily_iterate\nAsynchronously iterate through an iterator.\n\n```python\ndef get_resources():\n    yield from [\"banana\", \"guava\", \"apple\"]\n\nasync for resource in asyncily_iterate(get_resources()):\n    print(\"-\", resource)\n\n# Output:\n# - banana\n# - guava\n# - apple\n```\n\n### \u003ckbd\u003edef\u003c/kbd\u003e reversely\nReverse a dictionary.\n\n```python\nmetadata = {\"password\": 1234, \"total_users\": 100_000}\nreversed_metadata = reversely(metadata)\n\nassert reversed_metadata == {1234: \"password\", 100_000: \"users\"}\n\nreveal_type(reversed_metadata)\n#           ^^^^^^^^^^^^^^^^^\n# runtime:     dict[int, str]\n# typecheck:   dict[str, int]\n```\n\n***\n\n(c) 2024 AWeirdDev, and other silly people\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweirddev%2Fdefinitely","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faweirddev%2Fdefinitely","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faweirddev%2Fdefinitely/lists"}