--- id: func-args version: "1.0.2" license: MIT license_treatment: permissive maintenance: active --- # func_args — A lightweight Python library for creating wrapper functions with enhanced argument handling using sentinel values to mark parameters as required or optional. License: permissive · Maintenance: active · Downloads: 851.8K/mo ## What it is and what it does func_args is a lightweight, zero-dependency Python library that solves a common problem when wrapping third-party APIs: cleanly separating required parameters from optional ones and automatically validating or filtering them. It provides two sentinel values—REQ to mark required parameters and OPT to mark optional ones—along with utility functions like prepare_kwargs() that validate required arguments and remove optional ones in a single pass. Beyond simple wrapper functions, the package includes dataclass mixins (BaseModel and BaseFrozenModel) that let you define dataclasses with REQ and OPT defaults in any order, bypassing Python's standard restriction that fields without defaults must come before fields with defaults. This is useful for building configuration objects or data structures where the order of definition matters more than the order of required versus optional fields. Use it for: - Creating a cleaner wrapper around a third-party API where you want to enforce required parameters and exclude optional ones. - Building configuration dataclasses where optional fields need to appear before required ones in the class definition. - Validating function arguments in a wrapper that passes them through to an underlying API, raising an error early if required. - Constructing kwargs dictionaries that filter out sentinel values before passing them to external functions. - Defining frozen configuration objects with computed fields that require some parameters but not others. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides sentinel values (REQ and OPT) and utility functions to simplify wrapper function creation around third-party APIs by marking parameters as required or optional and automatically validating or filtering them. Yes. The package solves a genuine problem in API wrapper design with zero dependencies, active maintenance, and a permissive license. It is well-suited for anyone building wrapper functions around third-party APIs or defining dataclasses with flexible required/optional field ordering. No known vulnerabilities and straightforward installation make it a low-risk addition. ## Install pip install func-args uv add func-args poetry add func-args ## Installing func_args Before you install: Zero runtime dependencies and a pure Python wheel make installation straightforward. The package is actively maintained with recent releases and supports modern Python versions from 3.10 through 3.14. License in practice: MIT license is permissive and places no restrictions on use, modification, or distribution in commercial or private projects. Quickstart: from func_args.api import REQ, OPT, prepare_kwargs def wrapper(required_arg=REQ, optional_arg=OPT): kwargs = dict(required_arg=required_arg, optional_arg=optional_arg) return prepare_kwargs(**kwargs) wrapper(required_arg="value") Requires Python 3.10 or later. Verify before relying: - Whether the dataclass mixins work correctly with all standard dataclass decorators and field configurations. - Performance characteristics when used with large numbers of parameters or high-frequency call patterns. ## Package facts - License: MIT (permissive) - Python support: supports_current - Install friction: low - Maintenance: active - Downloads: 851.8K/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags wrapper function argument handling, required optional parameter markers, third-party api wrapper utilities, function parameter validation, sentinel values for function args, dataclass with required optional fields, kwargs preparation and filtering, api-wrapper, parameter-validation, dataclass-utilities [View on SkillFed](https://skillfed.io/packages/func-args) · [View on PyPI](https://pypi.org/project/func-args/)