-
-
Notifications
You must be signed in to change notification settings - Fork 33.6k
Open
Labels
Description
Documentation
Going through https://docs.python.org/3/library/importlib.metadata.html#overview I was following
cpython/Doc/library/importlib.metadata.rst
Lines 93 to 97 in d3c888b
| You can get the :ref:`metadata for a distribution <metadata>`:: | |
| >>> list(metadata('wheel')) # doctest: +SKIP | |
| ['Metadata-Version', 'Name', 'Version', 'Summary', 'Home-page', 'Author', 'Author-email', 'Maintainer', 'Maintainer-email', 'License', 'Project-URL', 'Project-URL', 'Project-URL', 'Keywords', 'Platform', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Requires-Python', 'Provides-Extra', 'Requires-Dist', 'Requires-Dist'] | |
and got as a result
>>> list(metadata('wheel'))
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
NameError: name 'metadata' is not defined
>>> from importlib.metadata import metadata
>>> list(metadata('wheel'))
['Metadata-Version', 'Name', 'Version', 'Summary', 'Keywords', 'Author-email', 'Maintainer-email', 'Requires-Python', 'Description-Content-Type', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Classifier', 'Requires-Dist', 'Requires-Dist', 'Project-URL', 'Project-URL', 'Project-URL', 'Project-URL', 'Provides-Extra', 'Description']It could make sense to add from importlib.metadata import metadata to the docs.
Cheers,
Tiago
Linked PRs
Metadata
Metadata
Assignees
Labels
Projects
Status
Todo