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.
- 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
This package was created with Cookiecutter and the audreyr/cookiecutter-pypackage project template.