Command Line Questions for Python
Project description
COLT: COmmand Line Tool
Simple, extensible tool to create out of the box input files and commandline interfaces for Python, that are type validated. For the input file the ini file-format is used around Python’s configparser.
Free software: Apache License 2.0
Features
Build simple commandline interfaces using the FromCommandline-decorator
# examples/commandline_xrange.py
from colt import from_commandline
@from_commandline("""
# start of the range
xstart = :: int :: >0
# end of the range
xstop = :: int :: >1
# step size
step = 1 :: int
""")
def x_range(xstart, xstop, step):
for i in range(xstart, xstop, step):
print(i)
if __name__ == '__main__':
x_range()
usage: commandline_xrange.py [-h] [-step step] xstart xstop
positional arguments:
xstart int, Range(>0)
start of the range
xstop int, Range(>1)
end of the range
optional arguments:
-h, --help show this help message and exit
-step step int,
step size
Credits
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.
History
0.1.0 (2020-8-1)
First release on PyPI.
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
pycolt-0.2.1.tar.gz
(53.2 kB
view hashes)
Built Distribution
pycolt-0.2.1-py2.py3-none-any.whl
(49.3 kB
view hashes)
Close
Hashes for pycolt-0.2.1-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 76ee331bc64522ca67492446c0efd58c36a91e78b64ea29350e52ed18ef4fcac |
|
MD5 | e65899f9e6d61d009cda728336386ced |
|
BLAKE2b-256 | 17175dc74d244c862acaf9c37bac5a5fba33aec86900c91ede2dc1bfefb412d7 |