Skip to main content

Generate the `x-codeSamples` extension for OpenAPI specifications

Project description

PyPI - Python Version

Snippettoni

๐Ÿ 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

snippettoni-0.1.1.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

snippettoni-0.1.1-py3-none-any.whl (14.3 kB view details)

Uploaded Python 3

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

Hashes for snippettoni-0.1.1.tar.gz
Algorithm Hash digest
SHA256 9ba14a1a7650201caad7ec8061366101a05d2a12e6e787290320775dfe1fce94
MD5 3f71124f337a2073471cabff0119a198
BLAKE2b-256 61e845ed9e6a9f0362e2164804c71482beac599eb4017a8f025462f836ccdfe8

See more details on using hashes here.

File details

Details for the file snippettoni-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for snippettoni-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 67e3266da4b3909071c30db6daf15db51d11ca6bcbc19b7f3049498f601fcbb9
MD5 b50450c4a3690a20dc1c974a24691b58
BLAKE2b-256 81dda03bbbcd16143f96f3fc01bbed51471d21d2e2b87eb2863c665164cd23c5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page