felix-martel / pydanclick

Add click options from a Pydantic model
https://felix-martel.github.io/pydanclick/
MIT License
32 stars 8 forks source link

Attach Pydanclick options directly to a Pydantic model #8

Open felix-martel opened 8 months ago

felix-martel commented 8 months ago
class MyModel(BaseModel):
  __pydanclick__ = {
    "exclude": ["a", "b"]
    "extra_options": {"c": {"prompt": True}}
  }

Maybe provide an Adapter class to represent and validate this dict?