Skip to main content

No project description provided

Project description

aclick

pypi tests coverage python

aclick is a python library extending click with the support for typing. It uses function signatures to automatically register options to parsers. Please refer to the documentation.

The following features are currently supported:

  • Positional-only parameters are added as click Arguments, other parameters become click Options.
  • Docstring is automatically parsed and used to generate command and parameter descriptions.
  • Arguments with int, float, str, bool values both with and without default value.
  • Complex structures of classes and dataclasses that are automatically inlined as a single string, e.g., class1("arg1", arg2=class2()).
  • Complex structures of classes and dataclasses that are expanded as individual options with the hierarchical=True option enabled.
  • Type Union of complex classes both inlined and hierarchical.
  • Type Optional of inlined complex classes.
  • Type Literal of strings.
  • Lists and tuples of both the primitive and inlined complex types.
  • Parameters can be renamed.
  • Parameter values can be loaded from a JSON, YAML, or other file.
  • Configuration can be loaded using the gin-config package.
  • For other features please refer to the documentation.

Installation

Install the library from pip:

$ pip install aclick

Getting started

Import aclick instead of click:

# python main.py test --arg2 4

import aclick

@aclick.command()
def example(arg1: str, /, arg2: int = 5):
    pass

example()

When using click.groups:

# python main.py example test --arg2 4

import aclick

@aclick.group()
def main():
    pass

@main.command('example')
def example(arg1: str, /, arg2: int = 5):
    pass

main()

For further details please look at the documentation.

License

MIT

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

aclick-0.2.1.tar.gz (28.0 kB view details)

Uploaded Source

Built Distribution

aclick-0.2.1-py3-none-any.whl (30.0 kB view details)

Uploaded Python 3

File details

Details for the file aclick-0.2.1.tar.gz.

File metadata

  • Download URL: aclick-0.2.1.tar.gz
  • Upload date:
  • Size: 28.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for aclick-0.2.1.tar.gz
Algorithm Hash digest
SHA256 23c3b1153ad385bca0688d7a48a2320113637040849bfa308d5d1178fe2f7ad5
MD5 0a32c326bd32d0cd0e0bd4d0af654f6b
BLAKE2b-256 782a7da963007b214ee88acabdc0f7d686c4cabb12eb161d768eb44bdbaa27f6

See more details on using hashes here.

File details

Details for the file aclick-0.2.1-py3-none-any.whl.

File metadata

  • Download URL: aclick-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 30.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.4

File hashes

Hashes for aclick-0.2.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4be036b9d4b48db2b8d5d128d8c939b0527333f1206545a1b4772ea5c50ab44
MD5 382b8ed0b267cc588238d0f78ab33156
BLAKE2b-256 97693d60e147d2a75b2372f9bb3b220fca337898abaaacdcf0a1726e9a001a1d

See more details on using hashes here.

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