{"id":17081137,"url":"https://github.com/arjixwastaken/pyml","last_synced_at":"2025-04-12T20:50:19.932Z","repository":{"id":62581817,"uuid":"429920851","full_name":"ArjixWasTaken/PyML","owner":"ArjixWasTaken","description":"A python HTML builder library.","archived":false,"fork":false,"pushed_at":"2021-12-24T12:42:23.000Z","size":36,"stargazers_count":8,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-06T05:49:58.316Z","etag":null,"topics":["html","html-builder","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/PyML/","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/ArjixWasTaken.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}},"created_at":"2021-11-19T20:05:59.000Z","updated_at":"2025-03-16T19:42:50.000Z","dependencies_parsed_at":"2022-11-03T21:20:05.774Z","dependency_job_id":null,"html_url":"https://github.com/ArjixWasTaken/PyML","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjixWasTaken%2FPyML","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjixWasTaken%2FPyML/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjixWasTaken%2FPyML/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ArjixWasTaken%2FPyML/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ArjixWasTaken","download_url":"https://codeload.github.com/ArjixWasTaken/PyML/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248631727,"owners_count":21136560,"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":["html","html-builder","python"],"created_at":"2024-10-14T12:49:33.455Z","updated_at":"2025-04-12T20:50:19.910Z","avatar_url":"https://github.com/ArjixWasTaken.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# PyML\nA python HTML builder library.\n\n\n# Goals\n- [x] Fully functional html builder similar to the javascript node manipulation.\n- [x] Implement an html parser that returns a Document instance with the proper properties and children.\n- [ ] Prettify JavaScript to fit in with the prettified html.\n- [ ] Add more API methods.\n- [ ] Add CSS selector support.\n- [ ] Add styling configuration.\n\n# Usage\nIf you have ever manipulated html using JavaScript then this should be really intuitive.\nYou just use the document to create a node.\nYou then modify the node with the properties and children that you want.\nAnd insert that node into the document.\n\n```python\nfrom PyML import Document\n\ndoc = Document()\ndoc.title = \"Example title!\"\n\nprint(doc)\n```\nresults in\n```html\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eExample title!\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\u003c/body\u003e\n\u003c/html\u003e\n```\n\n# Parsing html as a Document\nNote: The parser is very experimental, that means that it might not be able to properly parse some html.\n```python\nfrom PyML.parser import doc_from_string\n\nhtml = \"\"\"\n\u003chtml\u003e\n    \u003chead\u003e\n        \u003ctitle\u003eExample title!\u003c/title\u003e\n    \u003c/head\u003e\n    \u003cbody\u003e\n        \u003cdiv class=\"heh\"\u003e\n            \u003cimg src=\"myImage.png\"\u003e\n        \u003c/div\u003e\n    \u003c/body\u003e\n\u003c/html\u003e\n\"\"\"\n\ndoc = doc_from_string(html)\nprint(doc.title)\nprint(doc.find(\"img\").properties[\"src\"])\n```\n\n\n# Contributing\nAnybody is free to contribute if they want, just make sure you follow the points listed below:\n- Don't rename/move methods/objects without consulting me first.\n- Don't introduce new functionality without explaining in-depth why we need said functionality (unless its from the [Goals](#goals) section)\n- Your code must be PEP-8 compliable.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjixwastaken%2Fpyml","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Farjixwastaken%2Fpyml","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Farjixwastaken%2Fpyml/lists"}