{"id":29005346,"url":"https://github.com/vst/openfaas-template-python-fastapi","last_synced_at":"2025-10-11T14:33:16.642Z","repository":{"id":51352062,"uuid":"248120182","full_name":"vst/openfaas-template-python-fastapi","owner":"vst","description":"Experimental and Opinionated OpenFAAS Template (Python + FastAPI)","archived":true,"fork":false,"pushed_at":"2021-05-13T20:57:37.000Z","size":25,"stargazers_count":3,"open_issues_count":2,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-25T11:06:55.565Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Dockerfile","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vst.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-03-18T02:29:37.000Z","updated_at":"2024-02-06T05:06:32.000Z","dependencies_parsed_at":"2022-09-24T21:50:25.631Z","dependency_job_id":null,"html_url":"https://github.com/vst/openfaas-template-python-fastapi","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vst/openfaas-template-python-fastapi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fopenfaas-template-python-fastapi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fopenfaas-template-python-fastapi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fopenfaas-template-python-fastapi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fopenfaas-template-python-fastapi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vst","download_url":"https://codeload.github.com/vst/openfaas-template-python-fastapi/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vst%2Fopenfaas-template-python-fastapi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279007450,"owners_count":26084313,"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-10-11T02:00:06.511Z","response_time":55,"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":[],"created_at":"2025-06-25T11:06:03.235Z","updated_at":"2025-10-11T14:33:16.628Z","avatar_url":"https://github.com/vst.png","language":"Dockerfile","funding_links":[],"categories":[],"sub_categories":[],"readme":"# OpenFAAS Template using FastAPI Application as Upstream\n\n![](https://img.shields.io/github/v/release/vst/openfaas-template-python-fastapi)\n\nThis template provides an upstream FastAPI application as a\nPython-based OpenFAAS function. Therefore:\n\n1. This function is deployed using `of-watchdog` instead of the classic `watchdog`.\n2. Multiple endpoints can be defined for functions using this template.\n3. (Almost) all essential Web application functionalities are possible\n   (various HTTP verbs, full control over HTTP headers etc).\n\n## Development Requirements\n\n1. Python 3.7\n2. Pipenv\n3. Docker\n4. OpenFAAS CLI\n\n## Quickstart\n\nCreate a directory and change to it:\n\n```\nmkdir sandbox\ncd sandbox\n```\n\nPull this template:\n\n```\nfaas-cli template pull \"https://github.com/vst/openfaas-template-python-fastapi#0.0.3\"\n```\n\nCreate your new OpenFAAS function, namely `myfunc`:\n\n```\nfaas-cli new myfunc --lang vst-python-fastapi\n```\n\nChange directory to your new OpenFAAS function:\n\n```\ncd myfunc\n```\n\nInstall all your production and development dependencies:\n\n```\npipenv install --dev\n```\n\nRun tests:\n\n```\ntox\n```\n\nNow you can make changes to code and test as you wish.\n\nTo build the OpenFAAS function:\n\n```\ncd ..\nfaas-cli build -f myfunc.yml\n```\n\nRun the Docker image that is built as an OpenFAAS function:\n\n```\ndocker run --rm -p 8000:8080 myfunc\n```\n\nNow you can visit [http://localhost:8000](http://localhost:8000) or use `curl` to check your function live:\n\n```\ncurl -D - http://localhost:8000\n```\n\n## Motivation\n\nIt is not so difficult to build such a function with the [official\n*dockerfile* OpenFAAS\ntemplate](https://github.com/openfaas/templates/tree/master/template/dockerfile). The\nmotivation behind this very template is to pull in all required\ndevelopment dependencies and setup the development environment with\nsane configurations like you would do for a typical Python\napplication:\n\n0. Pipenv\n1. **IDE configuration template:** VS Code workspace\n2. **Python development dependencies:**\n    - black (configured)\n    - flake8 (configured)\n    - ipython\n    - isort (configured)\n    - mypy (configured)\n    - pylint (configured)\n    - pytest (configured)\n    - sphinx (not configured)\n    - tox (configured)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvst%2Fopenfaas-template-python-fastapi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvst%2Fopenfaas-template-python-fastapi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvst%2Fopenfaas-template-python-fastapi/lists"}