swagger-plugin-for-sphinx


Nameswagger-plugin-for-sphinx JSON
Version 6.0.0 PyPI version JSON
download
home_pageNone
SummarySphinx plugin which renders a OpenAPI specification with Swagger
upload_time2025-10-16 06:26:09
maintainerNone
docs_urlNone
authorNone
requires_python<4,>=3.10
licenseNone
keywords sphinx swagger plugin openapi
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            [![REUSE status](https://api.reuse.software/badge/github.com/SAP/swagger-plugin-for-sphinx)](https://api.reuse.software/info/github.com/SAP/swagger-plugin-for-sphinx)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![Coverage Status](https://coveralls.io/repos/github/SAP/swagger-plugin-for-sphinx/badge.svg)](https://coveralls.io/github/SAP/swagger-plugin-for-sphinx)

# Swagger Plugin for Sphinx

This is a handy plugin to bring [Swagger](https://swagger.io/) and [Sphinx](https://www.sphinx-doc.org/en/master/) together.

It can generate one or multiple swagger HTML pages with a custom configuration that hosts an OpenAPI specification.

## Install

Just run `pip install swagger-plugin-for-sphinx`

## Usage

### Enable the Plugin

First, add the plugin to the extensions list:

```python
extensions = ["swagger_plugin_for_sphinx"]
```

### Global Configuration

Swagger uses two JavaScript and one CSS file to render the output.
These can be set in ``conf.py``:

```python
swagger_present_uri = ""
swagger_bundle_uri = ""
swagger_css_uri = ""
```

These correspond to the modules explained [here](https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/installation.md).
By default, the latest release is used from [here](https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest).

### Directive

To include a Swagger API specification into an HTML page specify the `swagger-plugin` directive
and the relative path to the specification:

```code
.. swagger-plugin:: path/to/spec.yaml
```

The spec is automatically copied into the `_static` build output directory.

The directive supports the following options

* `id`: specifies an unique ID for the specification per page (see below)
* `full-page`: if set, all other content on the page is dropped and only the Swagger part is rendered
* `page-title`: the name of the HTML page if `full-page` is specified
* `swagger-options`: JSON string that is passed to Swagger to enable additional options as described
    on the [configuration](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)
    page of the Swagger documentation.

By default, the directive creates a `<div>` element with the ID `swagger-ui-container`.
If you put more than one `swagger-plugin` directive in a file, specify unique IDs:

```code
.. swagger-plugin:: path/to/one.yaml
   :id: spec-one

.. swagger-plugin:: path/to/two.yaml
   :id: spec-two
```

## Development
This project uses `uv`.
To setup a venv for development use
`python3.14 -m venv venv && pip install uv && uv sync --all-groups && rm -rf venv/`.
Then use `source .venv/bin/activate` to activate your venv.

## Build and Publish

This project uses `setuptools` as the dependency management and build tool.
To publish a new release, follow these steps:
* Update the version in the `pyproject.toml`
* Add an entry in the changelog
* Push a new tag like `vX.X.X` to trigger the release

## Support, Feedback, Contributing

This project is open to feature requests/suggestions, bug reports etc., via [GitHub issues](https://github.com/SAP/<your-project>/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).

## Code of Conduct

We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](CODE_OF_CONDUCT.md) at all times.

## Licensing

Copyright 2025 SAP SE or an SAP affiliate company and swagger-plugin-for-sphinx contributors.
Please see our [LICENSE](LICENSE) for copyright and license information.
Detailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/<your-project>).

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "swagger-plugin-for-sphinx",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4,>=3.10",
    "maintainer_email": null,
    "keywords": "sphinx, swagger, plugin, openapi",
    "author": null,
    "author_email": "Kai Harder <kai.harder@sap.com>",
    "download_url": "https://files.pythonhosted.org/packages/5b/b3/84bc7d8af6b50e6c365f1593fe4a01245f4bfb2178040261c6429db0b46b/swagger_plugin_for_sphinx-6.0.0.tar.gz",
    "platform": null,
    "description": "[![REUSE status](https://api.reuse.software/badge/github.com/SAP/swagger-plugin-for-sphinx)](https://api.reuse.software/info/github.com/SAP/swagger-plugin-for-sphinx)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)\n[![Coverage Status](https://coveralls.io/repos/github/SAP/swagger-plugin-for-sphinx/badge.svg)](https://coveralls.io/github/SAP/swagger-plugin-for-sphinx)\n\n# Swagger Plugin for Sphinx\n\nThis is a handy plugin to bring [Swagger](https://swagger.io/) and [Sphinx](https://www.sphinx-doc.org/en/master/) together.\n\nIt can generate one or multiple swagger HTML pages with a custom configuration that hosts an OpenAPI specification.\n\n## Install\n\nJust run `pip install swagger-plugin-for-sphinx`\n\n## Usage\n\n### Enable the Plugin\n\nFirst, add the plugin to the extensions list:\n\n```python\nextensions = [\"swagger_plugin_for_sphinx\"]\n```\n\n### Global Configuration\n\nSwagger uses two JavaScript and one CSS file to render the output.\nThese can be set in ``conf.py``:\n\n```python\nswagger_present_uri = \"\"\nswagger_bundle_uri = \"\"\nswagger_css_uri = \"\"\n```\n\nThese correspond to the modules explained [here](https://github.com/swagger-api/swagger-ui/blob/master/docs/usage/installation.md).\nBy default, the latest release is used from [here](https://cdn.jsdelivr.net/npm/swagger-ui-dist@latest).\n\n### Directive\n\nTo include a Swagger API specification into an HTML page specify the `swagger-plugin` directive\nand the relative path to the specification:\n\n```code\n.. swagger-plugin:: path/to/spec.yaml\n```\n\nThe spec is automatically copied into the `_static` build output directory.\n\nThe directive supports the following options\n\n* `id`: specifies an unique ID for the specification per page (see below)\n* `full-page`: if set, all other content on the page is dropped and only the Swagger part is rendered\n* `page-title`: the name of the HTML page if `full-page` is specified\n* `swagger-options`: JSON string that is passed to Swagger to enable additional options as described\n    on the [configuration](https://swagger.io/docs/open-source-tools/swagger-ui/usage/configuration/)\n    page of the Swagger documentation.\n\nBy default, the directive creates a `<div>` element with the ID `swagger-ui-container`.\nIf you put more than one `swagger-plugin` directive in a file, specify unique IDs:\n\n```code\n.. swagger-plugin:: path/to/one.yaml\n   :id: spec-one\n\n.. swagger-plugin:: path/to/two.yaml\n   :id: spec-two\n```\n\n## Development\nThis project uses `uv`.\nTo setup a venv for development use\n`python3.14 -m venv venv && pip install uv && uv sync --all-groups && rm -rf venv/`.\nThen use `source .venv/bin/activate` to activate your venv.\n\n## Build and Publish\n\nThis project uses `setuptools` as the dependency management and build tool.\nTo publish a new release, follow these steps:\n* Update the version in the `pyproject.toml`\n* Add an entry in the changelog\n* Push a new tag like `vX.X.X` to trigger the release\n\n## Support, Feedback, Contributing\n\nThis project is open to feature requests/suggestions, bug reports etc., via [GitHub issues](https://github.com/SAP/<your-project>/issues). Contribution and feedback are encouraged and always welcome. For more information about how to contribute, the project structure, as well as additional contribution information, see our [Contribution Guidelines](CONTRIBUTING.md).\n\n## Code of Conduct\n\nWe as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone. By participating in this project, you agree to abide by its [Code of Conduct](CODE_OF_CONDUCT.md) at all times.\n\n## Licensing\n\nCopyright 2025 SAP SE or an SAP affiliate company and swagger-plugin-for-sphinx contributors.\nPlease see our [LICENSE](LICENSE) for copyright and license information.\nDetailed information including third-party components and their licensing/copyright information is available [via the REUSE tool](https://api.reuse.software/info/github.com/SAP/<your-project>).\n",
    "bugtrack_url": null,
    "license": null,
    "summary": "Sphinx plugin which renders a OpenAPI specification with Swagger",
    "version": "6.0.0",
    "project_urls": {
        "Changelog": "https://github.com/SAP/swagger-plugin-for-sphinx/blob/main/CHANGELOG.md",
        "Issue Tracker": "https://github.com/SAP/swagger-plugin-for-sphinx/issues"
    },
    "split_keywords": [
        "sphinx",
        " swagger",
        " plugin",
        " openapi"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "51f01098f6628bbe04b086ce59692d09b116ec751286eb7d33e88c5bf0c2e210",
                "md5": "3324c809e7da0b862d212dedd6b8627e",
                "sha256": "35dc646d759a44ce78aefde2fe34f54e7b8c3439d0a52541a6a8b9924a711832"
            },
            "downloads": -1,
            "filename": "swagger_plugin_for_sphinx-6.0.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "3324c809e7da0b862d212dedd6b8627e",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4,>=3.10",
            "size": 11253,
            "upload_time": "2025-10-16T06:26:08",
            "upload_time_iso_8601": "2025-10-16T06:26:08.504767Z",
            "url": "https://files.pythonhosted.org/packages/51/f0/1098f6628bbe04b086ce59692d09b116ec751286eb7d33e88c5bf0c2e210/swagger_plugin_for_sphinx-6.0.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "5bb384bc7d8af6b50e6c365f1593fe4a01245f4bfb2178040261c6429db0b46b",
                "md5": "4152149886eb8e7d355f6426098982d5",
                "sha256": "70366c610648cede5ef482922c9c97c86c99746b9edf33e4ec13fab23d820251"
            },
            "downloads": -1,
            "filename": "swagger_plugin_for_sphinx-6.0.0.tar.gz",
            "has_sig": false,
            "md5_digest": "4152149886eb8e7d355f6426098982d5",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4,>=3.10",
            "size": 16026,
            "upload_time": "2025-10-16T06:26:09",
            "upload_time_iso_8601": "2025-10-16T06:26:09.950867Z",
            "url": "https://files.pythonhosted.org/packages/5b/b3/84bc7d8af6b50e6c365f1593fe4a01245f4bfb2178040261c6429db0b46b/swagger_plugin_for_sphinx-6.0.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-16 06:26:09",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "SAP",
    "github_project": "swagger-plugin-for-sphinx",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "swagger-plugin-for-sphinx"
}
        
Elapsed time: 9.39821s