{"categories":[{"label":"Software Development","url":"https://skillfed.io/packages/category/software-development/8"}],"enrichment":{"capability":"Retrieves variable names at runtime from inside functions and classes, and provides utilities to fetch argument names and detect attribute access patterns.","skillfed_tags":["metaprogramming","introspection","debugging"],"use_cases":["Automatically populate an object's id or name field with the variable name it was assigned to.","Create dictionaries from variables without repeating key names (jsobj helper).","Implement debug utilities that print variable names and values together.","Fetch the names or source expressions of arguments passed to a function.","Detect which attribute will be accessed next on an object (will function)."],"what_it_does":"Varname is a metaprogramming library that uses stack frame inspection to retrieve the names of variables that function or class calls are assigned to, from inside those functions or classes. It exposes this core capability through functions like `varname()` (to get the assignment variable name), `argname()` (to fetch the names or source of arguments passed to a function), and `will()` (to detect the next attribute access). The library depends on executing for bytecode inspection and typing-extensions for type hints.\n\nThe package is useful when you need runtime introspection of variable names\u2014for instance, to automatically populate an object's `__varname__` attribute with the name it was assigned to, to create dictionaries without explicitly repeating key names, or to implement debugging utilities that print variable names alongside their values. It handles complex cases like multiple assignment, nested unpacking, and calls wrapped through intermediate functions.","worth_installing":"Yes. The package is actively maintained, has low install friction, carries a permissive MIT license, and solves a real metaprogramming need. It is well-documented with concrete examples. Install it if you need runtime variable name introspection; skip it if your code does not require that capability."},"id":"varname","links":{"html":"https://skillfed.io/packages/varname","md":"https://skillfed.io/packages/varname.md","pypi":"https://pypi.org/project/varname/"},"maintenance":{"status":"active"},"meta":{"latest_release":"2026-04-16","license_spdx":null,"license_treatment":"permissive","name":"varname","python_support":"supports_current","summary":"Dark magics about variable names in python."},"popularity":{"monthly_downloads":414920,"position":6828,"tier":"top_15000"},"security":{"n_vulnerabilities":0},"version":"1.0.0"}
