pyargman
pyargman is a lightweight Python module for managing command-line arguments,
Features
- Simple API for building command-line arguments
- Supports duplicate and boolean arguments
- Easy conversion to CLI list or string format
Installation
Install pyargman using pip:
pip install pyargman
install from github
git clone https://github.com/its-me-abi/pyargman.git
cd pyargman
Quick Start
Below is an example demonstrating how to use pyargman to manage and convert CLI arguments:
from pyargman import ArgManager
# Initialize argument manager for a CLI command (e.g., "java")
a = ArgManager("java")
# Add arguments
a.set_arg("--helo_duplicate", 1)
a.set_arg("--helo_duplicate", 2) # Supports duplicate arguments
a.set_arg("--helo_duplicate", 2 , delete = True) # if there is already a value 2 then it willbe deleted
a.set_arg("--helo_boolean_value", True) # Argument without a value
a.set_arg("script_path_like", True)
# Convert arguments to list and string formats
print("Converted to CLI list:", a.tolist())
print("Converted to CLI string:", a.toString())
responce would looks like
converted to cli list ['java', '--helo_duplicate', '1', '--helo_boolean_value', 'script_path_like']
converted to cli string java --helo_duplicate 1 --helo_boolean_value script_path_like
#
License
This project is licensed under the MIT License. See the LICENSE file for details.
Author
Developed and maintained by its-me-abi.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyargman-0.0.4.tar.gz
(3.4 kB
view details)
Built Distribution
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
File details
Details for the file pyargman-0.0.4.tar.gz.
File metadata
- Download URL: pyargman-0.0.4.tar.gz
- Upload date:
- Size: 3.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2fdc9329f5ce7b748cbe3ac71b8ab30779c95e7c7fc67ede7528d459df37ec4a
|
|
| MD5 |
cde7f1bef930aa3a5fcfa26da15af425
|
|
| BLAKE2b-256 |
0fe6dfe1208086005efb119cf05f8a7829e4e66631268e453f79220dc1a6b7d1
|
File details
Details for the file pyargman-0.0.4-py3-none-any.whl.
File metadata
- Download URL: pyargman-0.0.4-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.12.10
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f0c952e4bde313b2d15c114062df55bbf4642670204cccc1aa8c1d77f1fd62c3
|
|
| MD5 |
50a1c7d39363159371804e1dc23141d8
|
|
| BLAKE2b-256 |
d5ed10577cfac6190cd73bd53316a6424b4f12890d309fbf92ca87d5ba4197c7
|