MCPcopy Index your code
hub / github.com/python/cpython / read_text

Method read_text

Lib/importlib/metadata/__init__.py:411–431  ·  view source on GitHub ↗

Attempt to load metadata file given by the name. Python distribution metadata is organized by blobs of text typically represented as "files" in the metadata directory (e.g. package-1.0.dist-info). These files include things like: - METADATA: The distribution

(self, filename)

Source from the content-addressed store, hash-verified

409
410 @abc.abstractmethod
411 def read_text(self, filename) -> str | None:
412 """Attempt to load metadata file given by the name.
413
414 Python distribution metadata is organized by blobs of text
415 typically represented as "files" in the metadata directory
416 (e.g. package-1.0.dist-info). These files include things
417 like:
418
419 - METADATA: The distribution metadata including fields
420 like Name and Version and Description.
421 - entry_points.txt: A series of entry points as defined in
422 `the entry points spec <https://packaging.python.org/en/latest/specifications/entry-points/#file-format>`_.
423 - RECORD: A record of files according to
424 `this recording spec <https://packaging.python.org/en/latest/specifications/recording-installed-packages/#the-record-file>`_.
425
426 A package may provide any set of files, including those
427 not listed here or none at all.
428
429 :param filename: The name of the file in the distribution info.
430 :return: The text if found, otherwise None.
431 """
432
433 @abc.abstractmethod
434 def locate_file(self, path: str | os.PathLike[str]) -> SimplePath:

Callers 7

metadataMethod · 0.95
entry_pointsMethod · 0.95
_read_files_distinfoMethod · 0.95
_read_egg_info_reqsMethod · 0.95
_load_jsonMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected