skillfed

dargs

Process arguments for the deep modeling project.

dargs v0.5.0.post0 134.7K downloads/30d#11,467 on PyPI7
Copyleft license GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this… (full text in the JSON record) Active released

What it is and what it does

dargs is a Python argument validation and documentation library that examines input dictionaries against a schema you define using the Argument class. It checks types, validates nested keys and sub-argument types, and supports a special variant mode where dictionary contents can be determined by the value of a flag key. The library provides three main methods: check (validates structure), normalize (adds defaults and resolves aliases), and gendoc (outputs documentation with optional HTML anchors for cross-reference).

The package integrates with PEP 484 type annotations and offers native support for Sphinx, Jupyter Notebook, and DP-GUI. It can generate JSON schema from an Argument definition for use with JSON editors, and supports loading dictionary values from external JSON or YAML files via a $ref key. It's designed for projects that need declarative, reusable argument schemas with built-in documentation generation.

Use it for:

  • Define and validate configuration dictionaries for scientific computing or deep learning pipelines with nested parameters and type safety
  • Generate documentation and JSON schemas from argument definitions for use in web UIs or IDE integrations
  • Normalize user input by applying default values and resolving aliases before passing to downstream functions
  • Handle variant argument structures where the allowed keys depend on the value of a discriminator flag
  • Integrate argument validation into Sphinx-based documentation or Jupyter notebooks for interactive parameter exploration

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Validates, normalizes, and documents structured argument dictionaries with type checking, default values, and variant support for Python programs.

Yes, if you need declarative argument validation with built-in documentation. The package is actively maintained, has low install friction, and solves a real problem for projects with complex nested configuration. The LGPLv3 license requires careful review if you're building proprietary software, but the library itself is stable and dependency-light.

Install

dargs on PyPI

pip

pip install dargs

uv

uv add dargs

poetry

poetry add dargs

Installing dargs

Before you install

Low install friction with a pure-Python wheel and only two lightweight runtime dependencies (typeguard, typing_extensions). Repository is active with recent commits and no archived status.

License in practice

LGPLv3 copyleft license requires that derivative works and modifications be distributed under the same license; proprietary applications using this as a library may need to comply with linking and disclosure obligations.

Quickstart

pip install dargs

from dargs import Argument

arg_def = Argument('config', dict, [Argument('key', str)])
arg_def.check({'key': 'value'})

Verify before relying

  • Whether JSON schema generation integrates with external JSON editors as claimed in the description
  • Scope and maturity of Sphinx and Jupyter Notebook integration features
  • Performance characteristics when validating deeply nested or large argument structures

Package facts

License GNU LESSER GENERAL PUBLIC LICENSE Version 3, 29 June 2007 Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/> Everyone is permitted to copy and distribute verbatim copies of this… (full text in the JSON record) (copyleft)
Python support supports the current Python release (>=3.7)
Install friction low — pure-Python wheel
Runtime dependencies 2 — typeguard, typing_extensions
Maintenance actively maintained — 171 days since the last release
Last repo commit
First released
Downloads 134,661/month — #11,467 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: dargs-0.5.0.post0-py3-none-any.whl

License :: OSI Approved :: GNU Lesser General Public License v3 (LGPLv3)Programming Language :: Python :: 3.7

Tags

argument validation pythondict type checkingargument schema definitioninput validation frameworkargument documentation generatorvariant argument handlingparameter validation library
validationconfigurationschema

More Software Development packages