Skip to main content

OpenAPI Trimmer

⚡ Python / Bash CLI Tool to Trim OpenAPI Paths / Endpoints ⚡

OpenAPI Trimmer is a lightweight tool designed to trim down your OpenAPI files to include only the endpoints and data transfer objects (DTOs) you care about. This helps in managing large OpenAPI files by focusing only on the necessary parts for specific tasks.

Usage

Example usage to make Open API file only for /v1/quotes and /v1/users APIs, removing all others and also removing some DTOs:

openapi-trimmer -i openapi.yaml \
  -p /v1/quotes,/v1/users \
  -ec CompanyConfigDto,UpdateCompanyConfigDto

The output will be stored in openapi-trimmer.yaml

At the end validate with:

swagger-cli validate ./openapi-trimmer.yaml

Install from PyPi

To install check the package on PyPi:

https://pypi.org/project/openapi-trimmer/

pip install openapi-trimmer

Credits

This tool was inspired from the OpenAPI Endpoint Trimmer JavaScript tool openapi-endpoint-trimmer by andenacitelli.

Support

If you'd like to support me, you can support me with the "Sponsor" options on the right. Thank you for your support!

Contributing

I highly encourage contributions! Create issues and/or PRs for any bugs or features you'd like to see.

License

This project is licensed under the MIT license. This basically means you can use it for any purpose, commercially or not, but I have zero liability.

Release files for openapi-trimmer 0.1.4

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

Source distribution (sdist)

Source distribution for openapi-trimmer 0.1.4
File Size Uploaded
openapi_trimmer-0.1.4.tar.gz 4.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for openapi-trimmer 0.1.4
File Interpreter ABI Platform
openapi_trimmer-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size:9.5 kB

Release files / openapi_trimmer-0.1.4.tar.gz

Download URL openapi_trimmer-0.1.4.tar.gz
Size 4.4 kB
Tags Source
SHA-256 checksum
How to use checksums
0a4d3c5207df2cf4948e6f960914a3097c511bc0b2e523b2a9c3f1ff17344531
BLAKE2b-256 checksum
How to use checksums
d1ca757e80ff81a566c73494f2d50f4152b1d43c33ad92913281c913803eb609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release files / openapi_trimmer-0.1.4-py3-none-any.whl

Download URL openapi_trimmer-0.1.4-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3869a693ce84fae1659cf119ee6febd9687bb3b864b473c5a2adc0cc7e5db11a
BLAKE2b-256 checksum
How to use checksums
adeacabf399569002b3eac0ef57df33b1fc517f87cff4c51efd0b9a4a0ef12d5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.1.1 CPython/3.10.14

Release history Release notifications | RSS feed

This release

0.1.4 This release

2 release files

0.1.3

2 release files

0.1.1

2 release files

0.1.0

2 release files

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