{"id":26326275,"url":"https://github.com/harehare/python-wasm-vdom","last_synced_at":"2025-03-15T19:36:19.277Z","repository":{"id":180965157,"uuid":"665984933","full_name":"harehare/python-wasm-vdom","owner":"harehare","description":"A virtual dom library in python using wasm.","archived":false,"fork":false,"pushed_at":"2023-07-13T13:23:25.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-05T09:46:12.659Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harehare.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-13T12:47:52.000Z","updated_at":"2023-07-13T12:48:54.000Z","dependencies_parsed_at":"2023-07-13T14:24:23.131Z","dependency_job_id":"d8eaf1b5-2371-4310-b199-6d3f05b21964","html_url":"https://github.com/harehare/python-wasm-vdom","commit_stats":null,"previous_names":["harehare/python-wasm-vdom"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpython-wasm-vdom","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpython-wasm-vdom/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpython-wasm-vdom/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harehare%2Fpython-wasm-vdom/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harehare","download_url":"https://codeload.github.com/harehare/python-wasm-vdom/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243783594,"owners_count":20347404,"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":"2025-03-15T19:36:18.547Z","updated_at":"2025-03-15T19:36:19.273Z","avatar_url":"https://github.com/harehare.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# python-wasm-vdom\n\nThis repository is inspired by [getty104/ruby-wasm-vdom](https://github.com/getty104/ruby-wasm-vdom).\n\nA virtual dom library in python using wasm.\n\nIt is lightweight and has few functions, so it is suitable for creating trial pages.\n\n## How to use\n\n```python\n\u003chtml\u003e\n\t\u003chead /\u003e\n\t\u003cbody\u003e\n\t\t\u003cdiv id=\"app\"\u003eLoading...\u003c/div\u003e\n\t\t\u003cscript src=\"python-wasm-vdom.js\"\u003e\u003c/script\u003e\n\t\t\u003cscript type=\"text/python\"\u003e\n\t\t\tfrom vdom import App, p\n\n\t\t\tstate = {\n\t\t\t  'count': 0,\n\t\t\t}\n\n\t\t\tdef increment(state, value):\n\t\t\t    state['count'] += 1\n\n\t\t\tactions = {\n\t\t\t  'increment': increment\n\t\t\t}\n\n\t\t\tdef view(state, actions):\n\t\t\t  return p('div', {}, [\n\t\t\t    p('button', { 'onClick': lambda e: actions['increment'](state, None) }, ['Click me!']),\n\t\t\t        p('p', {}, [f\"Count is {state['count']}\"])\n\t\t\t    ])\n\n\t\t\tApp(\n\t\t\t  selector='#app',\n\t\t\t  state=state,\n\t\t\t  view=view,\n\t\t\t  actions=actions,\n\t\t\t)\n\t\t\u003c/script\u003e\n\t\u003c/body\u003e\n\u003c/html\u003e\n```\n\n```html\n\u003chtml\u003e\n\t\u003chead /\u003e\n\t\u003cbody\u003e\n\t\t\u003cdiv id=\"app\"\u003eLoading...\u003c/div\u003e\n\t\t\u003cscript src=\"python-wasm-vdom.js\"\u003e\u003c/script\u003e\n\t\t\u003cscript type=\"text/python\" src=\"counter.py\"\u003e\u003c/script\u003e\n\t\u003c/body\u003e\n\u003c/html\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fpython-wasm-vdom","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharehare%2Fpython-wasm-vdom","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharehare%2Fpython-wasm-vdom/lists"}