{"id":365,"date":"2024-11-08T17:46:48","date_gmt":"2024-11-08T09:46:48","guid":{"rendered":"https:\/\/www.linn.pro\/?p=365"},"modified":"2024-11-08T17:46:48","modified_gmt":"2024-11-08T09:46:48","slug":"fastapi","status":"publish","type":"post","link":"https:\/\/www.linn.pro\/zh\/\u5f00\u53d1\u8005\/\u6846\u67b6\/365","title":{"rendered":"\u5feb\u901f\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3"},"content":{"rendered":"<p>FastAPI \u662f\u4e00\u4e2a\u73b0\u4ee3\u3001\u5feb\u901f\uff08\u9ad8\u6027\u80fd\uff09\u7684\u7f51\u7edc\u6846\u67b6\uff0c\u7528\u4e8e\u57fa\u4e8e\u6807\u51c6 Python \u7c7b\u578b\u63d0\u793a\u4f7f\u7528 Python \u6784\u5efa\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\u3002<\/p>\n<p>\u4e3b\u8981\u7279\u70b9\u6709<\/p>\n<ul>\n<li><strong class=\"dark:text-foreground\">\u5feb\u901f<\/strong>:\u6027\u80fd\u975e\u5e38\u9ad8\uff0c\u4e0e\u00a0<strong class=\"dark:text-foreground\">NodeJS<\/strong>\u00a0\u548c\u00a0<strong class=\"dark:text-foreground\">\u8f6c\u5230<\/strong>\u00a0(\u611f\u8c22 Starlette \u548c Pydantic\uff09\u3002\u00a0<a class=\"dark:text-foreground\" href=\"https:\/\/github.com\/tiangolo\/fastapi#performance\" target=\"_blank\" rel=\"noopener\">\u901f\u5ea6\u6700\u5feb\u7684 Python \u6846\u67b6\u4e4b\u4e00<\/a>.<\/li>\n<li><strong class=\"dark:text-foreground\">\u5feb\u901f\u7f16\u7801<\/strong>:\u5c06\u529f\u80fd\u5f00\u53d1\u901f\u5ea6\u63d0\u9ad8\u7ea6 200% \u81f3 300%\u3002*<\/li>\n<li><strong class=\"dark:text-foreground\">\u51cf\u5c11\u9519\u8bef<\/strong>:\u51cf\u5c11\u7ea6 40% \u7684\u4eba\u4e3a\uff08\u5f00\u53d1\u4eba\u5458\uff09\u9519\u8bef\u3002*<\/li>\n<li><strong class=\"dark:text-foreground\">\u76f4\u89c2<\/strong>:\u51fa\u8272\u7684\u7f16\u8f91\u5668\u652f\u6301\u3002\u5728\u4efb\u4f55\u5730\u65b9\u90fd\u80fd\u5b8c\u6210\u3002\u8c03\u8bd5\u65f6\u95f4\u66f4\u77ed<\/li>\n<li><strong class=\"dark:text-foreground\">\u7b80\u5355<\/strong>:\u8bbe\u8ba1\u6613\u4e8e\u4f7f\u7528\u548c\u5b66\u4e60\u3002\u51cf\u5c11\u9605\u8bfb\u6587\u6863\u7684\u65f6\u95f4\u3002<\/li>\n<li><strong class=\"dark:text-foreground\">\u77ed<\/strong>:\u5c3d\u91cf\u51cf\u5c11\u4ee3\u7801\u91cd\u590d\u3002\u6bcf\u4e2a\u53c2\u6570\u58f0\u660e\u5177\u6709\u591a\u79cd\u529f\u80fd\u3002\u51cf\u5c11\u9519\u8bef<\/li>\n<li><strong class=\"dark:text-foreground\">\u7a33\u5065<\/strong>:\u83b7\u53d6\u751f\u4ea7\u5c31\u7eea\u7684\u4ee3\u7801\u3002\u81ea\u52a8\u4ea4\u4e92\u5f0f\u6587\u6863\u3002<\/li>\n<li><strong class=\"dark:text-foreground\">\u57fa\u4e8e\u6807\u51c6<\/strong>:\u57fa\u4e8e\uff08\u5e76\u5b8c\u5168\u517c\u5bb9\uff09\u5f00\u653e\u5f0f\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\u6807\u51c6\uff1a\u00a0<a class=\"dark:text-foreground\" href=\"https:\/\/github.com\/OAI\/OpenAPI-Specification\" target=\"_blank\" rel=\"noopener\">OpenAPI<\/a>\u00a0(\u524d\u79f0\u65af\u74e6\u683c\uff09\u548c\u00a0<a class=\"dark:text-foreground\" href=\"https:\/\/json-schema.org\/\" target=\"_blank\" rel=\"noopener\">JSON \u6a21\u5f0f<\/a>.<\/li>\n<\/ul>\n<p>* \u6839\u636e\u5185\u90e8\u5f00\u53d1\u56e2\u961f\u7684\u6d4b\u8bd5\u7ed3\u679c\u8fdb\u884c\u4f30\u7b97\uff0c\u6784\u5efa\u751f\u4ea7\u5e94\u7528\u7a0b\u5e8f\u3002<\/p>","protected":false},"excerpt":{"rendered":"<p>FastAPI is a modern, fast (high-performance), web framework for building APIs with Python based on standard Python type hints. The key features are: Fast: Very high performance, on par with\u00a0NodeJS\u00a0and\u00a0Go\u00a0(thanks to Starlette and Pydantic).\u00a0One of the fastest Python frameworks available. Fast to code: Increase the speed to develop features by about 200% to 300%. * Fewer bugs: Reduce about 40% of human (developer) induced errors. * Intuitive: Great editor support. Completion everywhere. Less time debugging. Easy: Designed to be easy to use and learn. Less time reading docs. Short: Minimize code duplication. Multiple features from each parameter declaration. Fewer bugs. Robust: Get production-ready code. With automatic interactive documentation. Standards-based: Based on (and fully compatible with) the open standards for APIs:\u00a0OpenAPI\u00a0(previously...<\/p>","protected":false},"author":1,"featured_media":366,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[112],"tags":[174],"class_list":["post-365","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-framework","tag-fastapi"],"_links":{"self":[{"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/posts\/365","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/comments?post=365"}],"version-history":[{"count":0,"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/posts\/365\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/media\/366"}],"wp:attachment":[{"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/media?parent=365"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/categories?post=365"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linn.pro\/zh\/wp-json\/wp\/v2\/tags?post=365"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}