No project description provided
Project description
cmd-parser
The cmd-parser
library provides a simple way to parse command-line style input strings into a structured dictionary format. This is useful for applications that need to interpret commands with arguments and parameters.
Table of Contents
Installation
You can install the Command Parser Library using pip:
pip install cmd-parser
Usage
Here's a quick example of how to use the library:
from cmd_parser.core import asdict, parse
command_string = '!command arg1 arg2 param1="value1 test" param2=value2'
parsed_command = parse(command_string)
print(asdict(parsed_command))
This will output:
{
'command': 'command',
'args': ['arg1', 'arg2'],
'kwargs': {
'param1': 'value1 test',
'param2': 'value2'
}
}
License
cmd-parser
is distributed under the terms of the MIT license.
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 Distribution
cmd_parser-0.0.1.tar.gz
(6.9 kB
view details)
Built Distribution
File details
Details for the file cmd_parser-0.0.1.tar.gz
.
File metadata
- Download URL: cmd_parser-0.0.1.tar.gz
- Upload date:
- Size: 6.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e7e830e0a5682a738590375aec201251f92cf51b5ca921f1f532e16ca35a7140 |
|
MD5 | a97112286777937c025d2703cb94ceb6 |
|
BLAKE2b-256 | e239faf3e528309c3298ff2420adc3de36bc2ddecd98136955a67dc5913143dc |
File details
Details for the file cmd_parser-0.0.1-py3-none-any.whl
.
File metadata
- Download URL: cmd_parser-0.0.1-py3-none-any.whl
- Upload date:
- Size: 4.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.1.0 CPython/3.12.4
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | b856189d552abab94c75ea3c79c617b4b55942bff40a1d29945d65de5bfd7fd3 |
|
MD5 | e1c768b546ebe192062e1e51dd23a5de |
|
BLAKE2b-256 | 8e51ba485b31bd1ce18dd36e24782718e49ced2d77ee00f9cc7ae9a7e462e4fd |