Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Argument Names

A Python library that provides a decorator to automatically retrieve and process the argument names of a function when it's called. This can be useful for tasks like debugging, logging, or other custom operations.

Installation

Install argument-names via pip:

pip install argument-names

Use Case Example

This example demonstrates how to utilize the argument_names decorator to log the names of the arguments passed to a function:

from argument_names import argument_names

@argument_names(function=lambda *args: print("Received arguments:", *args))
def process_data(_1, _2, _3):
    pass

# Example invocation
name = "Alice"
age = 30
occupation = "Engineer"

# Calling the process_data function with the specified arguments
process_data(name, age, occupation)   # Received arguments: name age occupation

process_data(occupation, age, age)   # Received arguments: occupation age age
from argument_names import argument_names

@argument_names(function=lambda *args: print("".join(args)))
def foo(*args):
    pass

h = None
e = 1
l = 9
o = 3
w = True
r = 3.14
d = 600
_ = 0.03

foo(h, e, l, l, o, _, w, o, r, l, d) # hello_world

Limitations

  • The library requires you to provide named variables as arguments when calling the decorated function. Direct values, literals, or function calls will not work as expected.

    For example, calling process_data("Alice", 30, "Engineer") would not work properly because the arguments are passed as values, not named variables. You must use named arguments like in the example process_data(name, age, occupation).

Metadata

Release files for argument-names 0.1.0a2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for argument-names 0.1.0a2
File Size Uploaded Provenance
argument_names-0.1.0a2.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for argument-names 0.1.0a2
File Interpreter ABI Platform
argument_names-0.1.0a2-py3-none-any.whl Python 3 none any Details

Total release size: 8.5 kB

Release files / argument_names-0.1.0a2.tar.gz

Download URL argument_names-0.1.0a2.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
156e97034bc1e917b0754533d8a1601ea8568e968fae0c30eb549ffba2a70654
BLAKE2b-256 checksum
How to use checksums
8cc555ba045c9e0a656f19f370ad62d35fcd04539245ca434c2dc9c3c91d4b33
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.19.1 CPython/3.10.14 Windows/10

Release files / argument_names-0.1.0a2-py3-none-any.whl

Download URL argument_names-0.1.0a2-py3-none-any.whl
Size 4.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
853217a989d38a32c49048d09d86df90313d1ce0abaf31832da2fb80cff44b70
BLAKE2b-256 checksum
How to use checksums
3a049dc9087810907490245f51236b30a0f998039a7ebbb4bd5b4e88115cc7cc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via pdm/2.19.1 CPython/3.10.14 Windows/10

Security for argument-names 0.1.0a2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page