Following system colour scheme Selected dark colour scheme Selected light colour scheme

Python Enhancement Proposals

PEP 314 – Metadata for Python Software Packages 1.1

PEP 314 – Metadata for Python Software Packages 1.1

Author:
A.M. Kuchling, Richard Jones
Discussions-To:
Distutils-SIG list
Status:
Superseded
Type:
Standards Track
Topic:
Packaging
Created:
12-Apr-2003
Python-Version:
2.5
Post-History:
29-Apr-2003
Replaces:
241
Superseded-By:
345

Table of Contents

Important

This PEP is a historical document. The up-to-date, canonical spec, Core metadata specifications, is maintained on the PyPA specs page.

×

See the PyPA specification update process for how to propose changes.

Introduction

This PEP describes a mechanism for adding metadata to Python packages. It includes specifics of the field names, and their semantics and usage.

This document specifies version 1.1 of the metadata format. Version 1.0 is specified in PEP 241.

Including Metadata in Packages

The Distutils sdist command will extract the metadata fields from the arguments and write them to a file in the generated zipfile or tarball. This file will be named PKG-INFO and will be placed in the top directory of the source distribution (where the README, INSTALL, and other files usually go).

Developers may not provide their own PKG-INFO file. The sdist command will, if it detects an existing PKG-INFO file, terminate with an appropriate error message. This should prevent confusion caused by the PKG-INFO and setup.py files being out of sync.

The PKG-INFO file format is a single set of RFC 822 headers parseable by the rfc822.py module. The field names listed in the following section are used as the header names.

Fields

This section specifies the names and semantics of each of the supported metadata fields.

Fields marked with “(Multiple use)” may be specified multiple times in a single PKG-INFO file. Other fields may only occur once in a PKG-INFO file. Fields marked with “(optional)” are not required to appear in a valid PKG-INFO file; all other fields must be present.

Metadata-Version

Version of the file format; currently “1.0” and “1.1” are the only legal values here.

Example:

Metadata-Version: 1.1

Name

The name of the package.

Example:

Name: BeagleVote

Version

A string containing the package’s version number. This field should be parseable by one of the Version classes (StrictVersion or LooseVersion) in the distutils.version module.

Example:

Version: 1.0a2

Platform (multiple use)

A comma-separated list of platform specifications, summarizing the operating systems supported by the package which are not listed in the “Operating System” Trove classifiers. See “Classifier” below.

Example:

Platform: ObscureUnix, RareDOS

Supported-Platform (multiple use)

Binary distributions containing a PKG-INFO file will use the Supported-Platform field in their metadata to specify the OS and CPU for which the binary package was compiled. The semantics of the Supported-Platform field are not specified in this PEP.

Example:

Supported-Platform: RedHat 7.2
Supported-Platform: i386-win32-2791

Summary

A one-line summary of what the package does.

Example:

Summary: A module for collecting votes from beagles.

Description (optional)

A longer description of the package that can run to several paragraphs. Software that deals with metadata should not assume any maximum size for this field, though people shouldn’t include their instruction manual as the description.

The contents of this field can be written using reStructuredText markup [1]. For programs that work with the metadata, supporting markup is optional; programs can also display the contents of the field as-is. This means that authors should be conservative in the markup they use.

Example:

Description: This module collects votes from beagles
             in order to determine their electoral wishes.
             Do *not* try to use this module with basset hounds;
             it makes them grumpy.

Keywords (optional)

A list of additional keywords to be used to assist searching for the package in a larger catalog.

Example:

Keywords: dog puppy voting election

Home-page (optional)

A string containing the URL for the package’s home page.

Example:

Home-page: http://www.example.com/~cschultz/bvote/

Download-URL

A string containing the URL from which this version of the package can be downloaded. (This means that the URL can’t be something like “…/package-latest.tgz”, but instead must be “../package-0.45.tgz”.)

Author (optional)

A string containing the author’s name at a minimum; additional contact information may be provided.

Example:

Author: C. Schultz, Universal Features Syndicate,
        Los Angeles, CA <cschultz@peanuts.example.com>

Author-email

A string containing the author’s e-mail address. It can contain a name and e-mail address in the legal forms for a RFC 822 ‘From:’ header. It’s not optional because cataloging systems can use the e-mail portion of this field as a unique key representing the author. A catalog might provide authors the ability to store their GPG key, personal home page, and other additional metadata about the author, and optionally the ability to associate several e-mail addresses with the same person. Author-related metadata fields are not covered by this PEP.

Example:

Author-email: "C. Schultz" <cschultz@example.com>

License

Text indicating the license covering the package where the license is not a selection from the “License” Trove classifiers. See “Classifier” below.

Example:

License: This software may only be obtained by sending the
         author a postcard, and then the user promises not
         to redistribute it.

Classifier (multiple use)

Each entry is a string giving a single classification value for the package. Classifiers are described in PEP 301.

Examples:

Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console (Text Based)