dist_meta.metadata

Parse and create *dist-info/METADATA files.

Exceptions:

MissingFieldError

Raised when a required field is missing.

Functions:

dump(fields, filename)

Construct Python core metadata from the given fields, and write it to filename.

dumps(fields)

Construct Python core metadata from the given fields.

load(filename)

Parse Python core metadata from the given file.

loads(rawtext)

Parse Python core metadata from the given string.

exception MissingFieldError[source]

Bases: ValueError

Raised when a required field is missing.

dump(fields, filename)[source]

Construct Python core metadata from the given fields, and write it to filename.

Parameters
Return type

int

dumps(fields)[source]

Construct Python core metadata from the given fields.

Parameters

fields (MetadataMapping)

Return type

str

Changed in version 0.4.0: Added support for the License-Expression and License-File options proposed by PEP 639.

load(filename)[source]

Parse Python core metadata 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 Python core metadata from the given string.

Parameters

rawtext (str)

Return type

MetadataMapping

Returns

A mapping of the metadata fields, and the long description