--- id: qualname version: "0.1.0" license: BSD license_treatment: permissive maintenance: abandoned --- # qualname — __qualname__ emulation for older Python versions License: permissive · Maintenance: abandoned · Downloads: 395.8K/mo ## What it is and what it does qualname is a backport shim that adds the `__qualname__` attribute (introduced in Python 3.3) to classes and functions in older Python versions. It works by inspecting and parsing the source code of the module containing the target object, then walking its abstract syntax tree to determine the fully qualified name—for example, 'C.D.g' for a method g inside a nested class D inside class C. The package is designed for Python 2.6–3.4 codebases that need to introspect nested class and function names before `__qualname__` became standard. It has no runtime dependencies and relies entirely on the `ast` module and source file availability. However, the package has been unmaintained since 2015 and is incompatible with modern Python versions. Use it for: - Introspect qualified names of nested classes and methods in Python 2 or early Python 3 code for logging or debugging. - Support legacy Python 2 codebases that require qualified name information for reflection or dynamic dispatch. - Provide a uniform API for accessing qualified names across Python 2 and 3.3+ in projects that must support both. - Enable error reporting or stack trace formatting that includes the full qualified name of a function or class. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a `qualname()` function that emulates Python 3.3+'s `__qualname__` attribute for classes and nested functions in older Python versions by parsing source code and traversing the AST. No. The package is abandoned (last release 2015-04-11, no updates since then) and explicitly targets Python 2.6–3.4, all of which are end-of-life. Modern Python has `__qualname__` built-in. Install only if you are maintaining legacy Python 2 code with no path to upgrade and have verified the package works in your specific environment. ## Install pip install qualname uv add qualname poetry add qualname ## Installing qualname Before you install: High install friction: the package has been abandoned since its only release on 2015-04-11, with no updates since then. It targets Python 2.6–3.4, versions now far outside modern support. Installation may succeed but the package is unmaintained and unlikely to receive bug fixes. License in practice: BSD license is permissive and imposes minimal restrictions on use or modification, making it safe to incorporate into most projects from a licensing standpoint. Quickstart: pip install qualname from qualname import qualname class C: class D: def g(self): pass print(qualname(C.D.g)) # 'C.D.g' Requires source files to be available on disk; does not work with dynamically generated or compiled code. Targets Python 2.6–3.4; behavior on modern Python versions is untested. Verify before relying: - Whether the package functions correctly on Python 3.5+, given it was last released in 2015 and explicitly targets only up to 3.4. - Whether source-code-based AST parsing handles all edge cases (decorators, metaclasses, dynamic definitions) reliably. - Current real-world usage: the package has 395769 monthly downloads but was abandoned in 2015, suggesting either legacy dependents or inflated statistics. ## Package facts - License: BSD (permissive) - Python support: unspecified - Install friction: high - Maintenance: abandoned - Downloads: 395.8K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags qualified name emulation, qualname python 2, __qualname__ backport, nested class names, function qualified names, python 2 compatibility, ast source inspection, legacy-python, backport, introspection [View on SkillFed](https://skillfed.io/packages/qualname) · [View on PyPI](https://pypi.org/project/qualname/)