Skip to main content

Process arguments for the deep modeling project.

Project description

Argument checking for python programs

This is a minimum version for checking the input argument dict. It would examine argument's type, as well as keys and types of its sub-arguments.

A special case called variant is also handled, where you can determine the items of a dict based the value of on one of its flag_name key.

There are three main methods of Argument class:

  • check method that takes a dict and see if its type follows the definition in the class
  • normalize method that takes a dict and convert alias and add default value into it
  • gendoc method that outputs the defined argument structure and corresponding docs

There are also check_value and normalize_value that ignore the leading key comparing to the base version.

When targeting to html rendering, additional anchor can be made for cross reference. Set make_anchor=True when calling gendoc function and use standard ref syntax in rst. The id is the same as the argument path. Variant types would be in square brackets.

Please refer to test files for detailed usage.

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

dargs-0.2.6.tar.gz (23.1 kB view details)

Uploaded Source

Built Distribution

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

dargs-0.2.6-py3-none-any.whl (11.9 kB view details)

Uploaded Python 3

File details

Details for the file dargs-0.2.6.tar.gz.

File metadata

  • Download URL: dargs-0.2.6.tar.gz
  • Upload date:
  • Size: 23.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.11

File hashes

Hashes for dargs-0.2.6.tar.gz
Algorithm Hash digest
SHA256 0ac6bdb80b46348d118048233f751bec79b28d7777649be7774aa9f795ec1628
MD5 c69158832a67bb65cf7228424c9a388d
BLAKE2b-256 b6c3bd067b4aa41f20fb7b1ced0bb70c50a3517ee2366f5ece9001be62a1daa2

See more details on using hashes here.

File details

Details for the file dargs-0.2.6-py3-none-any.whl.

File metadata

  • Download URL: dargs-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 11.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.6.1 pkginfo/1.7.1 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.61.2 CPython/3.7.11

File hashes

Hashes for dargs-0.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 baabeb500496c269ac5359ec8d6ea04a39caa3b3ba2ce23a1208dc95e76f8459
MD5 20e59e28708b0ad850af8edaba7d3ebe
BLAKE2b-256 4071f79f93463c17926314a929cc85de74d6699226fe5ee843955460d6749054

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