Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

Software Metadata for Humans

Project Description

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__     = "5.1.1",
  __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",
  __keywords__    = "Python / 2.7, OS independent, software development"
)

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__
5.1.1
>>> print about.__license__
MIT License
Release History

Release History

This version
History Node

5.2

History Node

5.1.1

History Node

5.1

History Node

5.0.1

History Node

5.0.0

History Node

5.0.0a1

History Node

4.0.0

History Node

4.0.0-beta

History Node

4.0.0-alpha.6

History Node

4.0.0-alpha.5

History Node

4.0.0-alpha.4

History Node

4.0.0-alpha.3

History Node

4.0.0-alpha.2

History Node

4.0.0-alpha

History Node

3.0.0-alpha.4

History Node

2.2.1

History Node

2.2.0

History Node

2.1.0

History Node

2.0.0

History Node

0.3.0

History Node

0.2.1

History Node

0.2.0

History Node

0.1.5

History Node

0.1.4

History Node

0.1.3

History Node

0.1.2-alpha.1

History Node

0.1.1-alpha.1

History Node

0.1.0-alpha.1

History Node

0.0.1-alpha.2

History Node

0.0.1-alpha.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
about-5.2.tar.gz (9.7 kB) Copy SHA256 Checksum SHA256 Source Mar 24, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting