python-jsonargparse
Port variant py311
Summary JSON argument and config file parser (3.11)
Package version 4.19.0
Homepage https://github.com/omni-us/jsonargparse
Keywords python
Maintainer Python Automaton
License Not yet specified
Other variants py310
Ravenports Buildsheet | History
Ravensource Port Directory | History
Last modified 07 JAN 2023, 04:18:24 UTC
Port created 07 JAN 2023, 04:18:24 UTC
Subpackage Descriptions
single jsonargparse ============ https://github.com/omni-us/jsonargparse/ This package is an extension to python's argparse which simplifies parsing of configuration options from command line arguments, json configuration files ([yaml] or [jsonnet] supersets), environment variables and hard-coded defaults. The aim is similar to other projects such as [configargparse ], [yconf ], [confuse ], [typer ], [OmegaConf ], [Fire ] and [click ]. The obvious question is, why yet another package similar to many already existing ones? The answer is simply that none of the existing projects had the exact features we wanted and after analyzing the alternatives it seemed simpler to start a new project. Features ======== - Great support of type hints for automatic creation of parsers and minimal boilerplate command line interfaces. - Non-intrusive/decoupled parsing logic. No need to inherit from a special class or add decorators or use custom type hints. - Easy to implement configurable dependency injection (object composition). - Support for nested namespaces making possible to parse config files with non-flat hierarchies. - Parsing of relative paths within config files and path lists. - Support for two popular supersets of json: yaml and jsonnet. - Parsers can be configured just like with python's argparse, thus it has a gentle learning curve. - Several convenient types and action classes to ease common parsing use cases (paths, comparison operators, json schemas, enums, regex strings, ...). - Support for command line tab argument completion using [argcomplete ]. .. _installation: Installation ============ You can install using [pip] as: .. code-block:: bash pip install jsonargparse By default the only dependency that jsonargparse installs is [PyYAML ]. However, several optional features can be enabled by specifying any of the following extras requires: signatures, jsonschema, jsonnet, urls, argcomplete and reconplogger. There is also the all extras require to enable all optional features. Installing jsonargparse with extras require is as follows: .. code-block:: bash pip install "jsonargparse[signatures,urls]" # Enable signatures and URLs features pip install "jsonargparse[all]" # Enable all optional features The following table references sections that describe optional features and the corresponding extras requires that enables them. +-----------------------------+-------------+-------------+---------+------------+------------+ | | urls/fsspec | argcomplete | jsonnet | jsonschema | signatures | +-----------------------------+-------------+-------------+---------+------------+------------+ | `classes-methods-functions` | | | | | ✓ | +-----------------------------+-------------+-------------+---------+------------+------------+ | `parsing-urls` | ✓ | | | | | +-----------------------------+-------------+-------------+---------+------------+------------+ | `json-schemas` | | | | ✓ | | +-----------------------------+-------------+-------------+---------+------------+------------+ | `jsonnet-files` | | | ✓ | | |
Configuration Switches (platform-specific settings discarded)
PY310 OFF Build using Python 3.10 PY311 ON Build using Python 3.11
Package Dependencies by Type
Build (only) python-pip:single:py311
autoselect-python:single:standard
Build and Runtime python311:single:standard
Runtime (only) python-PyYAML:single:py311
Download groups
main mirror://PYPIWHL/88/32/a68ac6cc18194fa88a56b1e7920e1a96deee14e759a906d902275a86c301
Distribution File Information
f4377718317c6f7b42d437ea08a1833e6afda4ecf8a2d0704d21dff1f21017af 180746 jsonargparse-4.19.0-py3-none-any.whl
Ports that require python-jsonargparse:py311
python-netbox-agent:py311 NetBox agent for server (3.11)