Python binding for nil-clix: Opinionated Argument Parser
Project description
nil-clix Python Binding
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"])
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
Release history Release notifications | RSS feed
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 Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
nil_clix-1.0.9-py3-none-any.whl
(173.9 kB
view details)
File details
Details for the file nil_clix-1.0.9-py3-none-manylinux_2_39_x86_64.whl.
File metadata
- Download URL: nil_clix-1.0.9-py3-none-manylinux_2_39_x86_64.whl
- Upload date:
- Size: 174.2 kB
- Tags: Python 3, manylinux: glibc 2.39+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0d6fd2e8707edb089e563070e09b6be021fdbd93a387deb2f34d62a37b6ebc6d
|
|
| MD5 |
f56a585c8f3ac2fb18585db31e4a8338
|
|
| BLAKE2b-256 |
e16fc66c760c2d28fbd398d5d7969b1b529d180840c9f08a731ec464b62d9a71
|
File details
Details for the file nil_clix-1.0.9-py3-none-any.whl.
File metadata
- Download URL: nil_clix-1.0.9-py3-none-any.whl
- Upload date:
- Size: 173.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
135fcfa7f1d4f301764699cf913db7e2cb994ebc1f64e225578731efd5b9fea7
|
|
| MD5 |
206603b5120ae884960d07195eecd686
|
|
| BLAKE2b-256 |
0f89cae6c1322e46063708c9b6b099cd8800a43bc655b81fe62e0ed7d2e0a4ec
|