Skip to main content

A Python implementation of the C# nameof operator.

Project description

Python implementation of the C# nameof operator

python-nameof

A Python utility that mimics the C# nameof operator, allowing you to get variable or attribute names as strings.

Installation

pip install python-nameof

Usage

from nameof import nameof

foo = 123
print(nameof(foo))  # Output: 'foo'

class Bar:
    attr = 99
bar = Bar()
print(nameof("bar.attr"))  # Output: 'attr'

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

python_nameof-1.0.1.tar.gz (2.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

python_nameof-1.0.1-py3-none-any.whl (3.0 kB view details)

Uploaded Python 3

File details

Details for the file python_nameof-1.0.1.tar.gz.

File metadata

  • Download URL: python_nameof-1.0.1.tar.gz
  • Upload date:
  • Size: 2.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for python_nameof-1.0.1.tar.gz
Algorithm Hash digest
SHA256 5e9e56518f9ae7e7961b2b35581dcf086b05925fb19e6b2847ee567539362e5c
MD5 cfbe64cecade6d75aa20650e669724b6
BLAKE2b-256 a99066a79dd500f008264af5a9b1c260b6f69318f63d8802440ac6bdea36ca64

See more details on using hashes here.

File details

Details for the file python_nameof-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: python_nameof-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 3.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.11

File hashes

Hashes for python_nameof-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e1bcc4231a9074374d91f2268770d5edd88c5656b798f18b8bc0b100cc552aaa
MD5 99a29cc3a816fa38774ab7dbfbc20b25
BLAKE2b-256 8487c6d1f82e567446d347d4747e4a6322bc4c12f77b665eff5e66fcce7c49cf

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page