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.0.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.0-py3-none-any.whl (14.1 kB view details)

Uploaded Python 3

File details

Details for the file snippettoni-0.1.0.tar.gz.

File metadata

  • Download URL: snippettoni-0.1.0.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.0.tar.gz
Algorithm Hash digest
SHA256 28cd7cf6138b807ab47e4b5101f9f398de40f8fc2426aa2a098fffa58d465798
MD5 7a2801f530c5c764197943b5c45ca54a
BLAKE2b-256 7f0d25847c8669ae09be974f4e6f489895ab640ae92b3756c1f658b4f60d155d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snippettoni-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1469844fbfd90ab66b746938e6a4aff7039ad2ea0846db8673101487d946626e
MD5 b4f7fb73795aa764e12d66c953aaef62
BLAKE2b-256 d9a12e9c65f682409cfae2a84e61d0dbcf33799a50b008c1101ccd6d8a7f7ae2

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