Skip to main content

A Python module like argumentparser for managing comandline arguments,

Project description

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.

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

pyargman-0.0.4.tar.gz (3.4 kB view details)

Uploaded Source

Built Distribution

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

pyargman-0.0.4-py3-none-any.whl (3.7 kB view details)

Uploaded Python 3

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

Hashes for pyargman-0.0.4.tar.gz
Algorithm Hash digest
SHA256 2fdc9329f5ce7b748cbe3ac71b8ab30779c95e7c7fc67ede7528d459df37ec4a
MD5 cde7f1bef930aa3a5fcfa26da15af425
BLAKE2b-256 0fe6dfe1208086005efb119cf05f8a7829e4e66631268e453f79220dc1a6b7d1

See more details on using hashes here.

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

Hashes for pyargman-0.0.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f0c952e4bde313b2d15c114062df55bbf4642670204cccc1aa8c1d77f1fd62c3
MD5 50a1c7d39363159371804e1dc23141d8
BLAKE2b-256 d5ed10577cfac6190cd73bd53316a6424b4f12890d309fbf92ca87d5ba4197c7

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