API documentation#

This is clipstick.

Create your cli using Pydantic models.

clipstick.parse(model: type[TPydanticModel], args: list[str] | None = None) TPydanticModel#

Create an instance of the provided model.

Leave args to None in production. Only use it for testing.

Parameters:
  • model – The pydantic class we want to populate.

  • args – The list of arguments. This is useful for testing. Provide a list and check if your model is parsed correctly. If not provided clipstick will evaluate the arguments from sys.argv.

Returns:

An instance of the pydantic class we provided as argument populated with the provided args.

clipstick.short(name: str) Short#

Add a short-hand name to the full argument name.

Parameters:

name – The name of the short-hand name. Provide just the letter. not the preceding dash.

Returns:

A Short marker inside a type annotation.