nil-clix
Python binding for nil-clix – an Opinionated Argument Parser
Links
- Repository: https://github.com/njaldea/nil-clix
- C API Documentation: https://github.com/njaldea/nil-clix/blob/master/docs/c-api.md
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"])
Subcommands
from nil_clix import create_node
node = create_node()
def init_cmd(cmd):
cmd.flag("force", "f", "Force initialization")
def run_init(options):
if options.flag("force"):
print("Init: forced")
else:
print("Init: normal")
return 0
cmd.use(run_init)
node.sub("init", "Initialize the project", init_cmd)
exit_code = node.run(["init", "-f"])
Lifetime Notes
Root nodes are owning handles. The Python binding registers a GC finalizer so
the underlying node is destroyed if the object is collected. Finalizer timing
is nondeterministic and may not run at shutdown, so call destroy() for
deterministic teardown. Subcommand nodes passed to callbacks are non-owning
views and must not be stored or destroyed.
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.
Metadata
Release files for nil-clix 1.0.11
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| nil_clix-1.0.11-py3-none-manylinux_2_39_x86_64.whl | Python 3 | none | Linux glibc 2.39+ x86-64 | Details for nil_clix-1.0.11-py3-none-manylinux_2_39_x86_64.whl |
| nil_clix-1.0.11-py3-none-any.whl | Python 3 | none | any | Details for nil_clix-1.0.11-py3-none-any.whl |
Total release size: 349.1 kB
Release files / nil_clix-1.0.11-py3-none-manylinux_2_39_x86_64.whl
| Download URL | nil_clix-1.0.11-py3-none-manylinux_2_39_x86_64.whl |
|---|---|
| Size | 174.7 kB |
| Tags | Linux glibc 2.39+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
ccaff9574f173658ec2fd42f1f84b52359c5fac43fd081e9e567704f1bf35844
|
|
BLAKE2b-256 checksum How to use checksums |
bfe3c379884c0fc52b722807bd6cbb58faca706430b334cfcbd8f8adf2776c4c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Release files / nil_clix-1.0.11-py3-none-any.whl
| Download URL | nil_clix-1.0.11-py3-none-any.whl |
|---|---|
| Size | 174.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
610586dbe9f749d22b7ead4647c13486361038aeaa83608d5f0c06a56fa617ea
|
|
BLAKE2b-256 checksum How to use checksums |
9a7e64b831fb973e358ae7c012990b1d46df49da1c4707925e0ffd95ff4de4c0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.3
|
Security for nil-clix 1.0.11
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.