DRF SPECTACULAR EXTRAS
Additional extensions and utilities for drf-spectacular.
Features
🚀 Additional API Documentation UIs
Scalar UI Integration - Modern, interactive API documentation with Scalar
Easy integration with existing drf-spectacular setups
Customizable UI settings and themes
🔧 Enhanced Utilities
Extended configuration options for API documentation
Additional view classes and mixins
Better developer experience tools
Installation
pip install drf-spectacular-extras
Quick Start
Add drf_spectacular_extras to your INSTALLED_APPS:
INSTALLED_APPS = [
# ...
'drf_spectacular',
'drf_spectacular_extras',
# ...
]
Configure the Scalar UI (optional):
SPECTACULAR_EXTRAS_SETTINGS = {
'SCALAR_UI_SETTINGS': {
'theme': 'purple',
'layout': 'modern',
# Add any Scalar configuration options
},
}
Add Scalar UI to your URLs:
from drf_spectacular_extras.views import SpectacularScalarView
urlpatterns = [
# Your existing spectacular URLs
path('api/schema/', SpectacularAPIView.as_view(), name='schema'),
# Add Scalar UI
path('api/schema/scalar/',
SpectacularScalarView.as_view(url_name='schema'),
name='scalar'),
]
Visit /api/schema/scalar/ to see your API documentation with Scalar UI! 🎉
Configuration
Scalar UI Settings
You can customize the Scalar UI by configuring SPECTACULAR_EXTRAS_SETTINGS:
SPECTACULAR_EXTRAS_SETTINGS = {
'SCALAR_UI_SETTINGS': {
'theme': 'purple', # Theme: 'default', 'purple', 'blue', etc.
'layout': 'modern', # Layout style
'showSidebar': True, # Show/hide sidebar
'hideDownloadButton': False, # Hide download button
'searchHotKey': 'k', # Search hotkey
# See Scalar docs for all available options
},
'SCALAR_DIST': 'https://cdn.jsdelivr.net/npm/@scalar/api-reference@latest',
}
Requirements
Python 3.10+
Django 4.2+
djangorestframework 3.14+
drf-spectacular 0.28.0+
Why DRF Spectacular Extras?
While drf-spectacular provides excellent OpenAPI 3 schema generation and comes with Swagger UI and ReDoc, this package extends it with:
Modern UI Options: Access to cutting-edge documentation UIs like Scalar
Enhanced Developer Experience: Additional utilities and configuration options
Easy Integration: Drop-in compatibility with existing drf-spectacular setups
Active Maintenance: Regular updates to support the latest UI frameworks
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development setup:
git clone https://github.com/huynguyengl99/drf-spectacular-extras.git
cd drf-spectacular-extras
uv sync --all-extras
docker compose up # Start test database
python sandbox/manage.py migrate
python sandbox/manage.py runserver
Documentation
Please visit DRF Spectacular Extras docs for complete documentation.
License
This project is licensed under the MIT License - see the LICENSE file for details.
Acknowledgments
Built on top of the excellent drf-spectacular package
Scalar UI integration powered by Scalar
Metadata
Release files for drf-spectacular-extras 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| drf_spectacular_extras-0.1.0.tar.gz | 6.6 kB | With provenance | Details for drf_spectacular_extras-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| drf_spectacular_extras-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for drf_spectacular_extras-0.1.0-py3-none-any.whl |
Total release size: 14.2 kB
Release files / drf_spectacular_extras-0.1.0.tar.gz
| Download URL | drf_spectacular_extras-0.1.0.tar.gz |
|---|---|
| Size | 6.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
127efcb9be393e0ad710a3657554ec059f8ad62e281a435ea45917b58d06b52a
|
|
BLAKE2b-256 checksum How to use checksums |
636c69eca8511dac17ab21c89c98ad3cbc015b97cd9939105d67017226f1df81
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 15, 2025.
Transparency logRelease files / drf_spectacular_extras-0.1.0-py3-none-any.whl
| Download URL | drf_spectacular_extras-0.1.0-py3-none-any.whl |
|---|---|
| Size | 7.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
806e329182eb8237de90222e00ca4f5d521c2b4d50f7f73a1064b71140fe67f6
|
|
BLAKE2b-256 checksum How to use checksums |
b412154cfa9cd3c811a79e041aaefcfa49020870486857a8b0cacef07ec014c2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.12.9
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 15, 2025.
Transparency logSecurity for drf-spectacular-extras 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for drf_spectacular_extras-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Jun 15, 2025.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.