Convert OpenAPI 3.0/3.1 specifications to LAPIS format
Project description
lapis-spec
Convert OpenAPI 3.0/3.1 specifications to LAPIS format.
LAPIS (Lightweight API Specification for Intelligent Systems) is a compact API description format designed for LLM consumption, achieving 70-80% token reduction compared to OpenAPI YAML.
Installation
pip install lapis-spec
Or with uv:
uv pip install lapis-spec
Usage
# Convert OpenAPI YAML to LAPIS
lapis -i openapi.yaml -o api.lapis
# Convert OpenAPI JSON to LAPIS
lapis -i openapi.json -o api.lapis
# Skip OpenAPI validation (useful for partial specs)
lapis -i openapi.yaml -o api.lapis --no-validate
CLI Options
| Option | Description |
|---|---|
-i, --input |
Path to OpenAPI file (.json, .yaml, .yml) |
-o, --output |
Path to output .lapis file |
--no-validate |
Skip OpenAPI schema validation |
--version |
Show version and exit |
-h, --help |
Show help message |
Supported Features
- OpenAPI 3.0.x and 3.1.x
- JSON and YAML input formats
- Full
$refresolution (including circular references) allOf/oneOf/anyOfflattening- All LAPIS sections:
[meta],[types],[ops],[webhooks],[errors],[limits],[flows] - Automatic schema deduplication (inline vs named types)
- Security scheme interpretation (bearer, apikey, basic, oauth2)
- Operation modifier detection (
+deprecated,+paginated,+idempotent,+stream) - Error response collection and deduplication
Development
# Install dependencies
uv sync
# Run tests
uv run pytest
# Run tests with coverage report
uv run pytest --cov-report=html
# Lint
uv run ruff check src/ tests/
# Type check
uv run mypy
License
MIT
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 lapis_spec-0.1.1.tar.gz.
File metadata
- Download URL: lapis_spec-0.1.1.tar.gz
- Upload date:
- Size: 74.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ac62584a4044c312de82394d38cc5905f360264399dc675f6f7299868ce5be4a
|
|
| MD5 |
65cb2bcb56b4963839ce501362753403
|
|
| BLAKE2b-256 |
185db408ac29f8387545b77fb915f6d1a757db5776318df2fbba55d0b83ed6f8
|
File details
Details for the file lapis_spec-0.1.1-py3-none-any.whl.
File metadata
- Download URL: lapis_spec-0.1.1-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.6.14
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
deede15f4ddde35a13a5cb9a14f430abc43b7b9c2bb4d6bcbb08da7e0f7a437d
|
|
| MD5 |
ed5391d7230cea9880a740f74b752f3c
|
|
| BLAKE2b-256 |
72522a19afb264912b8827a9acc91552fb5254efed5a4376035b2b1b5f61c836
|