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

Uploaded Python 3

File details

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

File metadata

  • Download URL: snippettoni-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 38c1dbd87f6a12d1801362cd41e4d68eb40e29141597fcc914110cc70592590a
MD5 5cde737b36ddc2100bfd4f17061cd784
BLAKE2b-256 a54bc776b1e1cc65e181e413c0a328e55bef5c6fccaa08aceffd81cb5866a2b6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for snippettoni-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 6b0d409b07cb223b601e508a0a6fed65479318f5230a0b3fa8b7402a903ead17
MD5 c92726ac3c596a1923a4268878bc1fa0
BLAKE2b-256 84d6da6aaeedc1e3cfd124c9f23bb4b4347ebde70d307d827964079dd8ab8209

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