Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Clea - A lightweight framework for creating CLI applications in python

Clea is uses type annotations to generate the command/group defintions and parse the arguments at the runtime. To start with clea run

pip3 install clea

Define you first command using

from typing_extensions import Annotated

from clea.params import Integer
from clea.wrappers import command

@command
def add(
    n1: Annotated[int, Integer()],
    n2: Annotated[int, Integer()],
) -> None:
    """Add two numbers"""

    print(f"Total {n1 + n2}")

Invoke the command at runtime using

from clea.runner import run

if __name__ == "__main__":
    run(cli=add)

The example is taken from add.py in the examples folder.

You can check the command definition using

$ python add.py --help

Usage: add [OPTIONS] N1 N2

        Add two numbers

Options:

    --help                        Show help and exit.

Execute the command using

$ python add.py 2 3

Total 5

Read more about the usage of clea in the docs

Release files for clea 0.1.0rc4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for clea 0.1.0rc4
File Size Uploaded
clea-0.1.0rc4.tar.gz 20.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for clea 0.1.0rc4
File Interpreter ABI Platform
clea-0.1.0rc4-py3-none-any.whl Python 3 none any Details

Total release size: 43.5 kB

Release files / clea-0.1.0rc4.tar.gz

Download URL clea-0.1.0rc4.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e9d128bab506ab88bae384aa546ff26060e8a64075bffd7ff9e600007e76880d
BLAKE2b-256 checksum
How to use checksums
a1b6ae418dbf3c37d54394787783879b5526e91ce7fc693c26b1c49ac9fc2d3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6

Release files / clea-0.1.0rc4-py3-none-any.whl

Download URL clea-0.1.0rc4-py3-none-any.whl
Size 22.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5220c52c698cd1936abbe01c5281ea3906bffbefd29e1ffdc913ef5c9b06f444
BLAKE2b-256 checksum
How to use checksums
7a790bbb288f230bb3e7e320857214e59b2ac585722317596f904df3a8f1ddb0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.6
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page