Generate the `x-codeSamples` extension for OpenAPI specifications
Project description
๐ Snippettoni
Snippettoni is a Python library that helps you generate the x-codeSamples extension for OpenAPI specifications. It supports multiple programming languages and allows you to use custom templates or extend the library with your own logic. Inspired by the deliciousness of "maccheroni" and the elegance of code snippets, Snippettoni serves up tasty examples for your API documentation.
Install
$ pip install snippettoni
##ย Usage
$ snippettoni --output enriched_openapi_spec.yaml openapi_spec.yaml
$ snippettoni --help
Usage: snippettoni [OPTIONS] SPEC_PATH
โญโ Arguments โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ * spec_path PATH Path to OpenAPI spec YAML or JSON file. โ
โ [default: None] โ
โ [required] โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
โญโ Options โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ --base-url TEXT Base URL for code examples. โ
โ [default: None] โ
โ --lang TEXT Languages to generate (e.g. --lang โ
โ python --lang curl).Default is all โ
โ templates in directory. โ
โ [default: None] โ
โ --template TEXT Override or add templates per โ
โ language, e.g. --template lang:path โ
โ [default: None] โ
โ --output PATH Optional output file path. Defaults โ
โ to stdout in same format as input. โ
โ [default: None] โ
โ --install-completion Install completion for the current โ
โ shell. โ
โ --show-completion Show completion for the current โ
โ shell, to copy it or customize the โ
โ installation. โ
โ --help Show this message and exit. โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
License
Snippettoni is licensed under Apache 2.0 License.
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 snippettoni-0.1.1.tar.gz.
File metadata
- Download URL: snippettoni-0.1.1.tar.gz
- Upload date:
- Size: 1.6 MB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9ba14a1a7650201caad7ec8061366101a05d2a12e6e787290320775dfe1fce94
|
|
| MD5 |
3f71124f337a2073471cabff0119a198
|
|
| BLAKE2b-256 |
61e845ed9e6a9f0362e2164804c71482beac599eb4017a8f025462f836ccdfe8
|
File details
Details for the file snippettoni-0.1.1-py3-none-any.whl.
File metadata
- Download URL: snippettoni-0.1.1-py3-none-any.whl
- Upload date:
- Size: 14.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: uv/0.6.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67e3266da4b3909071c30db6daf15db51d11ca6bcbc19b7f3049498f601fcbb9
|
|
| MD5 |
b50450c4a3690a20dc1c974a24691b58
|
|
| BLAKE2b-256 |
81dda03bbbcd16143f96f3fc01bbed51471d21d2e2b87eb2863c665164cd23c5
|