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.1.1.tar.gz (3.0 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.1.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: python_nameof-1.1.1.tar.gz
  • Upload date:
  • Size: 3.0 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.1.1.tar.gz
Algorithm Hash digest
SHA256 a15a34497b2ebae9c477680d01281b6c3f20a91245c988feae621dbc939500b8
MD5 70d5da2ce531c85de27b6d335c54bca4
BLAKE2b-256 0c1a2fa3f616733b4c1fbadb5ff0ea5645d72d53d536591b289de3239c7b4795

See more details on using hashes here.

File details

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

File metadata

  • Download URL: python_nameof-1.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.1 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.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 e621b41a96c90f88b5ee9b1d336def83cf361de892a89fcc2bcc3d89485ea72d
MD5 e3a2756920aec6704e79955783103b3e
BLAKE2b-256 bff6cf0b256c667870ac0e48eaf75705522b3e166d23c3e1859fcf220f6d8b50

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