Read-only mirror of https://github.com/metadata-swiss/swagger2dcat — Bundesamt für Statistik. Issues & pull requests at the source.
  • Python 71.7%
  • HTML 27%
  • CSS 1%
  • Dockerfile 0.3%
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Sergiy Goloviatinski 5ab2a83c52
Merge pull request #28 from metadata-swiss/dependabot/pip/pip-minor-patch-08893da7e1
Bump the pip-minor-patch group with 2 updates
2026-10-12 15:07:32 +02:00
.github Bump docker/setup-buildx-action in the github-actions-minor-patch group 2026-09-28 07:12:11 +00:00
session_storage Ports adjusted 2025-06-25 14:40:44 +02:00
static vendor external stuff used by html 2026-08-03 17:07:59 +02:00
templates vendor external stuff used by html 2026-08-03 17:07:59 +02:00
utils fixed potential vulnerabilities, added quality gates in azure deploy pipeline 2026-08-03 14:09:04 +02:00
.dockerignore Added Dockerfile + workflow to push docker image on azure 2026-06-29 16:43:29 +02:00
.env.template first commit 2025-06-25 13:23:32 +02:00
.gitignore Added Dockerfile + workflow to push docker image on azure 2026-06-29 16:43:29 +02:00
.gitleaks.toml avoid scanning mimified vendor stuff with gitleaks 2026-08-03 17:19:44 +02:00
app.py fixed potential vulnerabilities, added quality gates in azure deploy pipeline 2026-08-03 14:09:04 +02:00
config.py.template first commit 2025-06-25 13:23:32 +02:00
Dockerfile Bump python from 3.12-slim-bookworm to 3.14-slim-bookworm 2026-08-03 12:11:27 +00:00
Dockerfile.azure Bump python from 3.12-slim-bookworm to 3.14-slim-bookworm 2026-08-03 12:11:27 +00:00
README.md first commit 2025-06-25 13:23:32 +02:00
requirements.txt Bump the pip-minor-patch group with 2 updates 2026-10-05 07:12:31 +00:00

Swagger2DCAT – I14Y Dataservice Description Generator

This application helps you easily generate a standardized description for your API (dataservice) on the Swiss interoperability platform I14Y, starting from your technical Swagger/OpenAPI documentation.

  • Input: Just provide your Swagger/OpenAPI URL (or a link to your Swagger UI).
  • Output: Get a ready-to-use JSON description for I14Y, including multilingual metadata, publisher info, and more.

You can run this tool on-premise or use it directly from the I14Y Toolbox.


Features

  • Automatic extraction of API metadata from Swagger/OpenAPI (including from Swagger UI HTML pages)
  • AI-powered description generation (OpenAI, optional)
  • Multilingual support: Translate your API description into German, French, Italian (DeepL, optional)
  • Easy review and editing of all metadata before upload
  • Direct upload to I14Y or download as JSON file
  • Publisher/agency lookup from I14Y Admin API and Swiss Staatskalender

Quick Start

1. Local Setup

git clone https://github.com/I14Y-ch/swagger2dcat.git
cd swagger2dcat2
python -m venv venv
source venv/bin/activate  # On Windows: venv\Scripts\activate
pip install -r requirements.txt
cp .env.template .env
# Edit .env and add your API keys (see below)
flask run

2. Docker

docker build -t swagger2dcat .
docker run -p 5000:5000 --env-file .env swagger2dcat

Configuration

You need API keys for some features:

  • OPENAI_API_KEY (optional, for AI-generated descriptions)
  • DEEPL_API_KEY (optional, for translations)
  • SECRET_KEY (required, for Flask session security)

Set these in your .env file or as environment variables.


Usage

  1. Enter your Swagger/OpenAPI URL (can be a direct JSON or a Swagger UI page)
  2. (Optional) Add a landing page/documentation URL for richer descriptions
  3. Review and edit the extracted metadata
  4. (Optional) Use AI to generate a better description
  5. (Optional) Translate to other languages
  6. Download the JSON or upload directly to I14Y

Project Structure

swagger2dcat/
├── app.py                  # Main Flask application
├── utils/                  # Helper modules
│   ├── swagger_utils.py    # Swagger/OpenAPI parsing
│   ├── openai_utils.py     # OpenAI integration
│   ├── deepl_utils.py      # DeepL translation
│   └── i14y_utils.py       # I14Y API helpers
├── templates/              # HTML templates
├── static/                 # CSS/JS
└── requirements.txt        # Python dependencies

Questions or feedback?
See the I14Y Toolbox or contact the interoperability service.