Elegant CLI applications using Click and Pydantic
Project description
clidantic
Elegant CLIs merging Click and Pydantic
WARNING: Library in early alpha stage
Install
You can install this package via pip, getting the latest features through GitHub:
pip install git+https://github.com/edornd/clidantic.git
Or installing the latest release:
pip install clidantic
Quickstart
Here's a quick example:
from typing import Optional
from pydantic import BaseModel
from clidantic import Parser
class Arguments(BaseModel):
field_a: str
field_b: int
field_c: Optional[bool] = False
cli = Parser()
@cli.command()
def main(args: Arguments):
print(args)
if __name__ == "__main__":
cli()
Contributing
We are not quite there yet :)
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
clidantic-0.0.1.tar.gz
(8.3 kB
view hashes)
Built Distribution
Close
Hashes for clidantic-0.0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af818a392bec42d79bb484db16b40499c4c51cd2687b787576662f69d8a99493 |
|
MD5 | 6515b3689fac9384830dc5d982c4436b |
|
BLAKE2b-256 | 9d04c932ef0ad0086d87df2f146b4e4a1a838c314410e1750bfcb5838bcc407b |