A helper for type-checked command-line argument store
Project description
init_attrs_with_kwargs
A helper for type-checked command-line argument store.
Please refer to the home page on the github for installation and usage.
Sample
from init_attrs_with_kwargs import cast_set_attrs
class MyArgs:
count: int
name: str
max_length: int
# Initialize from docopt's return value, with casting str to int
args = cast_set_attrs(MyArgs(), **{'<count>': '1', '--name': "Joe", '--max-length': '100'})
print("args.count=%s" % repr(args.count))
print("args.name=%s" % repr(args.name))
print("args.max_length=%s" % repr(args.max_length))
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
Built Distribution
Close
Hashes for init_attrs_with_kwargs-0.2.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 79e8a79d7ecfaebdc98f6b7c362af66364f5d3d714e6f05d831643ebdda2600a |
|
MD5 | 3f8ffe7126b91964cf7f85ccb7ea9012 |
|
BLAKE2b-256 | e58541fc0f2f78bb462493cdd121a55778b3b0e5e7685c2d903967b9fa4bbedc |
Close
Hashes for init_attrs_with_kwargs-0.2.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4f7e3fb51bccd8e550c9ddf187a46f333416b7fe7f4ea28b81d3172c203f4385 |
|
MD5 | 27227eaa28da27d5c41be5aae0ae5b10 |
|
BLAKE2b-256 | 4a6af3913229f46473d01f2fc7f970c2c917adac8486628c505ce22a6cd709ed |