Skip to main content

Python binding for nil/clix: an Opinionated Argument Parser

Project description

nil-clix Python Binding

Python binding for nil/clix – an Opinionated Argument Parser

Links

Installation

pip install nil-clix

Usage

from nil_clix import create_node

node = create_node()

# Add flags
node.flag("verbose", "v", "Enable verbose output")

# Add parameters
node.param("config", "c", "Path to config file", fallback="config.yml")

# Add numbers
node.number("threads", "t", "Number of threads", fallback=4)

# Add handler
def handler(options):
    if options.flag("verbose"):
        print("Verbose mode enabled")
    config = options.param("config")
    threads = options.number("threads")
    print(f"Config: {config}, Threads: {threads}")
    return 0

node.use(handler)

# Run
exit_code = node.run(["-v", "-c", "my.yml", "-t", "8"])

Documentation

For detailed API documentation and more examples, visit:

License

CC BY-NC-ND 4.0

Support

For issues, questions, or contributions, visit the GitHub repository.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nil_clix-1.0.8rc1-cp312-cp312-manylinux_2_39_x86_64.whl (173.7 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

File details

Details for the file nil_clix-1.0.8rc1-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for nil_clix-1.0.8rc1-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 59d24a82a0010383cf3ec81c5b76c1293a58c795b27fbbc742190be541bd5afa
MD5 bb970baa6071887d0d930a3b724dae3c
BLAKE2b-256 f8d5065210439a6c388ada34b1c7217c7b885354167a3f17b90950706c3fe601

See more details on using hashes here.

Supported by

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