{"id":13421647,"url":"https://github.com/hamidfzm/Flask-HTMLmin","last_synced_at":"2025-03-15T10:31:16.785Z","repository":{"id":27223930,"uuid":"30695120","full_name":"hamidfzm/Flask-HTMLmin","owner":"hamidfzm","description":"Flask HTML response minifier","archived":false,"fork":false,"pushed_at":"2025-01-05T18:29:25.000Z","size":153,"stargazers_count":99,"open_issues_count":0,"forks_count":25,"subscribers_count":6,"default_branch":"main","last_synced_at":"2025-03-08T13:32:57.518Z","etag":null,"topics":["flask","flask-extensions","flask-htmlmin","htmlmin","minify","minify-html","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hamidfzm.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}},"created_at":"2015-02-12T09:25:14.000Z","updated_at":"2025-03-03T18:34:06.000Z","dependencies_parsed_at":"2024-01-17T03:17:35.154Z","dependency_job_id":"e32c62bc-0ca8-456e-93b3-598f23ead4dc","html_url":"https://github.com/hamidfzm/Flask-HTMLmin","commit_stats":{"total_commits":97,"total_committers":14,"mean_commits":6.928571428571429,"dds":"0.25773195876288657","last_synced_commit":"be6999153210474f6d7ce9a5bab3eb70abe60a1e"},"previous_names":[],"tags_count":18,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidfzm%2FFlask-HTMLmin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidfzm%2FFlask-HTMLmin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidfzm%2FFlask-HTMLmin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hamidfzm%2FFlask-HTMLmin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hamidfzm","download_url":"https://codeload.github.com/hamidfzm/Flask-HTMLmin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243718905,"owners_count":20336590,"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":["flask","flask-extensions","flask-htmlmin","htmlmin","minify","minify-html","python"],"created_at":"2024-07-30T23:00:27.638Z","updated_at":"2025-03-15T10:31:16.781Z","avatar_url":"https://github.com/hamidfzm.png","language":"Python","readme":"\nFlask-HTMLmin\n=============\n[![PyPI version](https://badge.fury.io/py/Flask-HTMLmin.svg)](https://badge.fury.io/py/Flask-HTMLmin)\n![Supported Python Versions](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue.svg)\n[![License](https://img.shields.io/badge/License-BSD%203--Clause-orange.svg)](LICENSE)\n![tests](https://github.com/hamidfzm/Flask-HTMLmin/workflows/tests/badge.svg)\n[![codecov](https://codecov.io/gh/hamidfzm/Flask-HTMLmin/branch/master/graph/badge.svg)](https://codecov.io/gh/hamidfzm/Flask-HTMLmin)\n\nMinify flask `text/html` mime type responses.\nJust add `MINIFY_HTML = True` to your deployment config to minify HTML and text responses of your flask application.\n\n\nInstallation\n------------\nTo install Flask-HTMLmin, simply use pip:\n\n    pip install Flask-HTMLmin\n\nOr use pipenv:\n\n    pipenv install Flask-HTMLmin\n\nOr use poetry:\n\n    poetry add Flask-HTMLmin\n\nOr alternatively, you can download the repository and install it manually by doing:\n\n    git clone git@github.com:hamidfzm/Flask-HTMLmin.git\n    cd Flask-HTMLmin\n    python setup.py install\n\n\nExample\n-------\n```python\nfrom flask import Flask, render_template\nfrom flask_htmlmin import HTMLMIN\n    \napp = Flask(__name__)\napp.config['MINIFY_HTML'] = True\n\nhtmlmin = HTMLMIN(app)\n# or you can use HTMLMIN().init_app(app)\n# pass additional parameters to htmlmin\n# HTMLMIN(app, **kwargs)\n# example:\n# htmlmin = HTMLMIN(app, remove_comments=False, remove_empty_space=True, disable_css_min=True)\n\n\n@app.route('/')\ndef main():\n    # index.html will be minimized !!!\n    return render_template('index.html')\n\n\n@app.route('/exempt')\n@htmlmin.exempt\ndef exempted_route():\n    # index.html will be exempted and not blessed by holy htmlmin !!!\n    return render_template('index.html')\n\n\nif __name__ == '__main__':\n    app.run()\n```\n\nTODO\n----\n- [x] Test cases\n- [x] Route (or URL rule) exemption\n- [x] Caching (in progress)\n- [x] Minify inline CSS\n- [ ] Minify inline Javascript\n- [ ] Type hints\n","funding_links":[],"categories":["پایتون Python","Python","Frontend","介绍"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidfzm%2FFlask-HTMLmin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhamidfzm%2FFlask-HTMLmin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhamidfzm%2FFlask-HTMLmin/lists"}