argunparse is intended to perform approximate reverse of argparse
Project description
The argunparse is intended to perform an approximate reverse of what argparse does. In short: generating string of command-line arguments from a dict and/or a list.
how to use
Simple example of how argunparse works:
import argunparse
options = {
'v': True,
'long-flag': True,
'o': 'out_file.txt',
'log': 'log_file.txt'
}
args = {
'in_file.txt'
}
unparser = argunparse.ArgumentUnparser()
print(unparser.unparse(*args, **options))
# -v --long-flag -o=out_file.txt --log=log_file.txt in_file.txt
print(unparser.unparse_to_list(*args, **options))
# ['-v', '--long-flag', '-o=out_file.txt', '--log=log_file.txt', 'in_file.txt']
for more examples see examples.ipynb notebook.
requirements
Python >= 3.5.
No other runtime dependencies.
However, building and running tests requires packages listed in test_requirements.txt.
Tested on Linux, OS X and Windows.
installation
For simplest installation use pip
:
pip3 install argunparse
links
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
argunparse-0.1.1.tar.gz
(15.6 kB
view hashes)
Built Distribution
Close
Hashes for argunparse-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9af43abde4f6a633d9bf073cd4344c8155153393dc8b1d8913522821331a1f9c |
|
MD5 | 90e2604bb1a3db5e366cc27e0e7b388c |
|
BLAKE2b-256 | 3eecddf877cd9c258f7ca91798c9c219826fb0c5e6f3ffece2d4f64dc7d70b9f |