💾 Archived View for tris.fyi › pydoc › importlib.metadata captured on 2023-01-29 at 04:14:30. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-07-16)
-=-=-=-=-=-=-
This module has no docstring.
Compatibility add-in for mapping to indicate that mapping behavior is deprecated. >>> recwarn = getfixture('recwarn') >>> class DeprecatedDict(Deprecated, dict): pass >>> dd = DeprecatedDict(foo='bar') >>> dd.get('baz', None) >>> dd['foo'] 'bar' >>> list(dd) ['foo'] >>> list(dd.keys()) ['foo'] >>> 'foo' in dd True >>> list(dd.values()) ['bar'] >>> len(recwarn) 1
get(self, name, default=None)
keys(self)
values(self)
Allow an otherwise immutable object to implement mutability for compatibility. >>> recwarn = getfixture('recwarn') >>> dl = DeprecatedList(range(3)) >>> dl[0] = 1 >>> dl.append(3) >>> del dl[3] >>> dl.reverse() >>> dl.sort() >>> dl.extend([4]) >>> dl.pop(-1) 4 >>> dl.remove(1) >>> dl += [5] >>> dl + [6] [1, 2, 5, 6] >>> dl + (6,) [1, 2, 5, 6] >>> dl.insert(0, 0) >>> dl [0, 1, 2, 5] >>> dl == [0, 1, 2, 5] True >>> dl == (0, 1, 2, 5) True >>> len(recwarn) 1
append(self, *args, **kwargs)
clear(self, /) Remove all items from list.
copy(self, /) Return a shallow copy of the list.
count(self, value, /) Return number of occurrences of value.
extend(self, *args, **kwargs)
index(self, value, start=0, stop=9223372036854775807, /) Return first index of value. Raises ValueError if the value is not present.
insert(self, *args, **kwargs)
pop(self, *args, **kwargs)
remove(self, *args, **kwargs)
reverse(self, *args, **kwargs)
sort(self, *args, **kwargs)
A Python distribution package.
at(path) Return a Distribution for the indicated metadata path :param path: a string or path-like object :return: a concrete Distribution instance for the path
discover(**kwargs) Return an iterable of Distribution objects for all packages. Pass a ``context`` or pass keyword arguments for constructing a context. :context: A ``DistributionFinder.Context`` object. :return: Iterable of Distribution objects for all packages.
from_name(name) Return the Distribution for the given package name. :param name: The name of the distribution package to search for. :return: The Distribution instance (or subclass thereof) for the named package, if found. :raises PackageNotFoundError: When the named package's distribution metadata cannot be found.
locate_file(self, path) Given a path to a file in this distribution, return a path to it.
read_text(self, filename) Attempt to load metadata file given by the name. :param filename: The name of the file in the distribution info. :return: The text if found, otherwise None.
entry_points = <property object at 0x7f75e2b313f0>
files = <property object at 0x7f75e2b31440> Files in this distribution. :return: List of PackagePath for this distribution or None Result is `None` if the metadata file that enumerates files (i.e. RECORD for dist-info or SOURCES.txt for egg-info) is missing. Result may be empty if the metadata exists but is empty.
metadata = <property object at 0x7f75e2b312b0> Return the parsed metadata for this Distribution. The returned object will have keys that name the various bits of metadata. See PEP 566 for details.
name = <property object at 0x7f75e2b31300> Return the 'Name' metadata for the distribution package.
requires = <property object at 0x7f75e2b31490> Generated requirements specified for this Distribution
version = <property object at 0x7f75e2b313a0> Return the 'Version' metadata for the distribution package.
A MetaPathFinder capable of discovering installed distributions.
Keyword arguments presented by the caller to ``distributions()`` or ``Distribution.discover()`` to narrow the scope of a search for distributions in all DistributionFinders. Each DistributionFinder may expect any parameters and should attempt to honor the canonical parameters defined below when appropriate.
name = None
path = <property object at 0x7f75e2b31530> The sequence of directory path that a distribution finder should search. Typically refers to Python installed package paths such as "site-packages" directories and defaults to ``sys.path``.
find_distributions(self, context=<importlib.metadata.DistributionFinder.Context object at 0x7f75e2b0f8e0>) Find distributions. Return an iterable of all Distribution instances capable of loading the metadata for packages matching the ``context``, a DistributionFinder.Context instance.
find_module(self, fullname, path) Return a loader for the module. If no module is found, return None. The fullname is a str and the path is a list of strings or None. This method is deprecated since Python 3.4 in favor of finder.find_spec(). If find_spec() exists then backwards-compatible functionality is provided for this method.
invalidate_caches(self) An optional method for clearing the finder's cache, if any. This method is used by importlib.invalidate_caches().
An entry point as defined by Python packaging conventions. See `the packaging docs on entry points <https://packaging.python.org/specifications/entry-points/>`_ for more information. >>> ep = EntryPoint( ... name=None, group=None, value='package.module:attr [extra1, extra2]') >>> ep.module 'package.module' >>> ep.attr 'attr' >>> ep.extras ['extra1', 'extra2']
count(self, value, /) Return number of occurrences of value.
index(self, value, start=0, stop=9223372036854775807, /) Return first index of value. Raises ValueError if the value is not present.
load(self) Load the entry point from its definition. If only a module is indicated by the value, return that module. Otherwise, return the named object.
matches(self, **params) EntryPoint matches the given parameters. >>> ep = EntryPoint(group='foo', name='bar', value='bing:bong [extra1, extra2]') >>> ep.matches(group='foo') True >>> ep.matches(name='bar', value='bing:bong [extra1, extra2]') True >>> ep.matches(group='foo', name='other') False >>> ep.matches() True >>> ep.matches(extras=['extra1', 'extra2']) True >>> ep.matches(module='bing') True >>> ep.matches(attr='bong') True
attr = <property object at 0x7f75e2b30db0>
dist = None
extras = <property object at 0x7f75e2b30d60>
group = _tuplegetter(2, 'Alias for field number 2') Alias for field number 2
module = <property object at 0x7f75e2b30bd0>
name = _tuplegetter(0, 'Alias for field number 0') Alias for field number 0
pattern = re.compile('(?P<module>[\\w.]+)\\s*(:\\s*(?P<attr>[\\w.]+)\\s*)?((?P<extras>\\[.*\\])\\s*)?