Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Summary: define the metadata of your project in a single place, then make it available at setup-time and at runtime.

Let’s consider the about package as an example ; we add to our project files, in the source tree, a file named about.py that contains the metadata of the project:

about
|--- setup.py
|--- README.md
|...
|--- about
|    |--- __init__.py
|    |...
|    |--- about.py

This file contains the metadata (and a little boilerplate):

# coding: utf-8

metadata = dict(
  __name__        = "about",
  __version__     = "4.0.0",
  __license__     = "MIT License",
  __author__      = u"Sébastien Boisgérault <Sebastien.Boisgerault@gmail.com>",
  __url__         = "https://warehouse.python.org/project/about",
  __summary__     = "Software Metadata for Humans",
  __readme__      = "README.md",
  __classifiers__ = ["Programming Language :: Python :: 2.7" ,
                     "Topic :: Software Development"         ,
                     "Operating System :: OS Independent"    ,
                     "Intended Audience :: Developers"       ,
                     "License :: OSI Approved :: MIT License",
                     "Development Status :: 3 - Alpha"       ]
)

globals().update(metadata)
__all__ = metadata.keys()

Setup. To use this metadata, the setup.py file includes the code:

import about
import about.about

info = about.get_metadata(about.about)

# add extra information (contents, requirements, etc.).
info.update(...)

if __name__ == "__main__":
    setuptools.setup(**info)

Runtime. The metadata is stored as a collection of attributes of the about.about module. If we include in the about/__init__.py file the one-liner

from .about import *

they become available in the top-level module:

>>> import about
>>> print about.__name__
about
>>> print about.__version__
4.0.0
>>> print about.__license__
MIT License

Metadata

Release files for about 4.0.0-beta

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for about 4.0.0-beta
File Size Uploaded Provenance
about-4.0.0-beta.tar.gz 39.2 kB Without provenance Details

Release files / about-4.0.0-beta.tar.gz

Download URL about-4.0.0-beta.tar.gz
Size 39.2 kB
Tags Source
SHA-256 checksum
How to use checksums
b6d2c6960cde13edc0afa1e5d872868f270ba130d5673cbdf9cfeb71ec452fde
BLAKE2b-256 checksum
How to use checksums
05b082489a381ac11db35aeedccb05751c7c39240ce10c10e4a726c82fc731e1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for about 4.0.0-beta

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release
Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page