From: Sebastián Ramírez Date: Tue, 18 Dec 2018 20:31:01 +0000 (+0400) Subject: Add Third Parties section to docs X-Git-Tag: 0.9.10~20^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=refs%2Fpull%2F285%2Fhead;p=thirdparty%2Fstarlette.git Add Third Parties section to docs --- diff --git a/docs/thirdparties.md b/docs/thirdparties.md new file mode 100644 index 00000000..99f6abf5 --- /dev/null +++ b/docs/thirdparties.md @@ -0,0 +1,86 @@ + +Starlette has a rapidly growing community of developers, building tools that integrate into Starlette, tools that depend on Starlette, etc. + +Here are some of those third party packages: + +## Plugins + +### Starlette APISpec + +Link: https://github.com/Woile/starlette-apispec + +Easy APISpec integration for Starlette. + +Document your REST API built with Starlette by declaring OpenAPI (Swagger) schemas in YAML format in your endpoints' docstrings. + +### Starlette API + +Link: https://github.com/PeRDy/starlette-api + +That library aims to bring a layer on top of Starlette framework to provide useful mechanism for building APIs. It's based on API Star, inheriting some nice ideas like: + +* **Schema system** based on Marshmallow that allows to declare the inputs and outputs of endpoints and provides a reliable way of validate data against those schemas. +* **Dependency Injection** that ease the process of managing parameters needed in endpoints. +* **Components** as the base of the plugin ecosystem, allowing you to create custom or use those already defined in your endpoints, injected as parameters. +* **Starlette ASGI** objects like `Request`, `Response`, `Session` and so on are defined as components and ready to be injected in your endpoints. + + +## Frameworks + +### Responder + +Link: https://github.com/kennethreitz/responder + +A familiar HTTP Service Framework for Python. + +* Flask-style route expression, with new capabilities -- all while using Python 3.6+'s new f-string syntax. +* Falcon's "every request and response is passed into to each view and mutated" methodology. +* Support for YAML by default. +* Several of Starlette's optional dependencies pre-installed, like: + * Production static file server. + * Uvicorn server. + * GraphQL support, via Graphene. + +```Python +import responder + +api = responder.API() + +@api.route("/{greeting}") +async def greet_world(req, resp, *, greeting): + resp.text = f"{greeting}, world!" + +if __name__ == '__main__': + api.run() +``` + +### FastAPI + +Link: https://github.com/tiangolo/fastapi + +High performance, easy to learn, fast to code, ready for production. + +An API framework inspired by **APIStar**'s previous server system with type declarations for route parameters, based on the OpenAPI specification version 3.0.0+ (with JSON Schema), powered by **Pydantic** for the data handling. + +Use standard Python 3.6+ types as parameters to get: + +* Autocomplete everywhere. +* Data conversion. +* Data validation. +* Automatic documentation with OpenAPI (and JSON Schema), based on the same Python types. + +Includes: + +* A simple but powerful **dependency injection** system. +* Automatic interactive documentation (based on Swagger UI and ReDoc). +* Security utilities, including **OAuth2** with **JWT tokens**. + +```Python +from fastapi import FastAPI + +app = FastAPI() + +@app.get('/') +def read_root(): + return {'hello': 'world'} +``` diff --git a/mkdocs.yml b/mkdocs.yml index 95b9f901..fb6b82e5 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -28,6 +28,7 @@ nav: - Exceptions: 'exceptions.md' - Configuration: 'config.md' - Test Client: 'testclient.md' + - Third Parties: 'thirdparties.md' - Release Notes: 'release-notes.md' markdown_extensions: