This plugin provides an easy way to render a beautiful API reference based on a OpenAPI/Swagger file with FastAPI.
Project description
Scalar FastAPI API Reference Plugin
Installation
pip install scalar-fastapi
Usage
FastAPI makes it super easy to enable scalar with their out of the box OpenAPI support
from fastapi import FastAPI
from scalar_fastapi import get_scalar_api_reference
app = FastAPI()
@app.get("/")
def read_root():
return {"Hello": "World"}
@app.get("/scalar", include_in_schema=False)
async def scalar_html():
return get_scalar_api_reference(
openapi_url=app.openapi_url,
title=app.title,
)
Configuration
Currently available configuration options are listed below.
layout
(defaultLayout.MODERN
)show_sidebar
(defualttrue
)hide_download_button
(defaultfalse
)hide_models
(defaultfalse
)dark_mode
(defaulttrue
)search_hot_key
(defaultSearchHotKey.K
)hidden_clients
(default[]
)servers
(default[]
)default_open_all_tags
(defaultfalse
)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
scalar_fastapi-1.0.3.tar.gz
(4.1 kB
view details)
Built Distribution
File details
Details for the file scalar_fastapi-1.0.3.tar.gz
.
File metadata
- Download URL: scalar_fastapi-1.0.3.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e9cb8398e298cd435a0171eebe1675b8899eb21e47c238db0d48783143f0ffb |
|
MD5 | cfae36c0180df65daa27479577e97356 |
|
BLAKE2b-256 | 2c0408ae9e86f24cd9b43bc5b2068fc5d1dcd3e7efa6db860290734d7d742512 |
File details
Details for the file scalar_fastapi-1.0.3-py3-none-any.whl
.
File metadata
- Download URL: scalar_fastapi-1.0.3-py3-none-any.whl
- Upload date:
- Size: 4.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.11.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a47a140795097ad034518ce0e32940f2c54f0f4bc60e4c3289ca30a7e6f954d |
|
MD5 | 714ad80e7cb0137a5a99adea0a6fcaec |
|
BLAKE2b-256 | 6d9eca0ffc3fc4788c6e1367b96a70f2d6ee33f91d580664a8142ba7ee292ef2 |