pep621 0.4.0

Hide navigation sidebar
Hide table of contents sidebar
Toggle table of contents sidebar

# pep621

PEP 621 metadata parsing.

## API Reference

class pep621.StandardMetadata(name, version=None, description=None, license=None, readme=None, requires_python=None, dependencies=<factory>, optional_dependencies=<factory>, entrypoints=<factory>, authors=<factory>, maintainers=<factory>, urls=<factory>, classifiers=<factory>, keywords=<factory>, scripts=<factory>, gui_scripts=<factory>, dynamic=<factory>)
  as_rfc822()
    Return type

      `RFC822Message`

  authors: List[Tuple[str, str]]
  classifiers: List[str]
  dependencies: List[packaging.requirements.Requirement]
  description: Optional[str] = None
  dynamic: List[str]
  entrypoints: Dict[str, Dict[str, str]]
  classmethod from_pyproject(data, project_dir='.')
    Return type

      `StandardMetadata`

  gui_scripts: Dict[str, str]
  keywords: List[str]
  license: Optional[pep621.License] = None
  maintainers: List[Tuple[str, str]]
  name: str
  optional_dependencies: Dict[str, List[packaging.requirements.Requirement]]
  readme: Optional[pep621.Readme] = None
  requires_python: Optional[packaging.specifiers.Specifier] = None
  scripts: Dict[str, str]
  urls: Dict[str, str]
  version: Optional[packaging.version.Version] = None
  write_to_rfc822(message)
    Return type

      `None`

class pep621.ConfigurationError(msg, *, key=None)

  Error in the backend metadata.

  property key: Optional[str]
    Return type

      `Optional`[`str`, `None`]

class pep621.License(text, file)

  Create new instance of License(text, file)

  file: Optional[str]

    Alias for field number 1

  text: str

    Alias for field number 0

class pep621.Readme(text, file, content_type)

  Create new instance of Readme(text, file, content_type)

  content_type: str

    Alias for field number 2

  file: Optional[str]

    Alias for field number 1

  text: str

    Alias for field number 0

class pep621.RFC822Message

  Simple RFC 822 message implementation.

  Note: Does not support multiline fields, as Python packaging flavored RFC 822 metadata does.

class pep621.DataFetcher(data)
  get(key)
    Return type

      `Any`

  get_dict(key)
    Return type

      `Dict`[`str`, `str`]

  get_list(key)
    Return type

      `List`[`str`]

  get_people(key)
    Return type

      `List`[`Tuple`[`str`, `str`]]

  get_str(key)
    Return type

      `Optional`[`str`, `None`]