Skip to main content

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

init_attrs_with_kwargs-0.2.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

init_attrs_with_kwargs-0.2.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file init_attrs_with_kwargs-0.2.0.tar.gz.

File metadata

  • Download URL: init_attrs_with_kwargs-0.2.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for init_attrs_with_kwargs-0.2.0.tar.gz
Algorithm Hash digest
SHA256 79e8a79d7ecfaebdc98f6b7c362af66364f5d3d714e6f05d831643ebdda2600a
MD5 3f8ffe7126b91964cf7f85ccb7ea9012
BLAKE2b-256 e58541fc0f2f78bb462493cdd121a55778b3b0e5e7685c2d903967b9fa4bbedc

See more details on using hashes here.

File details

Details for the file init_attrs_with_kwargs-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: init_attrs_with_kwargs-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/32.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.8 tqdm/4.62.3 importlib-metadata/4.11.1 keyring/18.0.1 rfc3986/2.0.0 colorama/0.4.3 CPython/3.8.10

File hashes

Hashes for init_attrs_with_kwargs-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4f7e3fb51bccd8e550c9ddf187a46f333416b7fe7f4ea28b81d3172c203f4385
MD5 27227eaa28da27d5c41be5aae0ae5b10
BLAKE2b-256 4a6af3913229f46473d01f2fc7f970c2c917adac8486628c505ce22a6cd709ed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page