$npx skillfedfor your agent

nameof

Get the name of a variable or attribute, as in C#

SkipPyPI Software DevelopmentReleased Feb 2020208.9K downloads / moMITSource build

Decision gist · record as of 2026-08-14

sdist only — nameof-0.0.1.tar.gz · builds from source
v0.0.1 · released 2020-02-01

No. The author explicitly recommends against this package in the description. The project is abandoned, last released 2020-02-01, and relies on fragile AST inspection that breaks with common tools. High install friction and lack of maintenance make it unsuitable for any new project.AI-flagged interpretation of the facts on this page — verify before relying

Before you install

  • The argument must be a variable or attribute; does not work in the presence of AST-modifying tools like pytest.
  • High install friction.
  • The package is abandoned (repository archived, last release 2020-02-01) and the author explicitly recommends switching to an alternative instead.

License · maintenance · safety

MIT (permissive) — MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

last release 2020-02-01 (2386 days) · last repo commit 2024-12-07 · 18 stars · archived

0 known vulnerabilities (OSV.dev, 2026-08-14) · 208,877 downloads/mo, #9,523 on PyPI

Verify before relying

pip install nameof

from nameof import nameof
assert nameof(foo) == "foo"
assert nameof(foo.bar) == "bar"
  • Whether the package works reliably with Python versions beyond 3.8
  • Specific AST-based limitations beyond pytest and birdseye that may affect usage
  • Whether the recommended alternative is a drop-in replacement or requires code changes
Same gist for agents: .md · .json

What it is and what it does

nameof is a utility that extracts the string name of a variable or object attribute at runtime by inspecting the abstract syntax tree (AST). It attempts to replicate C#'s nameof operator, allowing code like `nameof(foo)` to return the string `"foo"`. The package has no runtime dependencies and consists of minimal code that can be copied directly into a project if needed.

However, the author explicitly states this was a toy project and recommends using an alternative instead. The package is abandoned, with its repository archived and no releases since 2020-02-01. It relies on fragile AST manipulation that breaks in the presence of other AST-modifying tools like pytest, and the author cautions that code depending on it should be thoroughly tested. It is not suitable for production use.

Use it for

  • Debugging and logging where you need to print variable names alongside their values
  • Generating field names dynamically in data validation or ORM frameworks
  • Building introspection tools that require mapping runtime objects back to their source variable names

Worth the install?

AI-flagged interpretation of the facts on this page. Verify before relying on it.

Skip

No.

The author explicitly recommends against this package in the description. The project is abandoned, last released 2020-02-01, and relies on fragile AST inspection that breaks with common tools. High install friction and lack of maintenance make it unsuitable for any new project.

Install

nameof on PyPI

Before you install

High install friction. The package is abandoned (repository archived, last release 2020-02-01) and the author explicitly recommends switching to an alternative instead.

The argument must be a variable or attribute; does not work in the presence of AST-modifying tools like pytest.

License in practice

MIT license permits commercial and private use with minimal restrictions, requiring only license and copyright notice retention.

Quickstart

pip install nameof

from nameof import nameof
assert nameof(foo) == "foo"
assert nameof(foo.bar) == "bar"

Verify before relying

  • Whether the package works reliably with Python versions beyond 3.8
  • Specific AST-based limitations beyond pytest and birdseye that may affect usage
  • Whether the recommended alternative is a drop-in replacement or requires code changes

Package facts

LicenseMIT permissive
Python supportNot specified
Install frictionHigh. Source build required
Runtime dependenciesNone
MaintenanceAbandoned 2,386 days since the last release
Last repo commit repository archived
First released
Downloads208,877 / month, #9,523 on PyPI 30-day window, as of 2026-08-14
Known vulnerabilitiesNone known OSV.dev, checked 2026-08-14
Classifiers
License :: OSI Approved :: MIT LicenseProgramming Language :: PythonProgramming Language :: Python :: 3.4Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8

Evidence: nameof-0.0.1.tar.gz

Tags

Capabilities
get variable name as stringnameof functionality pythonvariable name introspectionattribute name reflectionruntime variable naming
Topics
ast-introspectionabandoned

Let your AI agent find packages like this

Example. Real query, live index.

You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.

wish › “get variable name as string”

  • nameofRetrieves the name of a variable or attribute as a string at runtime…
  • varnameRetrieves variable names at runtime from inside functions and…
  • namedProvides utilities to inspect and work with Python type names and…

Give your agent the search over MCP, or paste the wish link into any chat.

More Software Development packages

typing-extensions Worth it
PyPI · Software Development · released Jul 2026

Provides backported and experimental type hints for Python 3.9+, allowing use of newer typing features on older Python versions and enabling early experimentation with type system PEPs before they enter the standard library.

PSF-2.0pure Python · 3.9+
1.9Bdownloads / mo
numpy Worth it
PyPI · Software Development · released Aug 2026

NumPy provides an N-dimensional array object and a comprehensive suite of mathematical, linear algebra, Fourier transform, and random number functions for scientific computing in Python.

BSD-3-Clause AND 0BSD AND MIT AND Zlib AND CC0-1.0compiled wheel · 3.12+
1.1Bdownloads / mo
fastapi Worth it
PyPI · Software Development · released Jul 2026

FastAPI is a Python web framework for building REST APIs using type hints, with automatic request validation, serialization, and interactive API documentation.

MITpure Python · 3.10+
568.6Mdownloads / mo
annotated-doc With conditions
PyPI · Software Development · released Jul 2026

Provides a way to document function parameters, class attributes, return types, and variables inline using Python's `Annotated` type hint syntax instead of traditional docstrings.

MITpure Python · 3.9+
456.2Mdownloads / mo
typer Worth it
PyPI · Software Development · released Aug 2026

Typer builds command-line applications from Python functions using type hints, automatically generating help text, argument parsing, and shell completion.

Install it if you are building CLIs in Python.

MITpure Python · 3.10+
369.3Mdownloads / mo
distlib With conditions
PyPI · Software Development · released Jun 2026

Distlib provides low-level packaging utilities for building, distributing, and managing Python software—including metadata handling, version specifiers, wheel support, script installation, and dependency resolution.

permissive licensepure Python
323.3Mdownloads / mo

See also varname · executing · typing-inspect · typing-inspection · attributes-doc · read-version · qualname · grpcio-reflection · snoop · inspect2