Syneto-branded themes and utilities for OpenAPI documentation tools
Project description
Syneto OpenAPI Themes
Syneto-branded themes and utilities for OpenAPI documentation tools, built on top of OpenAPIPages.
Features
- 🎨 Syneto Branding - Official Syneto colors, fonts, and styling
- 🚀 Multiple Documentation Tools - Support for RapiDoc, SwaggerUI, ReDoc, Elements, and Scalar
- 🔧 Easy Integration - Drop-in replacement for custom documentation implementations
- 🎯 FastAPI Ready - Seamless integration with FastAPI applications
- 📱 Responsive Design - Mobile-friendly documentation interfaces
- 🔐 Authentication Support - Built-in JWT and API key authentication handling
- ⚡ Zero Dependencies - Lightweight with minimal dependencies
Installation
pip install syneto-openapi-themes
For FastAPI integration:
pip install syneto-openapi-themes[fastapi]
For all features:
pip install syneto-openapi-themes[all]
Quick Start
Basic Usage
from fastapi import FastAPI
from syneto_openapi_themes import add_syneto_rapidoc
app = FastAPI(title="My API")
# Add Syneto-branded RapiDoc
add_syneto_rapidoc(app, docs_url="/docs")
Custom Branding
from syneto_openapi_themes import (
SynetoBrandConfig,
SynetoTheme,
add_syneto_rapidoc
)
# Custom brand configuration
brand_config = SynetoBrandConfig(
theme=SynetoTheme.LIGHT,
company_name="My Company",
logo_url="/static/my-logo.svg"
)
add_syneto_rapidoc(app, brand_config=brand_config)
Multiple Documentation Tools
from syneto_openapi_themes import add_all_syneto_docs
# Add all documentation tools
add_all_syneto_docs(
app,
rapidoc_url="/docs",
swagger_url="/swagger",
redoc_url="/redoc",
elements_url="/elements",
scalar_url="/scalar"
)
Using the Docs Manager (Recommended)
from syneto_openapi_themes import SynetoDocsManager
# Create docs manager
docs_manager = SynetoDocsManager(app)
# Add all documentation tools with index page
docs_manager.add_all().add_docs_index("/documentation")
# Or add specific tools
docs_manager.add_rapidoc("/docs").add_swagger("/swagger")
Documentation Tools
RapiDoc
Modern, responsive API documentation with interactive features.
from syneto_openapi_themes import SynetoRapiDoc
rapidoc = SynetoRapiDoc(
openapi_url="/openapi.json",
title="API Documentation"
)
SwaggerUI
The classic Swagger interface with Syneto theming.
from syneto_openapi_themes import SynetoSwaggerUI
swagger = SynetoSwaggerUI(
openapi_url="/openapi.json",
title="API Documentation"
)
ReDoc
Clean, three-panel API documentation.
from syneto_openapi_themes import SynetoReDoc
redoc = SynetoReDoc(
openapi_url="/openapi.json",
title="API Documentation"
)
Elements
Modern API documentation by Stoplight.
from syneto_openapi_themes import SynetoElements
elements = SynetoElements(
openapi_url="/openapi.json",
title="API Documentation"
)
Scalar
Beautiful, interactive API documentation.
from syneto_openapi_themes import SynetoScalar
scalar = SynetoScalar(
openapi_url="/openapi.json",
title="API Documentation"
)
Brand Configuration
Default Syneto Theme
from syneto_openapi_themes import SynetoBrandConfig
# Default dark theme
config = SynetoBrandConfig()
# Light theme
config = SynetoBrandConfig(theme=SynetoTheme.LIGHT)
Custom Configuration
config = SynetoBrandConfig(
# Branding
company_name="My Company",
logo_url="/static/logo.svg",
favicon_url="/static/favicon.ico",
# Theme
theme=SynetoTheme.DARK,
primary_color="#ad0f6c",
background_color="#07080d",
# Typography
regular_font="'Inter', sans-serif",
mono_font="'JetBrains Mono', monospace",
# Custom assets
custom_css_urls=["/static/custom.css"],
custom_js_urls=["/static/custom.js"]
)
Available Colors
from syneto_openapi_themes import SynetoColors
# Primary colors
SynetoColors.PRIMARY_MAGENTA # #ad0f6c
SynetoColors.PRIMARY_DARK # #07080d
SynetoColors.PRIMARY_LIGHT # #fcfdfe
# Accent colors
SynetoColors.ACCENT_RED # #f01932
SynetoColors.ACCENT_BLUE # #1e3a8a
SynetoColors.ACCENT_GREEN # #059669
SynetoColors.ACCENT_YELLOW # #d97706
# Neutral colors (100-900 scale)
SynetoColors.NEUTRAL_100 # #f8fafc
# ... through to ...
SynetoColors.NEUTRAL_900 # #0f172a
Advanced Usage
Authentication Configuration
# JWT Authentication
rapidoc = SynetoRapiDoc(openapi_url="/openapi.json")
rapidoc.with_jwt_auth(jwt_url="/auth/token")
# API Key Authentication
rapidoc.with_api_key_auth(api_key_name="X-API-Key")
Custom CSS and JavaScript
config = SynetoBrandConfig(
custom_css_urls=[
"/static/custom-theme.css",
"https://fonts.googleapis.com/css2?family=Custom+Font"
],
custom_js_urls=[
"/static/analytics.js",
"/static/custom-behavior.js"
]
)
Framework Agnostic Usage
from syneto_openapi_themes import SynetoRapiDoc
# Generate HTML for any framework
rapidoc = SynetoRapiDoc(openapi_url="/openapi.json")
html_content = rapidoc.render()
# Use with Flask, Django, etc.
@app.route('/docs')
def docs():
return html_content
Migration from Custom Implementation
If you're migrating from a custom RapiDoc implementation:
Before (Custom Implementation)
@app.get("/docs", response_class=HTMLResponse)
def custom_rapidoc_html():
return custom_template_with_syneto_branding()
After (Syneto OpenAPI Themes)
from syneto_openapi_themes import add_syneto_rapidoc
add_syneto_rapidoc(app, docs_url="/docs")
Development
Setup
git clone <repository-url>
cd syneto-openapi-themes
poetry install
Testing
poetry run pytest
Code Quality
poetry run black .
poetry run ruff check .
poetry run mypy .
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests
- Run quality checks
- Submit a pull request
License
MIT License - see LICENSE file for details.
Credits
Built on top of OpenAPIPages by Hasan Sezer Tasan.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file syneto_openapi_themes-0.1.2.tar.gz.
File metadata
- Download URL: syneto_openapi_themes-0.1.2.tar.gz
- Upload date:
- Size: 17.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
27ff6ef09bf9a31bb79ef53e5d00cade6919b19b569d4a44c8e0e2dcee214a66
|
|
| MD5 |
0f5a38c66a877c3604c3453c5f8a3780
|
|
| BLAKE2b-256 |
caacc85e6f52a2c008a090bcb7e090c33641a63e1c43a4152455439f5e68dc66
|
Provenance
The following attestation bundles were made for syneto_openapi_themes-0.1.2.tar.gz:
Publisher:
publish.yml on SynetoNet/syneto-openapi-themes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
syneto_openapi_themes-0.1.2.tar.gz -
Subject digest:
27ff6ef09bf9a31bb79ef53e5d00cade6919b19b569d4a44c8e0e2dcee214a66 - Sigstore transparency entry: 237065723
- Sigstore integration time:
-
Permalink:
SynetoNet/syneto-openapi-themes@9e00b5ae19a03fe58754e57f96b3b7d2c11445bc -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/SynetoNet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9e00b5ae19a03fe58754e57f96b3b7d2c11445bc -
Trigger Event:
release
-
Statement type:
File details
Details for the file syneto_openapi_themes-0.1.2-py3-none-any.whl.
File metadata
- Download URL: syneto_openapi_themes-0.1.2-py3-none-any.whl
- Upload date:
- Size: 24.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ebae2f62bde287c049da800ecfc11aa947c3ecf5d101fc47c79411ee569034e7
|
|
| MD5 |
ddaed16fb527d6c542ed4a1712d31280
|
|
| BLAKE2b-256 |
77be362aeb9a15eec95baf408ff3ec7e810dcefd8f2fbcddc23ec4f3cc1ac701
|
Provenance
The following attestation bundles were made for syneto_openapi_themes-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on SynetoNet/syneto-openapi-themes
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
syneto_openapi_themes-0.1.2-py3-none-any.whl -
Subject digest:
ebae2f62bde287c049da800ecfc11aa947c3ecf5d101fc47c79411ee569034e7 - Sigstore transparency entry: 237065726
- Sigstore integration time:
-
Permalink:
SynetoNet/syneto-openapi-themes@9e00b5ae19a03fe58754e57f96b3b7d2c11445bc -
Branch / Tag:
refs/tags/v0.1.2 - Owner: https://github.com/SynetoNet
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@9e00b5ae19a03fe58754e57f96b3b7d2c11445bc -
Trigger Event:
release
-
Statement type: