Skip to main content

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

test passing coverage pypi version python versions


Documentation

The first draft of documentation is available here: https://edornd.github.io/clidantic/

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.1.0.tar.gz (11.6 kB view hashes)

Uploaded Source

Built Distribution

clidantic-0.1.0-py3-none-any.whl (12.3 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page