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 classnormalize
method that takes a dict and convert alias and add default value into itgendoc
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
- PEP 484 type annotations
- Native integration with Sphinx, DP-GUI, and Jupyter Notebook
- JSON encoder for
Argument
andVariant
classes - Generate JSON schema from an
Argument
, which can be further integrated with JSON editors such as Visual Studio Code
Project details
Release history Release notifications | RSS feed
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
File details
Details for the file dargs-0.4.9.tar.gz
.
File metadata
- Download URL: dargs-0.4.9.tar.gz
- Upload date:
- Size: 44.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8bbebcdff6cca29a57931221a64be86d8ada87682e019b28be4704d283cdea25 |
|
MD5 | f6a8e8acba7c50151f46f54365474639 |
|
BLAKE2b-256 | 987b17f24e2e7839ea6aebbedf8daad975eaf557a4dd0e6f015a616adbba641c |
File details
Details for the file dargs-0.4.9-py3-none-any.whl
.
File metadata
- Download URL: dargs-0.4.9-py3-none-any.whl
- Upload date:
- Size: 26.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.7.17
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | f952ff5fc55a99e63c17b6d4d1c11c0f929a2810d9ca212c85c85cf2df45c152 |
|
MD5 | 0187479aab300d33fc9bbe42bc277703 |
|
BLAKE2b-256 | bad0fac4b412c2975bc0bc47b92d1e9ffde1e68a0ff59e0a72ff6454b8866266 |