{"id":18960251,"url":"https://github.com/av1m/flask-sustainable","last_synced_at":"2026-05-03T13:43:33.062Z","repository":{"id":52636027,"uuid":"521054923","full_name":"av1m/flask-sustainable","owner":"av1m","description":"Sustainability in Flask through HTTP headers","archived":false,"fork":false,"pushed_at":"2022-09-11T11:42:55.000Z","size":41,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-25T14:59:24.006Z","etag":null,"topics":["flask","flask-extensions","http-headers","sustainability"],"latest_commit_sha":null,"homepage":"https://flask-sustainable.readthedocs.io","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/av1m.png","metadata":{"files":{"readme":"README.rst","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-08-03T22:52:25.000Z","updated_at":"2022-09-02T13:54:11.000Z","dependencies_parsed_at":"2022-08-13T02:01:16.542Z","dependency_job_id":null,"html_url":"https://github.com/av1m/flask-sustainable","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/av1m/flask-sustainable","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av1m%2Fflask-sustainable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av1m%2Fflask-sustainable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av1m%2Fflask-sustainable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av1m%2Fflask-sustainable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/av1m","download_url":"https://codeload.github.com/av1m/flask-sustainable/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/av1m%2Fflask-sustainable/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32571456,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-03T06:36:36.687Z","status":"ssl_error","status_checked_at":"2026-05-03T06:36:09.306Z","response_time":103,"last_error":"SSL_read: 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":["flask","flask-extensions","http-headers","sustainability"],"created_at":"2024-11-08T14:04:57.647Z","updated_at":"2026-05-03T13:43:33.033Z","avatar_url":"https://github.com/av1m.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"Flask-sustainable\n=================\n\n|Supported Python versions| |License| |Latest Version| |PyPI Publish| |Python CI|\n\n| Flask-Sustainable is an extension for Flask that provides a simple way to add sustainability to your application.\n| This is done by compressing the HTTP responses as soon as possible.  \n| More, HTTP headers are used so that the server can return information on the performance of the application.\n\nTwo types of headers are used:\n\n- indicators\n- scores\n\nGet started 🚀\n--------------\n\nInstallation 📦\n~~~~~~~~~~~~~~~~\n\nInstall the extension with pip:\n\n.. code:: bash\n\n    pip install flask-sustainable\n    # Or\n    pip install git+https://github.com/av1m/flask-sustainable.git\n\nTry it out 🔬\n~~~~~~~~~~~~~~\n\n💡 The code is available in `example.py \u003c./example.py\u003e`_ file\n\n.. code:: python\n\n    import flask\n    from flask_sustainable import Sustainable\n    from flask_sustainable.indicator import PerfCPU, PerfRAM, PerfTime\n\n    app = flask.Flask(__name__)\n    sustainable = Sustainable(app)  # Invoke Sustainable().init_app(app)\n    sustainable.add_indicators(PerfTime(), PerfCPU(), PerfRAM)\n\n    @app.route(\"/\")\n    def helloWorld():\n        return \"Hello, World!\"\n\nThen, try with cURL or Postman (or any other HTTP client):\n\n.. code:: bash\n\n    $ curl http://localhost:5000/ -I -H \"Perf: Perf-Time,Perf-CPU Perf-RAM\"\n\n    Perf-Time: 0.76592\n    Perf-RAM: 0.12114\n    Perf-CPU: 0.97900\n\nDevelopers 👨‍💻\n----------------\n\nUse python3 or python command (depending on your configuration)\nThere is a `Makefile \u003cMakefile\u003e`_ for helping with development.\n\n1. Clone this project\n\n.. code:: bash\n\n    git clone https://github.com/av1m/flask-sustainable.git\n    cd flask-sustainable\n\n2. Run make command\n\n.. code:: bash\n\n    make install\n\n1. Run a sample; a server is running on port 5000\n\n.. code:: bash\n    \n    python example.py\n\nEverything has been installed and configured correctly! 🎊\nOnce you modify the code, you can run `make format` and `make test` commands to check the code style and test coverage (through `make coverage`).\n\nTo find out all the available commands, you can use `make help` :\n\n.. code:: bash\n\n    help              Display callable targets.\n    test              Run all tests.\n    coverage          Run all tests and generate coverage report.\n    requirements      Install requirements.\n    install           Install package.\n    run               Run a example script.\n    format            Format code.\n\nTests 🧪\n~~~~~~~~\n\nA simple set of tests is included in `tests/ \u003c./tests\u003e`_.\nTo run, simply invoke `make test` or `pytest`.\nYou can also run a coverage report with `make coverage`.\n\nCompatibility 🤝\n-----------------\n\nThis project is compatible with Python 3.6 and up.\nIt has been tested on Python 3.6, 3.7, 3.8, 3.9, and 3.10\n\nThe Github Actions is not compatible with Python 3.6 because there is no ``setup.py`` file.\n\nLicense 📃\n----------\n\nThis project is licensed under the `MIT License \u003c./LICENSE\u003e`_.\n\n.. |Supported Python versions| image:: https://img.shields.io/badge/Python-3.6|3.7|3.8|3.9|3.10-blue\n.. |License| image:: http://img.shields.io/:license-MIT-blue.svg\n   :target: https://github.com/av1m/flask-sustainable/blob/main/LICENSE\n.. |PyPI Publish| image:: https://github.com/av1m/flask-sustainable/actions/workflows/pypi.yml/badge.svg\n   :target: https://github.com/av1m/flask-sustainable/actions/workflows/pypi.yml\n.. |Python CI| image:: https://github.com/av1m/flask-sustainable/actions/workflows/ci.yaml/badge.svg\n   :target: https://github.com/av1m/flask-sustainable/actions/workflows/ci.yaml\n.. |Latest Version| image:: https://img.shields.io/pypi/v/Flask-Sustainable.svg\n   :target: https://pypi.python.org/pypi/Flask-Sustainable/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fav1m%2Fflask-sustainable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fav1m%2Fflask-sustainable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fav1m%2Fflask-sustainable/lists"}