Home
A simple async API framework based on Starlette.
Star OpenAPI is a web API framework based on Starlette. It uses Pydantic to verify data and automatic generation of interaction documentation.
The key features are:
-
Easy to code: Easy to use and easy to learn
-
Standard document specification: Based on OpenAPI Specification
-
Interactive OpenAPI documentation: Swagger, Redoc, RapiDoc, RapiPdf, Scalar, Elements
-
Data validation: Fast data verification based on Pydantic
-
Websocket: Support for websocket
Requirements⚓︎
Python 3.11+
star-openapi is dependent on the following libraries:
Installation⚓︎
1 | |
Optional dependencies
httpx- Required if you want to use theTestClient.python-multipart- Required if you want to support form parsing, withrequest.form().itsdangerous- Required forSessionMiddlewaresupport.pyyaml- Required forSchemaGeneratorsupport.
You can install all of these with pip install star-openapi[full].
- star-openapi-plugins Provide OpenAPI UI for star-openapi.
You can install all of these with pip install star-openapi[swagger,redoc,rapidoc,rapipdf,scalar,elements].
A Simple Example⚓︎
Here's a simple example, further go to the Example.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 | |
API Document⚓︎
Run the simple example, and go to http://127.0.0.1:8000/openapi.
OpenAPI UI plugins are optional dependencies that require manual installation.
pip install -U star-openapi[swagger,redoc,rapidoc,rapipdf,scalar,elements]More optional ui templates goto the document about UI_Templates.
