You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While the above API is the most common and convenient usage, you can get all
266
293
of that information from the ``Distribution`` class. A ``Distribution`` is an
267
-
abstract object that represents the metadata for a Python package. You can
294
+
abstract object that represents the metadata for
295
+
a Python :term:`packaging:Distribution Package`. You can
268
296
get the ``Distribution`` instance::
269
297
270
298
>>> from importlib_metadata import distribution
@@ -284,14 +312,16 @@ instance::
284
312
>>> dist.metadata['License']
285
313
'MIT'
286
314
287
-
The full set of available metadata is not described here. See :pep:`566`
288
-
for additional details.
315
+
The full set of available metadata is not described here.
316
+
See the :ref:`packaging:core-metadata` for additional details.
289
317
290
318
291
319
Distribution Discovery
292
320
======================
293
321
294
-
By default, this package provides built-in support for discovery of metadata for file system and zip file packages. This metadata finder search defaults to ``sys.path``, but varies slightly in how it interprets those values from how other import machinery does. In particular:
322
+
By default, this package provides built-in support for discovery of metadata
323
+
for file system and zip file :term:`packaging:Distribution Package`\s.
324
+
This metadata finder search defaults to ``sys.path``, but varies slightly in how it interprets those values from how other import machinery does. In particular:
295
325
296
326
- ``importlib_metadata`` does not honor :class:`bytes` objects on ``sys.path``.
297
327
- ``importlib_metadata`` will incidentally honor :py:class:`pathlib.Path` objects on ``sys.path`` even though such values will be ignored for imports.
@@ -300,15 +330,18 @@ By default, this package provides built-in support for discovery of metadata for
300
330
Extending the search algorithm
301
331
==============================
302
332
303
-
Because package metadata is not available through :data:`sys.path` searches, or
304
-
package loaders directly, the metadata for a package is found through import
333
+
Because :term:`packaging:Distribution Package` metadata
334
+
is not available through :data:`sys.path` searches, or
335
+
package loaders directly,
336
+
the metadata for a distribution is found through import
305
337
system `finders`_. To find a distribution package's metadata,
306
338
``importlib.metadata`` queries the list of :term:`meta path finders <meta path finder>` on
307
339
:data:`sys.meta_path`.
308
340
309
341
By default ``importlib_metadata`` installs a finder for distribution packages
310
-
found on the file system. This finder doesn't actually find any *packages*,
311
-
but it can find the packages' metadata.
342
+
found on the file system.
343
+
This finder doesn't actually find any *distributions*,
344
+
but it can find their metadata.
312
345
313
346
The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the
314
347
interface expected of finders by Python's import system.
0 commit comments