dist_meta.wheel

Parse and create *dist-info/WHEEL files.

Functions:

dump(fields, filename)

Construct a WHEEL file from the given fields, and write it to filename.

dumps(fields)

Construct a WHEEL file from the given fields.

load(filename)

Parse a WHEEL file from the given file.

loads(rawtext)

Parse a WHEEL file from the given string.

parse_generator_string(generator)

Parse a generator string into its name and version.

dump(fields, filename)[source]

Construct a WHEEL file from the given fields, and write it to filename.

Parameters
Return type

int

dumps(fields)[source]

Construct a WHEEL file from the given fields.

Parameters

fields (Union[Mapping[str, Any], MetadataMapping]) – May be a conventional mapping, with Root-Is-Purelib as a boolean and Tag as a list of strings.

Return type

str

load(filename)[source]

Parse a WHEEL file from the given file.

Parameters

filename (Union[str, Path, PathLike])

Return type

MetadataMapping

Returns

A mapping of the metadata fields, and the long description

loads(rawtext)[source]

Parse a WHEEL file from the given string.

Parameters

rawtext (str)

Return type

MetadataMapping

Returns

A mapping of the metadata fields, and the long description

parse_generator_string(generator)[source]

Parse a generator string into its name and version.

Common forms include:

  • name (version)

  • name version

  • name

New in version 0.6.0.

Parameters

generator (str) – The raw generator string (the Generator field in WHEEL).

Return type

Tuple[str, Optional[str]]

Returns

A tuple of the generator name and its version. The version may be None if no version could be found.