Skip to main content

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 $ref resolution (including circular references)
  • allOf/oneOf/anyOf flattening
  • 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

Metadata

Release files for lapis-spec 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lapis-spec 0.1.1
File Size Uploaded Provenance
lapis_spec-0.1.1.tar.gz 74.2 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for lapis-spec 0.1.1
File Interpreter ABI Platform
lapis_spec-0.1.1-py3-none-any.whl Python 3 none any Details

Total release size: 101.1 kB

Release files / lapis_spec-0.1.1.tar.gz

Download URL lapis_spec-0.1.1.tar.gz
Size 74.2 kB
Tags Source
SHA-256 checksum
How to use checksums
ac62584a4044c312de82394d38cc5905f360264399dc675f6f7299868ce5be4a
BLAKE2b-256 checksum
How to use checksums
185db408ac29f8387545b77fb915f6d1a757db5776318df2fbba55d0b83ed6f8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Release files / lapis_spec-0.1.1-py3-none-any.whl

Download URL lapis_spec-0.1.1-py3-none-any.whl
Size 26.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
deede15f4ddde35a13a5cb9a14f430abc43b7b9c2bb4d6bcbb08da7e0f7a437d
BLAKE2b-256 checksum
How to use checksums
72522a19afb264912b8827a9acc91552fb5254efed5a4376035b2b1b5f61c836
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.14

Security for lapis-spec 0.1.1

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page