{"id":15288712,"url":"https://github.com/troyan-dy/fastapi-depends","last_synced_at":"2026-02-13T02:01:47.725Z","repository":{"id":57428480,"uuid":"445078956","full_name":"troyan-dy/fastapi-depends","owner":"troyan-dy","description":"You can use your FastAPI dependencies not only in FastAPI applications","archived":false,"fork":false,"pushed_at":"2022-01-09T22:50:30.000Z","size":27,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-27T13:58:15.215Z","etag":null,"topics":["async","async-await","asyncio","fastapi","lib","library","pip","pydantic","python","python-type","python-types","python-typing","python3"],"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/troyan-dy.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-01-06T07:23:11.000Z","updated_at":"2025-08-27T12:29:39.000Z","dependencies_parsed_at":"2022-09-02T18:31:07.030Z","dependency_job_id":null,"html_url":"https://github.com/troyan-dy/fastapi-depends","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/troyan-dy/fastapi-depends","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troyan-dy%2Ffastapi-depends","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troyan-dy%2Ffastapi-depends/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troyan-dy%2Ffastapi-depends/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troyan-dy%2Ffastapi-depends/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/troyan-dy","download_url":"https://codeload.github.com/troyan-dy/fastapi-depends/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/troyan-dy%2Ffastapi-depends/sbom","scorecard":{"id":899514,"data":{"date":"2025-08-11","repo":{"name":"github.com/troyan-dy/fastapi-depends","commit":"aa42aec82e36cc7be0ddc5a51a331563ac412708"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":2,"checks":[{"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":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"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":0,"reason":"Found 0/11 approved changesets -- score normalized to 0","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":"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":"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":"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":"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":"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":2,"reason":"8 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: PYSEC-2024-48 / GHSA-fj7x-q9j7-g6q6","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-mr82-8j83-vxmv","Warn: Project is vulnerable to: GHSA-2c2j-9gv5-cj73","Warn: Project is vulnerable to: PYSEC-2023-48 / GHSA-74m5-2c7w-9w3x","Warn: Project is vulnerable to: GHSA-f96h-pmfr-66vw","Warn: Project is vulnerable to: PYSEC-2023-83 / GHSA-v5gw-mw7f-84px"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-24T15:02:03.567Z","repository_id":57428480,"created_at":"2025-08-24T15:02:03.567Z","updated_at":"2025-08-24T15:02:03.567Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29392774,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-13T00:53:09.511Z","status":"online","status_checked_at":"2026-02-13T02:00:10.076Z","response_time":78,"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":["async","async-await","asyncio","fastapi","lib","library","pip","pydantic","python","python-type","python-types","python-typing","python3"],"created_at":"2024-09-30T15:52:26.979Z","updated_at":"2026-02-13T02:01:47.646Z","avatar_url":"https://github.com/troyan-dy.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fastapi-depends\n\nYou can use your FastAPI dependencies not only in FastAPI applications\n\n[PYPI](https://pypi.org/project/fastapi-depends/)\n\n## Install\n\npip\n\n```bash\npip install fastapi-depends\n```\n\npoetry\n\n```bash\npoetry add fastapi-depends\n```\n\n## Usage\n\n### Simple\n\nSimple example for calling dependencies, without binding to `fastapi.Request` object\n\n```python\nimport asyncio\n\nfrom fastapi import Depends\n\nfrom fastapi_depends import inject\n\n\nasync def str_dep():\n    return \"str_dep\"\n\n\n@inject\nasync def main(pos_value: str, regular_value: str, str_dep=Depends(str_dep)):\n    return (pos_value, regular_value, str_dep)\n\n\nif __name__ == \"__main__\":\n    result = asyncio.run(main(\"pos_value\", regular_value=\"regular_value\"))\n    print(f\"{result=}\")\n\n```\n\n### With your application\n\nExample of getting a `fastapi.Request` object with one property `app`\n\n```python\nimport asyncio\n\nfrom fastapi import Depends, Request\n\nfrom fastapi_depends import DepContainer\n\ncontainer = DepContainer()\n\n\nasync def str_dep(request: Request):\n    return request.app.app_value\n\n\n@container.inject\nasync def main(pos_value: str, regular_value: str, str_dep=Depends(str_dep)):\n    return (pos_value, regular_value, str_dep)\n\n\nclass MyApp:\n    def __init__(self, app_value):\n        self.app_value = app_value\n\n\napp = MyApp(app_value=\"app_value\")\ncontainer.setup_app(app)\n\nif __name__ == \"__main__\":\n    result = asyncio.run(main(\"pos_value\", regular_value=\"regular_value\"))\n    print(f\"{result=}\")\n\n```\n\n### Register the method in your application\n\nAn example similar to the previous one, but only for a method you can specify a key with which it will be written in `DepContainer.callback_map`\n\n```python\nimport asyncio\n\nfrom fastapi import Depends, Request\n\nfrom fastapi_depends import DepContainer\n\n\nasync def str_dep(request: Request):\n    return request.app.app_value\n\n\ncontainer = DepContainer()\n\n\n@container.register(\"my_key\")\nasync def main(pos_value: str, regular_value: str, str_dep=Depends(str_dep)):\n    return (pos_value, regular_value, str_dep)\n\n\nclass MyApp:\n    def __init__(self, app_value):\n        self.app_value = app_value\n\n\napp = MyApp(app_value=\"app_value\")\ncontainer.setup_app(app)\n\nif __name__ == \"__main__\":\n    result = asyncio.run(container.callback_map[\"my_key\"](\"pos_value\", regular_value=\"regular_value\"))\n    print(f\"{result=}\")\n\n\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroyan-dy%2Ffastapi-depends","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftroyan-dy%2Ffastapi-depends","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftroyan-dy%2Ffastapi-depends/lists"}