# Stopments
Stoplight elements static files
Refered from FastAPI's #5168 PR
It includes the following files:
- `styles.min.css`
- `web-components.min.js`
- `favicon.ico`
- `scalar-api-reference.js` (for [scalar](https://scalar.com/))
The static files were collected on the same date as this package version.
## Installation
```bash
pip install stopments
```
## Usage
```python
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from stopments import get_stoplight_elements_html
app = FastAPI(docs_url=None, redoc_url=None)
@app.get("/docs/", include_in_schema=False)
async def docs():
html = get_stoplight_elements_html(
openapi_url=app.openapi_url or "/openapi.json",
title="API Documentation",
)
return HTMLResponse(content=html)
```
or you can use embedded static files
```python
from fastapi import FastAPI
from fastapi.responses import HTMLResponse
from fastapi.staticfiles import StaticFiles
from stopments import get_stoplight_elements_html
app = FastAPI(docs_url=None, redoc_url=None)
app.mount("/static", StaticFiles(packages=[("stopments", "static")]))
@app.get("/docs/", include_in_schema=False)
async def docs():
html = get_stoplight_elements_html(
openapi_url=app.openapi_url or "/openapi.json",
title="API Documentation",
stoplight_elements_css_url="/static/styles.min.css",
stoplight_elements_js_url="/static/web-components.min.js",
stoplight_elements_favicon_url="/static/favicon.ico",
)
return HTMLResponse(content=html)
```
## References
- [FastAPI PR #5168](https://github.com/fastapi/fastapi/pull/5168)
- [Stoplight Elements Docs - Usage with HTML](https://docs.stoplight.io/docs/elements/a71d7fcfefcd6-elements-in-html)
Raw data
{
"_id": null,
"home_page": null,
"name": "stopments",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "stoplight, elements, openapi, swagger",
"author": "Dowon",
"author_email": "Dowon <ks2515@naver.com>",
"download_url": "https://files.pythonhosted.org/packages/68/a5/f6b966a97f2e79e20c40a12967696d02dd92ab5a9398343d7138dda6004f/stopments-25.9.1.tar.gz",
"platform": null,
"description": "# Stopments\n\nStoplight elements static files\n\nRefered from FastAPI's #5168 PR\n\nIt includes the following files:\n\n- `styles.min.css`\n- `web-components.min.js`\n- `favicon.ico`\n- `scalar-api-reference.js` (for [scalar](https://scalar.com/))\n\nThe static files were collected on the same date as this package version.\n\n## Installation\n\n```bash\npip install stopments\n```\n\n## Usage\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi.responses import HTMLResponse\nfrom fastapi.staticfiles import StaticFiles\n\nfrom stopments import get_stoplight_elements_html\n\napp = FastAPI(docs_url=None, redoc_url=None)\n\n@app.get(\"/docs/\", include_in_schema=False)\nasync def docs():\n html = get_stoplight_elements_html(\n openapi_url=app.openapi_url or \"/openapi.json\",\n title=\"API Documentation\",\n )\n return HTMLResponse(content=html)\n```\n\nor you can use embedded static files\n\n```python\nfrom fastapi import FastAPI\nfrom fastapi.responses import HTMLResponse\nfrom fastapi.staticfiles import StaticFiles\n\nfrom stopments import get_stoplight_elements_html\n\napp = FastAPI(docs_url=None, redoc_url=None)\napp.mount(\"/static\", StaticFiles(packages=[(\"stopments\", \"static\")]))\n\n@app.get(\"/docs/\", include_in_schema=False)\nasync def docs():\n html = get_stoplight_elements_html(\n openapi_url=app.openapi_url or \"/openapi.json\",\n title=\"API Documentation\",\n stoplight_elements_css_url=\"/static/styles.min.css\",\n stoplight_elements_js_url=\"/static/web-components.min.js\",\n stoplight_elements_favicon_url=\"/static/favicon.ico\",\n )\n return HTMLResponse(content=html)\n```\n\n## References\n\n- [FastAPI PR #5168](https://github.com/fastapi/fastapi/pull/5168)\n- [Stoplight Elements Docs - Usage with HTML](https://docs.stoplight.io/docs/elements/a71d7fcfefcd6-elements-in-html)\n",
"bugtrack_url": null,
"license": "BSD-2-Clause",
"summary": "Stoplight elements html",
"version": "25.9.1",
"project_urls": {
"Repository": "https://github.com/Bing-su/stopments"
},
"split_keywords": [
"stoplight",
" elements",
" openapi",
" swagger"
],
"urls": [
{
"comment_text": null,
"digests": {
"blake2b_256": "d80920a34a40479de2d82f8ef9179fcb9182d7bc67ad369919ff1d81547bbb20",
"md5": "893aa2c8812d624f1fc043fbe8fba45a",
"sha256": "18fe4bfa8d3611a365b99b6fb96635abe285eda4943f46bf884ba7b428c6f2de"
},
"downloads": -1,
"filename": "stopments-25.9.1-py3-none-any.whl",
"has_sig": false,
"md5_digest": "893aa2c8812d624f1fc043fbe8fba45a",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 1516683,
"upload_time": "2025-09-01T08:18:08",
"upload_time_iso_8601": "2025-09-01T08:18:08.515517Z",
"url": "https://files.pythonhosted.org/packages/d8/09/20a34a40479de2d82f8ef9179fcb9182d7bc67ad369919ff1d81547bbb20/stopments-25.9.1-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": null,
"digests": {
"blake2b_256": "68a5f6b966a97f2e79e20c40a12967696d02dd92ab5a9398343d7138dda6004f",
"md5": "7b952fd04bc584b35a18c910a75a74ef",
"sha256": "a32a528ae5ea6858e4412633a8d8d4040d8d6940c66a5783c3ccbd669f6a0f49"
},
"downloads": -1,
"filename": "stopments-25.9.1.tar.gz",
"has_sig": false,
"md5_digest": "7b952fd04bc584b35a18c910a75a74ef",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 1516590,
"upload_time": "2025-09-01T08:18:09",
"upload_time_iso_8601": "2025-09-01T08:18:09.970807Z",
"url": "https://files.pythonhosted.org/packages/68/a5/f6b966a97f2e79e20c40a12967696d02dd92ab5a9398343d7138dda6004f/stopments-25.9.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-01 08:18:09",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "Bing-su",
"github_project": "stopments",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "stopments"
}