{"id":20691271,"url":"https://github.com/jtom38/fastapi_healthcheck","last_synced_at":"2025-09-03T04:31:24.253Z","repository":{"id":43152996,"uuid":"433620224","full_name":"jtom38/fastapi_healthcheck","owner":"jtom38","description":"Easy to use health check for your FastAPI.","archived":false,"fork":false,"pushed_at":"2024-06-27T13:00:13.000Z","size":44,"stargazers_count":40,"open_issues_count":6,"forks_count":10,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-25T06:48:34.511Z","etag":null,"topics":["fastapi","healthcheck","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/jtom38.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,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-11-30T23:34:46.000Z","updated_at":"2025-07-26T16:49:14.000Z","dependencies_parsed_at":"2024-06-25T18:13:58.607Z","dependency_job_id":"0be37aac-6dbb-4c47-9217-e7898439ed89","html_url":"https://github.com/jtom38/fastapi_healthcheck","commit_stats":{"total_commits":27,"total_committers":4,"mean_commits":6.75,"dds":0.2222222222222222,"last_synced_commit":"6f312af3db246a5157130516458143be73660cc5"},"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"purl":"pkg:github/jtom38/fastapi_healthcheck","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtom38%2Ffastapi_healthcheck","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtom38%2Ffastapi_healthcheck/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtom38%2Ffastapi_healthcheck/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtom38%2Ffastapi_healthcheck/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jtom38","download_url":"https://codeload.github.com/jtom38/fastapi_healthcheck/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jtom38%2Ffastapi_healthcheck/sbom","scorecard":{"id":540092,"data":{"date":"2025-08-11","repo":{"name":"github.com/jtom38/fastapi_healthcheck","commit":"a8a871bf3c2a09bc615955ed044da6ad7c2eb452"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":4.5,"checks":[{"name":"Code-Review","score":2,"reason":"Found 8/28 approved changesets -- score normalized to 2","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":"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":"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":"Token-Permissions","score":9,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Info: jobLevel 'contents' permission set to 'read': .github/workflows/build.yaml:13","Info: jobLevel 'contents' permission set to 'read': .github/workflows/publish.yaml:15","Warn: no topLevel permission defined: .github/workflows/build.yaml:1","Warn: no topLevel permission defined: .github/workflows/publish.yaml: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":"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":"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/build.yaml:17: update your workflow using https://app.stepsecurity.io/secureworkflow/jtom38/fastapi_healthcheck/build.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build.yaml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/jtom38/fastapi_healthcheck/build.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/jtom38/fastapi_healthcheck/publish.yaml/master?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/publish.yaml:22: update your workflow using https://app.stepsecurity.io/secureworkflow/jtom38/fastapi_healthcheck/publish.yaml/master?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/build.yaml:26","Warn: pipCommand not pinned by hash: .github/workflows/publish.yaml:28","Info:   0 out of   4 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   2 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":"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":"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":"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":-1,"reason":"internal error: error during branchesHandler.setup: internal error: githubv4.Query: Resource not accessible by integration","details":null,"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":6,"reason":"4 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-38","Warn: Project is vulnerable to: PYSEC-2024-60 / GHSA-jjg7-2v4v-x38h","Warn: Project is vulnerable to: GHSA-2c2j-9gv5-cj73","Warn: Project is vulnerable to: GHSA-f96h-pmfr-66vw"],"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 27 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-20T07:59:46.023Z","repository_id":43152996,"created_at":"2025-08-20T07:59:46.024Z","updated_at":"2025-08-20T07:59:46.024Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273391898,"owners_count":25097254,"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","status":"online","status_checked_at":"2025-09-03T02:00:09.631Z","response_time":76,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["fastapi","healthcheck","python"],"created_at":"2024-11-16T23:16:04.077Z","updated_at":"2025-09-03T04:31:23.916Z","avatar_url":"https://github.com/jtom38.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi_healthcheck\n\nEasy to use health check for your FastAPI.  This is the root module that will let you add implement and expand your usage of health checks, with FastAPI.\n\nThis module does not contain any service checkers, but you can easily add them.  The other modules are not in this root module due to different dependencies required for each one.  This is made so you only bring in the packages that you need to not add extra packages.\n\n## Install\n\n`pip install fastapi-healthcheck` or `poetry add fastapi-healthcheck`\n\n## Adding Health Checks\n\nHere is what you need to get started.\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi_healthcheck import HealthCheckFactory, healthCheckRoute\nfrom fastapi_healthcheck_sqlalchemy import HealthCheckSQLAlchemy\n\napp = FastAPI()\n\n# Add Health Checks\n_healthChecks = HealthCheckFactory()\n\n# SQLAlchemy comes from fastapi-healthcheck-sqlalchemy\n_healthChecks.add(HealthCheckSQLAlchemy(alias='postgres db', connectionUri=cs.value, table=SmtpContactsSqlModel, tags=('postgres', 'db', 'sql01')))\n\n# This will check external URI and validate the response that is returned.\n# fastapi-healthcheck-uri\n_healthChecks.add(HealthCheckUri(alias='reddit', connectionUri=\"https://www.reddit.com/r/aww.json\", tags=('external', 'reddit', 'aww')))\napp.add_api_route('/health', endpoint=healthCheckRoute(factory=_healthChecks))\n\n```\n\n## Returned Data\n\nWhen you request your health check, it will go and check all the entries that have been submitted and run a basic query against them.  If they come back as expected, then a status code is 200.  But if it runs into an error, it will return a 500 error.\n\n```json\n\n{\n    \"status\":\"Healthy\",\n    \"totalTimeTaken\":\"0:00:00.671642\",\n    \"entities\":[\n        {\n            \"alias\":\"postgres db\",\n            \"status\":\"Healthy\",\n            \"timeTaken\":\"0:00:00.009619\",\n            \"tags\":[\"postgres\",\"db\",\"sql01\"]\n        },\n        {\n            \"alias\":\"reddit\",\n            \"status\":\"Unhealthy\",\n            \"timeTaken\":\"0:00:00.661716\",\n            \"tags\":[\"external\",\"reddit\",\"aww\"]\n        }\n    ]\n}\n```\n\n## Available Modules\n\n* [fastapi_healthcheck_sqlalchemy](https://github.com/jtom38/fastapi_healthcheck_sqlalchemy)\n* [fastapi_healthcheck_uri](https://github.com/jtom38/fastapi_healthcheck_uri)\n* [fastapi_healthcheck_mongodb](https://github.com/anesmemisevic/fastapi_healthcheck_mongodb)\n\nIf you have made a public service module and want to see it on this list, please open a new issue so we can add it to the list.\n\n## Writing a custom module\n\nYou can easily expand on this core module to add other health checks for other services.  Generate a new service that pulls in [HealthCheckInterface](https://github.com/jtom38/fastapi_healthcheck/blob/master/fastapi_healthcheck/domain.py#L6) and [HealthCheckBase](https://github.com/jtom38/fastapi_healthcheck/blob/master/fastapi_healthcheck/service.py#L75).  With those, you can build the respective class around the interface.\n\nOnce you have your service ready to go, add it to the HealthCheckFactory, and let the testing start.\n\nIf you would like to see an example of a custom service see [fastapi_healthcheck_sqlalchemy](https://github.com/jtom38/fastapi_healthcheck_sqlalchemy/blob/master/fastapi_healthcheck_sqlalchemy/service.py).  This will give you a better example of what you need to do to create your own module to interface with healthcheck.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtom38%2Ffastapi_healthcheck","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjtom38%2Ffastapi_healthcheck","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjtom38%2Ffastapi_healthcheck/lists"}