Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Defining Package Metadata | Building and Managing Packages
Python Packaging and Distribution

bookDefining Package Metadata

When you are preparing your Python project for distribution, you need to provide certain metadata so that tools and users can easily identify, install, and manage your package. This metadata is specified in the pyproject.toml file, which is now the standard for Python packaging. The key metadata fields you must include are as follows:

  • Name: the unique identifier for your package on the Python Package Index (PyPI);
  • Version: the current release version of your package;
  • Author: the name of the main creator or maintainer of the package;
  • License: the type of license under which your package is distributed;
  • Description: a brief summary of what your package does;
  • Readme: the path to your README file, which provides more detailed information about your package;
  • Keywords: a list of terms to help users find your package;
  • Classifiers: a list of standardized tags that describe your package’s audience, maturity, and compatibility.

Each of these fields plays a critical role in how your package is discovered, installed, and managed by both users and automated tools. For example, the name and version fields uniquely identify a specific release, while the license field informs users about how they can use your code. The author field gives credit and a point of contact for your package. Classifiers and keywords help categorize your package for searchability.

You should always ensure that this metadata is accurate and up to date, as it directly affects how your package is presented and consumed by the Python community. Below you will see what a typical pyproject.toml metadata section looks like.

[project]
name = "my-awesome-package"
version = "1.0.0"
description = "A Python package that does awesome things"
readme = "README.md"
authors = [
  { name="Jane Doe", email="jane@example.com" }
]
license = { file="LICENSE" }
keywords = ["awesome", "python", "package"]
classifiers = [
  "Programming Language :: Python :: 3",
  "License :: OSI Approved :: MIT License",
  "Operating System :: OS Independent"
]
question mark

Which of the following is NOT a typical metadata field in pyproject.toml?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 2

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

bookDefining Package Metadata

Swipe um das Menü anzuzeigen

When you are preparing your Python project for distribution, you need to provide certain metadata so that tools and users can easily identify, install, and manage your package. This metadata is specified in the pyproject.toml file, which is now the standard for Python packaging. The key metadata fields you must include are as follows:

  • Name: the unique identifier for your package on the Python Package Index (PyPI);
  • Version: the current release version of your package;
  • Author: the name of the main creator or maintainer of the package;
  • License: the type of license under which your package is distributed;
  • Description: a brief summary of what your package does;
  • Readme: the path to your README file, which provides more detailed information about your package;
  • Keywords: a list of terms to help users find your package;
  • Classifiers: a list of standardized tags that describe your package’s audience, maturity, and compatibility.

Each of these fields plays a critical role in how your package is discovered, installed, and managed by both users and automated tools. For example, the name and version fields uniquely identify a specific release, while the license field informs users about how they can use your code. The author field gives credit and a point of contact for your package. Classifiers and keywords help categorize your package for searchability.

You should always ensure that this metadata is accurate and up to date, as it directly affects how your package is presented and consumed by the Python community. Below you will see what a typical pyproject.toml metadata section looks like.

[project]
name = "my-awesome-package"
version = "1.0.0"
description = "A Python package that does awesome things"
readme = "README.md"
authors = [
  { name="Jane Doe", email="jane@example.com" }
]
license = { file="LICENSE" }
keywords = ["awesome", "python", "package"]
classifiers = [
  "Programming Language :: Python :: 3",
  "License :: OSI Approved :: MIT License",
  "Operating System :: OS Independent"
]
question mark

Which of the following is NOT a typical metadata field in pyproject.toml?

Select the correct answer

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 2. Kapitel 2
some-alt