{"id":37066525,"url":"https://github.com/jgrugru/htmlfactory","last_synced_at":"2026-01-14T07:48:40.318Z","repository":{"id":54325950,"uuid":"338431138","full_name":"jgrugru/htmlfactory","owner":"jgrugru","description":"A simple way to produce HTML with Python.","archived":false,"fork":false,"pushed_at":"2022-03-11T21:59:45.000Z","size":140,"stargazers_count":1,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-27T16:41:22.394Z","etag":null,"topics":["create","html","markup-language","python","xml"],"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/jgrugru.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-02-12T20:55:13.000Z","updated_at":"2022-10-31T14:17:32.000Z","dependencies_parsed_at":"2022-08-13T12:01:16.078Z","dependency_job_id":null,"html_url":"https://github.com/jgrugru/htmlfactory","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"purl":"pkg:github/jgrugru/htmlfactory","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgrugru%2Fhtmlfactory","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgrugru%2Fhtmlfactory/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgrugru%2Fhtmlfactory/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgrugru%2Fhtmlfactory/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jgrugru","download_url":"https://codeload.github.com/jgrugru/htmlfactory/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jgrugru%2Fhtmlfactory/sbom","scorecard":{"id":518350,"data":{"date":"2025-08-11","repo":{"name":"github.com/jgrugru/htmlfactory","commit":"cef999dc353174b5715beb3a0d28bd6c3f729802"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.5,"checks":[{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Code-Review","score":0,"reason":"Found 0/28 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/code-quality.yml:1","Warn: no topLevel permission defined: .github/workflows/python-publish.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/code-quality.yml:12: update your workflow using https://app.stepsecurity.io/secureworkflow/jgrugru/htmlfactory/code-quality.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/code-quality.yml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/jgrugru/htmlfactory/code-quality.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:16: update your workflow using https://app.stepsecurity.io/secureworkflow/jgrugru/htmlfactory/python-publish.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/python-publish.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/jgrugru/htmlfactory/python-publish.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/code-quality.yml:17","Warn: pipCommand not pinned by hash: .github/workflows/code-quality.yml:18","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:23","Warn: pipCommand not pinned by hash: .github/workflows/python-publish.yml:24","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"17 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","Warn: Project is vulnerable to: PYSEC-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: GHSA-gmj6-6f8f-6699","Warn: Project is vulnerable to: GHSA-h5c8-rqwp-cp95","Warn: Project is vulnerable to: GHSA-h75v-3vvj-5mfj","Warn: Project is vulnerable to: GHSA-q2x7-8rv6-6q7h","Warn: Project is vulnerable to: PYSEC-2022-42969","Warn: Project is vulnerable to: GHSA-mr82-8j83-vxmv","Warn: Project is vulnerable to: PYSEC-2024-187 / GHSA-rqc4-2hc7-8c8v","Warn: Project is vulnerable to: GHSA-2g68-c3qc-8985","Warn: Project is vulnerable to: GHSA-f9vj-2wh5-fj8j","Warn: Project is vulnerable to: PYSEC-2023-221 / GHSA-hrfv-mqp8-q5rw","Warn: Project is vulnerable to: PYSEC-2023-57 / GHSA-px8h-6qxv-m22q","Warn: Project is vulnerable to: GHSA-q34m-jh98-gwm2","Warn: Project is vulnerable to: PYSEC-2023-58 / GHSA-xg9f-g7g7-2323","Warn: Project is vulnerable to: PYSEC-2022-203"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 4 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-20T02:20:45.526Z","repository_id":54325950,"created_at":"2025-08-20T02:20:45.526Z","updated_at":"2025-08-20T02:20:45.526Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28413498,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-14T05:26:33.345Z","status":"ssl_error","status_checked_at":"2026-01-14T05:21:57.251Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["create","html","markup-language","python","xml"],"created_at":"2026-01-14T07:48:39.744Z","updated_at":"2026-01-14T07:48:40.308Z","avatar_url":"https://github.com/jgrugru.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"![Untitled-Artwork](https://user-images.githubusercontent.com/24437648/155743874-4187e556-7ac7-44eb-8d73-3420e9c58af6.png)\n\n# htmlfactory     [![Build Status](https://travis-ci.com/jgrugru/htmlfactory.svg?branch=main)](https://travis-ci.com/jgrugru/htmlfactory)\nA simple way to produce HTML with Python.\nSource code can be found on [github](https://github.com/jgrugru/htmlfactory).\n```Python\npip install htmlfactory\n```\n\n**htmlfactory** simplifies the process of making HTML through Python.\n\n#### Examples:\n\n###### basic div example\n```Python\nTagFactory(\"div.my-class\")\n\n```\n\n```html\n\u003cdiv class='my-class'\u003e\u003c/div\u003e\n```\n\nTo add content between the divs, we can pass a string or *TagFactory* objects.\n```Python\n# pass a string\nTagFactory(\"div.my-class\", 'I am inside the div.')\n\n```\n\n```html\n\u003cdiv class='my-class'\u003eI am inside the div.\u003c/div\u003e\n```\n\n```Python\n# pass a TagFactory object\nTagFactory(\"div.my-class\",  TagFactory(\"div\", \"child tag\"))\n\n```\n\n```html\n\u003cdiv class=\"my-class\"\u003e\n  \u003cdiv\u003e\n    child tag\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\n###### children div example\n\npass a list of *TagFactory* objects\n```Python\nTagFactory(\"div.parent-div\", [\n      TagFactory(\"div.first-child-div\", (\n        TagFactory(\"div.second-child-div\", \"It's party time.\")))])\n\n```\n\n```html\n\u003cdiv class='parent-div'\u003e\n  \u003cdiv class='first-child-div'\u003e\n    \u003cdiv class='second-child-div'\u003e\n      It's party time.\n    \u003c/div\u003e\n  \u003c/div\u003e\n\u003c/div\u003e\n```\n\u003eNote:\n\u003eChildren tags can be passed through a list, tuple, or singular *TagFactory* object.\n\n###### printing *TagFactory* objects\n\nTo output a TagFactory object, use print.\n```Python\nprint(TagFactory('div', TagFactory('form')))\n```\n\n```html\n\u003cdiv\u003e\u003cform\u003e\u003c/form\u003e\u003c/div\u003e\n```\n\nUse the function *pretty_str()* for an indented output.\n```Python\nprint(TagFactory('div', TagFactory('form')).pretty_str())\n```\n\n```html\n\u003cdiv\u003e\n  \u003cform\u003e\n  \u003c/form\u003e\n\u003c/div\u003e\n```\n\nIf you would like an HTML, body, and head tag to be included, pass *add_html_tags=True*.\n```Python\nprint(TagFactory('div', TagFactory('form')).pretty_str(add_html_tags=True))\n```\n\n```html\n\u003chtml\u003e\n\u003chead\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n  \u003cdiv\u003e\n    \u003cform\u003e\n    \u003c/form\u003e\n  \u003c/div\u003e\n\u003c/body\u003e\n\u003c/html\u003e\n```\n###### multiple classes example\n\nYou can add as many classes as you want to your tag object:\n```Python\nTagFactory(\"div.class1.class2.class3.class4.class5\", 'I have a lot of classes.')\n```\n\n```html\n\u003cdiv class='class1 class2 class3 class4 class5'\u003eI have a lot of classes.\u003c/div\u003e\n```\n###### adding attributes example\n\nYou can add attributes to your tab object by using keyword arguments:\n```Python\nTagFactory(\"form\", 'I have an action \u0026 method attribute.', action=\"/action_page.php\", method=\"get\")\n```\n\n```html\n\u003cform action='/action_page.php' method='get'\u003eI have an action and method attribute.\u003c/form\u003e\n```\n\n\u003eNote:\n\u003e'for' is a keyword so it cannot be used as a keyword argument. Instead use 'four'.\n\u003eExample: ```TagFactory(\"div.my-class\", \"inside the div\", four=\"my-form\")```\n\n\u003eDashes (-) also cause a similar problem. For all html attributes that require a dash, \n\u003e omit the dash. The dash will be added upon creation of the object.\n\n```Python\n# with an omitted dash\nTagFactory(\"div\", role=\"application\", ariadescribedby=\"info\")\n```\n\n```html\n\u003cdiv role='application' aria-describedby='info'\u003e\u003c/div\u003e\n```\n\n###### adding tags without closing brackets example\n\nYou can create tags without closing brackets, which may be useful if wanting to add an img or link:\n```Python\ntest_tag = SingletonTag(\"img\", border=\"0\", alt=\"TestTag\",\n                        src=\"logo_w3s.gif\", width=\"100\",\n                        height=\"100\")\n```\n\n```html\n\u003cimg border='0' alt='TestTag' src='logo_w3s.gif' width='100' height='100'\u003e\n```\n\nThe SingletonTag class is inherited to the TagFactory class, so SingletonTags can be treated like TagFactory objects and added as children html elements to other TagFactory objects.\n```Python\na_tag = TagFactory(\"a\", SingletonTag(\"img\", src=\"logo_w3s.gif\"),\n                   href=\"www.google.com\")\n```\n\n```html\n\u003ca href='www.google.com'\u003e\u003cimg src='logo_w3s.gif'\u003e\u003c/a\u003e\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgrugru%2Fhtmlfactory","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjgrugru%2Fhtmlfactory","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjgrugru%2Fhtmlfactory/lists"}