💾 Archived View for tris.fyi › pydoc › importlib.metadata captured on 2022-07-16 at 15:04:06. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2022-04-28)
-=-=-=-=-=-=-
This module has no docstring.
ConfigParser implementing interpolation.
add_section(self, section) Create a new section in the configuration. Extends RawConfigParser.add_section by validating if the section name is a string.
clear(self) D.clear() -> None. Remove all items from D.
defaults(self)
get(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x7f92bedf8060>) Get an option value for a given section. If `vars' is provided, it must be a dictionary. The option is looked up in `vars' (if provided), `section', and in `DEFAULTSECT' in that order. If the key is not found and `fallback' is provided, it is used as a fallback value. `None' can be provided as a `fallback' value. If interpolation is enabled and the optional argument `raw' is False, all interpolations are expanded in the return values. Arguments `raw', `vars', and `fallback' are keyword only. The section DEFAULT is special.
getboolean(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x7f92bedf8060>, **kwargs)
getfloat(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x7f92bedf8060>, **kwargs)
getint(self, section, option, *, raw=False, vars=None, fallback=<object object at 0x7f92bedf8060>, **kwargs)
has_option(self, section, option) Check for the existence of a given option in a given section. If the specified `section' is None or an empty string, DEFAULT is assumed. If the specified `section' does not exist, returns False.
has_section(self, section) Indicate whether the named section is present in the configuration. The DEFAULT section is not acknowledged.
items(self, section=<object object at 0x7f92bedf8060>, raw=False, vars=None) Return a list of (name, value) tuples for each option in a section. All % interpolations are expanded in the return values, based on the defaults passed into the constructor, unless the optional argument `raw' is true. Additional substitutions may be provided using the `vars' argument, which must be a dictionary whose contents overrides any pre-existing defaults. The section DEFAULT is special.
keys(self) D.keys() -> a set-like object providing a view on D's keys
options(self, section) Return a list of option names for the given section name.
optionxform(self, optionstr)
pop(self, key, default=<object object at 0x7f92bfcfe170>) D.pop(k[,d]) -> v, remove specified key and return the corresponding value. If key is not found, d is returned if given, otherwise KeyError is raised.
popitem(self) Remove a section from the parser and return it as a (section_name, section_proxy) tuple. If no section is present, raise KeyError. The section DEFAULT is never returned because it cannot be removed.
read(self, filenames, encoding=None) Read and parse a filename or an iterable of filenames. Files that cannot be opened are silently ignored; this is designed so that you can specify an iterable of potential configuration file locations (e.g. current directory, user's home directory, systemwide directory), and all existing configuration files in the iterable will be read. A single filename may also be given. Return list of successfully read files.
read_dict(self, dictionary, source='<dict>') Read configuration from a dictionary. Keys are section names, values are dictionaries with keys and values that should be present in the section. If the used dictionary type preserves order, sections and their keys will be added in order. All types held in the dictionary are converted to strings during reading, including section names, option names and keys. Optional second argument is the `source' specifying the name of the dictionary being read.
read_file(self, f, source=None) Like read() but the argument must be a file-like object. The `f' argument must be iterable, returning one line at a time. Optional second argument is the `source' specifying the name of the file being read. If not given, it is taken from f.name. If `f' has no `name' attribute, `<???>' is used.
read_string(self, string, source='<string>') Read configuration from a given string.
readfp(self, fp, filename=None) Deprecated, use read_file instead.
remove_option(self, section, option) Remove an option.
remove_section(self, section) Remove a file section.
sections(self) Return a list of section names, excluding [DEFAULT]
set(self, section, option, value=None) Set an option. Extends RawConfigParser.set by validating type and interpolation syntax on the value.
setdefault(self, key, default=None) D.setdefault(k[,d]) -> D.get(k,d), also set D[k]=d if k not in D
update(self, other=(), /, **kwds) D.update([E, ]**F) -> None. Update D from mapping/iterable E and F. If E present and has a .keys() method, does: for k in E: D[k] = E[k] If E present and lacks .keys() method, does: for (k, v) in E: D[k] = v In either case, this is followed by: for k, v in F.items(): D[k] = v
values(self) D.values() -> an object providing a view on D's values
write(self, fp, space_around_delimiters=True) Write an .ini-format representation of the configuration state. If `space_around_delimiters' is True (the default), delimiters between keys and values are surrounded by spaces. Please note that comments in the original configuration file are not preserved when writing the configuration back.
BOOLEAN_STATES = {'1': True, 'yes': True, 'true': True, 'on': True, '0': False, 'no': False, 'false': False, 'off': False}
NONSPACECRE = re.compile('\\S')
OPTCRE = re.compile('\n (?P<option>.*?) # very permissive!\n \\s*(?P<vi>=|:)\\s* # any number of space/tab,\n # followed by any of t, re.VERBOSE)
OPTCRE_NV = re.compile('\n (?P<option>.*?) # very permissive!\n \\s*(?: # any number of space/tab,\n (?P<vi>=|:)\\s* # optionally followed , re.VERBOSE)
SECTCRE = re.compile('\n \\[ # [\n (?P<header>[^]]+) # very permissive!\n \\] # ]\n ', re.VERBOSE)
converters = <property object at 0x7f92bee11d60>
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 0x7f92bee1c590>
files = <property object at 0x7f92bee1c5e0> 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 0x7f92bee1c4f0> 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.
requires = <property object at 0x7f92bee1c630> Generated requirements specified for this Distribution
version = <property object at 0x7f92bee1c540> 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 0x7f92bee1c6d0> The path that a distribution finder should search. Typically refers to Python package paths and defaults to ``sys.path``.
find_distributions(self, context=<importlib.metadata.DistributionFinder.Context object at 0x7f92bee1e220>) 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.
attr = <property object at 0x7f92bee1c310>
extras = <property object at 0x7f92bee1c400>
group = _tuplegetter(2, 'Alias for field number 2') Alias for field number 2
module = <property object at 0x7f92bee7d220>
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*)?