{"id":13421655,"url":"https://github.com/muatik/flask-profiler","last_synced_at":"2026-01-26T14:10:51.522Z","repository":{"id":38306109,"uuid":"43713054","full_name":"muatik/flask-profiler","owner":"muatik","description":"a flask profiler which watches endpoint calls and tries to make some analysis.","archived":false,"fork":false,"pushed_at":"2022-12-02T02:48:05.000Z","size":1110,"stargazers_count":755,"open_issues_count":44,"forks_count":97,"subscribers_count":22,"default_branch":"master","last_synced_at":"2025-08-30T04:51:58.391Z","etag":null,"topics":["admin","analytics","dashboard","flask","monitoring","profiler","python"],"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/muatik.png","metadata":{"files":{"readme":"README.md","changelog":"changelog.txt","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-05T20:49:53.000Z","updated_at":"2025-08-12T22:15:00.000Z","dependencies_parsed_at":"2023-01-22T12:15:31.776Z","dependency_job_id":null,"html_url":"https://github.com/muatik/flask-profiler","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/muatik/flask-profiler","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muatik%2Fflask-profiler","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muatik%2Fflask-profiler/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muatik%2Fflask-profiler/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muatik%2Fflask-profiler/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/muatik","download_url":"https://codeload.github.com/muatik/flask-profiler/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/muatik%2Fflask-profiler/sbom","scorecard":{"id":667006,"data":{"date":"2025-08-11","repo":{"name":"github.com/muatik/flask-profiler","commit":"6a36526184ad3a903c2d50b3e208ed276d3404f6"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2.4,"checks":[{"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":"Code-Review","score":5,"reason":"Found 15/28 approved changesets -- score normalized to 5","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":"Dangerous-Workflow","score":-1,"reason":"no workflows found","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":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"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":"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":"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":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"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 'master'"],"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-2023-62 / GHSA-m2qf-hxjv-5gpq","Warn: Project is vulnerable to: PYSEC-2019-217 / GHSA-462w-v97r-4m45","Warn: Project is vulnerable to: GHSA-cpwx-vrp4-4pq7","Warn: Project is vulnerable to: PYSEC-2021-66 / GHSA-g3rq-g295-4j3m","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-2019-124 / GHSA-38fc-9xqv-7f7q","Warn: Project is vulnerable to: PYSEC-2019-123 / GHSA-887w-45rq-vxgf","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: GHSA-j544-7q9p-6xp8","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 20 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-21T18:24:39.795Z","repository_id":38306109,"created_at":"2025-08-21T18:24:39.795Z","updated_at":"2025-08-21T18:24:39.795Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28780329,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T13:55:28.044Z","status":"ssl_error","status_checked_at":"2026-01-26T13:55:26.068Z","response_time":59,"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":["admin","analytics","dashboard","flask","monitoring","profiler","python"],"created_at":"2024-07-30T23:00:27.745Z","updated_at":"2026-01-26T14:10:51.500Z","avatar_url":"https://github.com/muatik.png","language":"Python","funding_links":[],"categories":["Development (Debugging/Testing/Documentation)","Python","Third-Party Extensions","Awesome flask libraries","介绍"],"sub_categories":["Developer Tools"],"readme":"# Flask-profiler\n\n\n**version: 1.8** [![Build Status](https://travis-ci.org/muatik/flask-profiler.svg?branch=master)](https://travis-ci.org/muatik/flask-profiler)\n\n##### Flask-profiler measures endpoints defined in your flask application; and provides you fine-grained report through a web interface.\n\nIt gives answers to these questions:\n* Where are the bottlenecks in my application?\n* Which endpoints are the slowest in my application?\n* Which are the most frequently called endpoints?\n* What causes my slow endpoints? In which context, with what args and kwargs are they slow?\n* How much time did a specific request take?\n\nIn short, if you are curious about what your endpoints are doing and what requests they are receiving, give a try to flask-profiler.\n\nWith flask-profiler's web interface, you can monitor all your endpoints' performance and investigate endpoints and received requests by drilling down through filters.\n\n## Screenshots\n\nDashboard view displays a summary.\n\n![Alt text](resources/dashboard_screen.png?raw=true \"Dashboard view\")\n\nYou can create filters to investigate certain type requests.\n\n![Alt text](resources/filtering_all_screen.png?raw=true \"Filtering by endpoint\")\n\n![Alt text](resources/filtering_method_screen.png?raw=true \"Filtering by method\")\n\nYou can see all the details of a request.\n![Alt text](resources/filtering_detail_screen.png?raw=true \"Request detail\")\n\n## Quick Start\nIt is easy to understand flask-profiler going through an example. Let's dive in.\n\nInstall flask-profiler by pip.\n```sh\npip install flask_profiler\n```\n\n\nEdit your code where you are creating Flask app.\n```python\n# your app.py\nfrom flask import Flask\nimport flask_profiler\n\napp = Flask(__name__)\napp.config[\"DEBUG\"] = True\n\n# You need to declare necessary configuration to initialize\n# flask-profiler as follows:\napp.config[\"flask_profiler\"] = {\n    \"enabled\": app.config[\"DEBUG\"],\n    \"storage\": {\n        \"engine\": \"sqlite\"\n    },\n    \"basicAuth\":{\n        \"enabled\": True,\n        \"username\": \"admin\",\n        \"password\": \"admin\"\n    },\n    \"ignore\": [\n\t    \"^/static/.*\"\n\t]\n}\n\n\n@app.route('/product/\u003cid\u003e', methods=['GET'])\ndef getProduct(id):\n    return \"product id is \" + str(id)\n\n\n@app.route('/product/\u003cid\u003e', methods=['PUT'])\ndef updateProduct(id):\n    return \"product {} is being updated\".format(id)\n\n\n@app.route('/products', methods=['GET'])\ndef listProducts():\n    return \"suppose I send you product list...\"\n\n@app.route('/static/something/', methods=['GET'])\ndef staticSomething():\n    return \"this should not be tracked...\"\n\n# In order to active flask-profiler, you have to pass flask\n# app as an argument to flask-profiler.\n# All the endpoints declared so far will be tracked by flask-profiler.\nflask_profiler.init_app(app)\n\n\n# endpoint declarations after flask_profiler.init_app() will be\n# hidden to flask_profiler.\n@app.route('/doSomething', methods=['GET'])\ndef doSomething():\n    return \"flask-profiler will not measure this.\"\n\n\n# But in case you want an endpoint to be measured by flask-profiler,\n# you can specify this explicitly by using profile() decorator\n@app.route('/doSomethingImportant', methods=['GET'])\n@flask_profiler.profile()\ndef doSomethingImportant():\n    return \"flask-profiler will measure this request.\"\n\nif __name__ == '__main__':\n    app.run(host=\"127.0.0.1\", port=5000)\n\n\n```\n\nNow run your `app.py`\n```\npython app.py\n```\n\nAnd make some requests like:\n```sh\ncurl http://127.0.0.1:5000/products\ncurl http://127.0.0.1:5000/product/123\ncurl -X PUT -d arg1=val1 http://127.0.0.1:5000/product/123\n```\n\nIf everything is okay, Flask-profiler will measure these requests. You can see the result heading to http://127.0.0.1:5000/flask-profiler/ or get results as JSON http://127.0.0.1:5000/flask-profiler/api/measurements?sort=elapsed,desc\n\nIf you like to initialize your extensions in other files or use factory apps pattern, you can also create a instance of the `Profiler` class, this will register all your endpoints once you app run by first time. E.g:\n\n```python\nfrom flask import Flask\nfrom flask_profiler import Profiler\n\nprofiler = Profiler()\n\napp = Flask(__name__)\n\napp.config[\"DEBUG\"] = True\n\n# You need to declare necessary configuration to initialize\n# flask-profiler as follows:\napp.config[\"flask_profiler\"] = {\n    \"enabled\": app.config[\"DEBUG\"],\n    \"storage\": {\n        \"engine\": \"sqlite\"\n    },\n    \"basicAuth\":{\n        \"enabled\": True,\n        \"username\": \"admin\",\n        \"password\": \"admin\"\n    },\n    \"ignore\": [\n        \"^/static/.*\"\n    ]\n}\n\nprofiler = Profiler()  # You can have this in another module\nprofiler.init_app(app)\n# Or just Profiler(app)\n\n@app.route('/product/\u003cid\u003e', methods=['GET'])\ndef getProduct(id):\n    return \"product id is \" + str(id)\n\n```\n\n## Using with different database system\nYou can use flaskprofiler with **SqlLite**, **MongoDB**, **Postgresql**, **Mysql** or **MongoDB** database systems. However, it is easy to support other database systems. If you would like to have others, please go to contribution documentation. (It is really easy.)\n\n### SQLite\nIn order to use SQLite, just specify it as the value of `storage.engine` directive as follows.\n\n```json\napp.config[\"flask_profiler\"] = {\n    \"storage\": {\n        \"engine\": \"sqlite\",\n    }\n}\n```\n\nBelow the other options are listed.\n\n| Filter key   |      Description      |  Default |\n|----------|-------------|------|\n| storage.FILE | SQLite database file name | flask_profiler.sql|\n| storage.TABLE | table name in which profiling data will reside | measurements |\n\n### MongoDB\nIn order to use MongoDB, just specify it as the value of `storage.engine` directive as follows.\n\n```json\napp.config[\"flask_profiler\"] = {\n    \"storage\": {\n        \"engine\": \"mongodb\",\n    }\n}\n```\n\n### SQLAchemy\nIn order to use SQLAchemy, just specify it as the value of `storage.engine` directive as follows.\nAlso first create an empty database with the name \"flask_profiler\".\n\n```python\napp.config[\"flask_profiler\"] = {\n    \"storage\": {\n        \"engine\": \"sqlalchemy\",\n        \"db_url\": \"postgresql://user:pass@localhost:5432/flask_profiler\"  # optional, if no db_url specified then sqlite will be used.\n    }\n}\n```\n\n### Custom database engine\nSpecify engine as string module and class path.\n\n```json\napp.config[\"flask_profiler\"] = {\n    \"storage\": {\n        \"engine\": \"custom.project.flask_profiler.mysql.MysqlStorage\",\n        \"MYSQL\": \"mysql://user:password@localhost/flask_profiler\"\n    }\n}\n```\n\nThe other options are listed below.\n\n| Filter key   |      Description      |  Default\n|----------|-------------|------\n| storage.MONGO_URL | mongodb connection string | mongodb://localhost\n| storage.DATABASE | database name | flask_profiler\n| storage.COLLECTION | collection name | measurements\n\n### Sampling\nControl the number of samples taken by flask-profiler\n\nYou would want control over how many times should the flask profiler take samples while running in production mode.\nYou can supply a function and control the sampling according to your business logic.\n\nExample 1: Sample 1 in 100 times with random numbers\n```python\napp.config[\"flask_profiler\"] = {\n    \"sampling_function\": lambda: True if random.sample(list(range(1, 101)), 1) == [42] else False\n}\n```\n\nExample 2: Sample for specific users\n```python\napp.config[\"flask_profiler\"] = {\n    \"sampling_function\": lambda: True if user is 'divyendu' else False\n}\n```\n\nIf sampling function is not present, all requests will be sampled.\n\n### Changing flask-profiler endpoint root\nBy default, we can access flask-profiler at \u003cyour-app\u003e/flask-profiler\n\n```python\napp.config[\"flask_profiler\"] = {\n        \"endpointRoot\": \"secret-flask-profiler\"\n}\n```\n\n### Ignored endpoints\nFlask-profiler will try to track every endpoint defined so far when init_app() is invoked. If you want to exclude some of the endpoints, you can define matching regex for them as follows:\n\n```python\napp.config[\"flask_profiler\"] = {\n        \"ignore\": [\n\t        \"^/static/.*\",\n\t        \"/api/users/\\w+/password\"\n        ]\n}\n```\n\n\n## Contributing\n\nContributions are welcome!\n\nReview the [Contributing Guidelines](https://github.com/muatik/flask-profiler/wiki/Development) for details on how to:\n\n* Submit issues\n* Add solutions to existing challenges\n* Add new challenges\n\n## Authors\n* [Musafa Atik](https://www.linkedin.com/in/muatik)\n* Fatih Sucu\n* [Safa Yasin Yildirim](https://www.linkedin.com/in/safayasinyildirim)\n\n## License\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuatik%2Fflask-profiler","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmuatik%2Fflask-profiler","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmuatik%2Fflask-profiler/lists"}