{"id":26178468,"url":"https://github.com/houshmand-2005/py2hlog","last_synced_at":"2025-10-28T00:13:00.348Z","repository":{"id":59554291,"uuid":"537884017","full_name":"houshmand-2005/py2hlog","owner":"houshmand-2005","description":"Python logs to HTML formatter","archived":false,"fork":false,"pushed_at":"2023-02-17T18:54:23.000Z","size":518,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"houshmand","last_synced_at":"2025-02-14T19:08:10.774Z","etag":null,"topics":["html","logger","logger-python","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/py2hlog/","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/houshmand-2005.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":"2022-09-17T17:36:16.000Z","updated_at":"2023-02-18T16:32:59.000Z","dependencies_parsed_at":"2023-01-21T04:10:25.549Z","dependency_job_id":null,"html_url":"https://github.com/houshmand-2005/py2hlog","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fpy2hlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fpy2hlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fpy2hlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/houshmand-2005%2Fpy2hlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/houshmand-2005","download_url":"https://codeload.github.com/houshmand-2005/py2hlog/tar.gz/refs/heads/houshmand","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243114715,"owners_count":20238647,"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","logger","logger-python","python"],"created_at":"2025-03-11T21:28:45.415Z","updated_at":"2025-10-28T00:12:55.312Z","avatar_url":"https://github.com/houshmand-2005.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# py2hlog (Python to HTML log)\nsee it from pypi [pypi.org/project/py2hlog/](https://pypi.org/project/py2hlog/)\n\nPython logs to HTML formatter\n\ninstall py2hlog:\n```bash\npip install py2hlog\n```\n\nsimple useage :\n```bash\nfrom py2hlog import logger\nimport time\nobj1 = logger.py2hlog()  # create an object from py2hlog\nobj1.file_name = \"new_log_file.txt\"  # here write the log detail\ntry:\n    if a == 2:\n        print(\"Iam working!\")\nexcept:\n    obj1.error(\"I dont have any 'a' variable\")\nprint(\"print obj1: \", obj1)\ntime.sleep(5)  # to see time changing\nobj1.debug(\"Add a variable before the 'if' like a = 3\")\nobj1.makehtml(\"py2hlog.html\")  # enter the name of output file\n# you can also use these statuses :\n# _____________________________\n# obj1.critical(\"your message\")\n# obj1.debug(\"your message\")\n# obj1.info(\"your message\")\n# obj1.warning(\"your message\")\n# obj1.error(\"your message\")\n# _____________________________\n\n```\n**py2hlog.html** output : \n\n\u003cimg src=\"https://github.com/houshmand-2005/py2hlog/blob/ec6f99679990a0fd1d585ff8ccf261ae9cac0d22/images/1.jpg\" alt=\"randomazer_hash\" width=\"700\"\u003e\n\nAll of the statuses:\n\n\u003cimg src=\"https://github.com/houshmand-2005/py2hlog/blob/5a5f6cc5c5f0002c56d98b4621c77b7aa1af3c16/images/3.png\" alt=\"randomazer_hash\" width=\"700\"\u003e\n\nYou can also see which file the log belongs to and when the log was added. like this:\n\n\u003cimg src=\"https://github.com/houshmand-2005/py2hlog/blob/ec6f99679990a0fd1d585ff8ccf261ae9cac0d22/images/2.jpg\" alt=\"randomazer_hash\" width=\"700\"\u003e\n\nAlso you can mark a part of your code for each status like this:\n\n```bash\nfrom py2hlog import logger\nobject_of_py2hlog = logger.py2hlog()\nobject_of_py2hlog.file_name = \"Py2hlog.txt\"\nobject_of_py2hlog.warning(\"you can also mark a part of code for this status like --\u003e\", 1, 5)\n# (\"msg\", start line, end line)\nobject_of_py2hlog.makehtml(\"Py2hlog.html\")\n```\n\noutput : \n\n\u003cimg src=\"https://github.com/houshmand-2005/py2hlog/blob/8cd72d49c5627b604a204603225743416c011050/images/V0.3.jpg\" alt=\"randomazer_hash\" width=\"700\"\u003e\n\nAs you can see, when you click on 'see code', the codes will appear\u003cbr\u003e\n\u003cbr\u003e\nwhat is new :\n\u003cbr\u003e✨ Add the ability to show the contents of the executable file folder and display it\n\u003cbr\u003e\u003cimg src=\"https://github.com/houshmand-2005/py2hlog/blob/47d372b037abee1f99b1a70bd14f16ad9b9e0719/images/4.1.png\" alt=\"newabli\" width=\"700\"\u003e\n\u003cbr\u003e\n\u003cbr\u003e\n✨After the last update(V1.2) we have a better style for tree:\u003cbr\u003e\n \u0026emsp; Before \u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp;\u0026emsp; After\n\u003cdiv style=\"display: flex;\"\u003e\n  \u003cimg src=\"https://github.com/houshmand-2005/py2hlog/blob/47d372b037abee1f99b1a70bd14f16ad9b9e0719/images/4.3.png\" alt=\"newabli\" width=\"120\" height=\"270\"\u003e\n  \u003cimg src=\"https://github.com/houshmand-2005/py2hlog/blob/47d372b037abee1f99b1a70bd14f16ad9b9e0719/images/4.2.png\" alt=\"newabli\" width=\"120\" height=\"270\"\u003e\n\u003c/div\u003e\n\u003cbr\u003e\nIf you want to disable the tree display (Important note \"You must define it before the logs statement like the following code\")\u003cbr\u003e\n\n\n```bash\nfrom py2hlog import logger\nobject_of_py2hlog = logger.py2hlog()\nlogger.Add_Tree = False\nobject_of_py2hlog.file_name = \"Py2hlog.txt\"\nobject_of_py2hlog.warning(\"\", 1, 5)\nobject_of_py2hlog.makehtml(\"Py2hlog.html\")\n```\n\n\u003chr\u003e\nhoushmand2005\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoushmand-2005%2Fpy2hlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhoushmand-2005%2Fpy2hlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhoushmand-2005%2Fpy2hlog/lists"}