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
277
of that information from the ``Distribution`` class. A ``Distribution`` is an
267
-
abstract object that represents the metadata for a Python package. You can
278
+
abstract object that represents the metadata for
279
+
a Python distribution package. You can
268
280
get the ``Distribution`` instance::
269
281
270
282
>>> from importlib_metadata import distribution
@@ -291,7 +303,9 @@ for additional details.
291
303
Distribution Discovery
292
304
======================
293
305
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:
306
+
By default, this package provides built-in support for discovery of metadata
307
+
for file system and zip file distribution packages.
308
+
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
309
296
310
- ``importlib_metadata`` does not honor :class:`bytes` objects on ``sys.path``.
297
311
- ``importlib_metadata`` will incidentally honor :py:class:`pathlib.Path` objects on ``sys.path`` even though such values will be ignored for imports.
@@ -300,15 +314,18 @@ By default, this package provides built-in support for discovery of metadata for
300
314
Extending the search algorithm
301
315
==============================
302
316
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
317
+
Because distribution package metadata
318
+
is not available through :data:`sys.path` searches, or
319
+
package loaders directly,
320
+
the metadata for a distribution is found through import
305
321
system `finders`_. To find a distribution package's metadata,
306
322
``importlib.metadata`` queries the list of :term:`meta path finders <meta path finder>` on
307
323
:data:`sys.meta_path`.
308
324
309
325
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.
326
+
found on the file system.
327
+
This finder doesn't actually find any *distributions*,
328
+
but it can find their metadata.
312
329
313
330
The abstract class :py:class:`importlib.abc.MetaPathFinder` defines the
314
331
interface expected of finders by Python's import system.
0 commit comments