Skip to main content

Argument checking for python programs

dargs — argument schemas for Python

conda-forge pip install Documentation Status

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.

Additional features

Metadata

Release files for dargs 0.5.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for dargs 0.5.1
File Size Uploaded
dargs-0.5.1.tar.gz 62.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for dargs 0.5.1
File Interpreter ABI Platform
dargs-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 96.9 kB

Release files / dargs-0.5.1.tar.gz

Download URL dargs-0.5.1.tar.gz
Size 62.1 kB
Tags Source
SHA-256 checksum
How to use checksums
993f048ae893f06e0c9a3836a16ed08ecbea49d343b1063f1429bc26b4902d50
BLAKE2b-256 checksum
How to use checksums
6f14220f4e40748b00e219a9c9190a5cc809936ee3b14d1e296f15c73cb73daa
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release files / dargs-0.5.1-py3-none-any.whl

Download URL dargs-0.5.1-py3-none-any.whl
Size 34.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
faa9660c3fbbca9dfa3c6950add079725be9cb0de4c005fcb5450ea460900c06
BLAKE2b-256 checksum
How to use checksums
f237c5f583357a8c0cca2f124835f2c6592cf4ffad4288cbee2830d0b871998c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.11.16

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files

0.4.10

2 release files

0.4.9

2 release files

0.4.8

2 release files

0.4.7

2 release files

0.4.6

2 release files

0.4.5

2 release files

0.4.4

2 release files

0.4.3

2 release files

0.4.2

2 release files

0.4.1

2 release files

0.4.0

2 release files

0.3.5

2 release files

0.3.4

2 release files

0.3.3

2 release files

0.3.2

2 release files

0.3.1

2 release files

0.3.0

2 release files

0.2.9

2 release files

0.2.8

2 release files

0.2.7

2 release files

0.2.6

2 release files

0.2.5

2 release files

0.2.3

2 release files

0.2.2

2 release files

0.2.1

3 release files

0.2.0

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page