func_args
A lightweight Python library for creating wrapper functions with enhanced argument handling using sentinel values to mark parameters as required or optional.
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 on this page — 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
func-args on PyPI
pip
pip install func-argsuv
uv add func-argspoetry
poetry add func-argsInstalling 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 the current Python release (<4.0,>=3.10) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 108 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 851,788/month — #4,901 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: func_args-1.0.2-py3-none-any.whl
Tags
More Software Development packages
Provides backported and experimental type hints…
permissive · top 100 on PyPI
numpyNumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
fastapiFastAPI is a Python web framework for building…
permissive · top 100 on PyPI
annotated-docProvides a way to document function parameters,…
permissive · top 100 on PyPI
typerTyper builds command-line applications from…
permissive · top 1,000 on PyPI
distlibDistlib provides low-level packaging utilities…
permissive · top 1,000 on PyPI
nulltypeDefines custom null and sentinel values that…
permissive · top 5,000 on PyPI
niltypeProvides a `Nil` singleton object to represent…
permissive · top 15,000 on PyPI
strongtypingA runtime type-checking decorator that…
permissive · top 15,000 on PyPI
django-bracesProvides reusable mixin classes for Django…
permissive · top 15,000 on PyPI
sentinelsProvides singleton sentinel objects with…
permissive · top 5,000 on PyPI
Redis-Sentinel-UrlParses redis:// and redis+sentinel:// URLs and…
permissive · top 15,000 on PyPI
sentinelCreates singleton sentinel objects that…
permissive · top 15,000 on PyPI
argparse-dataclassBuilds command-line interfaces declaratively by…
permissive · top 5,000 on PyPI
mo-kwargsProvides an `@override` decorator that lets you…
copyleft · top 15,000 on PyPI
responsesMocks HTTP requests made by the requests…
permissive · top 1,000 on PyPI