Typed Command Line Interfaces powered by Click and Pydantic
Project description
clidantic
Typed Command Line Interfaces powered by Click and Pydantic.
:warning: Library in early alpha stage
Installing
The safest path is to install the latest release using pip:
pip install clidantic
Optionally, you can install the latest updates through GitHub:
pip install git+https://github.com/edornd/clidantic.git
or, if that doesn't work, with multiple steps (this last step might require poetry):
git clone https://github.com/edornd/clidantic.git
cd clidantic
pip install .
Quickstart
Here's a quick example to get you started:
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.3.tar.gz
(11.4 kB
view hashes)
Built Distribution
clidantic-0.0.3-py3-none-any.whl
(12.1 kB
view hashes)
Close
Hashes for clidantic-0.0.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bdf00e8f68d59b6795f2db0d526c97213b4134f0d989799427fcb4567c10f121 |
|
MD5 | 67203bb4bd626f0657ae8f1e253e3eae |
|
BLAKE2b-256 | cb658fa6eaa4431b2ccd62a6675ca6fd4fb7731f9347d7acd2a0ad1a7cd48f9f |