Python -

Card Puncher Data Processing

About is a file found at the root directory of your project and serves two primary functions:



The primary feature of is that it contains a global setup() function

It contains a global setup() function and properties.


Default properties: setup.cfg

See example

See also: Configuring setup() using setup.cfg files


from setuptools import setup, find_packages


Cli is a cli. See

cd your/project/path
python --help
Common commands: (see '--help-commands' for more) build      will build the package underneath 'build/' install    will install the package

Global options:
  --verbose (-v)      run verbosely (default)
  --quiet (-q)        run quietly (turns verbosity off)
  --dry-run (-n)      don't actually do anything
  --help (-h)         show detailed help message
  --no-user-cfg       ignore pydistutils.cfg in your home directory
  --command-packages  list of packages that provide distutils commands

Information display options (just display information, ignore any commands)
  --help-commands     list all available commands
  --name              print package name
  --version (-V)      print package version
  --fullname          print <package name>-<version>
  --author            print the author's name
  --author-email      print the author's email address
  --maintainer        print the maintainer's name
  --maintainer-email  print the maintainer's email address
  --contact           print the maintainer's name if known, else the author's
  --contact-email     print the maintainer's email address if known, else the
  --url               print the URL for this package
  --license           print the license of the package
  --licence           alias for --license
  --description       print the package description
  --long-description  print the long package description
  --platforms         print the list of platforms
  --classifiers       print the list of classifiers
  --keywords          print the list of keywords
  --provides          print the list of packages/modules provided
  --requires          print the list of packages/modules required
  --obsoletes         print the list of packages/modules made obsolete

usage: [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
   or: --help [cmd1 cmd2 ...]
   or: --help-commands
   or: cmd --help


"""A setuptools based setup module.

import setuptools

with open("", "r") as fh:
    long_description =

    author="Example Author",
    author_email="[email protected]",
    description="A small example package",
        "Programming Language :: Python :: 3",
        "License :: OSI Approved :: MIT License",
        "Operating System :: OS Independent",


  • name is the name of the package. This can be any name as long as only contains letters, numbers, _ , and -. It also must not already taken on
  • version is the package version
  • author and author_email are used to identify the author of the package.
  • description is a short, one-sentence summary of the package.
  • long_description is a detailed description of the package. This is shown on the package detail package on the Python Package Index. In this case, the long description is loaded from which is a common pattern.
  • long_description_content_type tells the index what type of markup is used for the long description. In this case, it’s Markdown.
  • url is the URL for the homepage of the project.
  • packages is a list of all Python import packages that should be included in the distribution package. Instead of listing each package manually, we can use find_packages() to automatically discover all packages and subpackages.
  • classifiers tell the index and pip some additional metadata about your package.
  • namespace_packages see Python - Namespace Package

See specification at:

Documentation / Reference

Discover More
Card Puncher Data Processing
Python - (Shipping|Packaging)

in Python Shipping in Python is defined in the setuptools framework, that uses pip and to distribute code in the wheel format See
Card Puncher Data Processing
Python - Dependency Management

See: syntax When you install a package, or declaring a dependency, you need to specify an package id that's known...
Card Puncher Data Processing
Python - Main (Entry Point)

In Python. In the . Example: To provide executable scripts,...
Card Puncher Data Processing
Python - Namespace Package

Namespace packages allow you to split the sub-packages and modules within a single package across multiple, separate distribution packages And you use this package in your code like so: Then you...
Card Puncher Data Processing
Python - Package

in Python Physically, package are the directories and modules are the files within this directories. Logically, a package is a module (parent module): which can contain: modules (submodules)...
Card Puncher Data Processing
Python - Packages (Archive, Distribution)

in Python Packages (or better Distribution package) are the result of the packaging of a project that may contains one or more (regular) package regular packageregular package A package is a compressed...
Card Puncher Data Processing
Python - Project

Project in Python as describe by The project name is specified in the name properties in the setup function of the file Project are a set of file to package a package.: one package...
Python Build Artifact Setup Py
Python - Regular Package (Shipping | Packaging)

and in Python How to release regular package adapted from (they are using the setuptools framework) With python 3. where:
Card Puncher Data Processing
Python - Script

in Python are source file that can be run. On Linux, begin your scripts with your interpreter. See or You can find them by executing the whereis commando: sys.argv[0] is the script name...
Card Puncher Data Processing
Python - Source Distribution (sdists)

in Python. Source distributions are also known as sdists for short. With and its's script. Some projects use a src or lib subdirectory as the source root In , find-packages...

Share this page:
Follow us:
Task Runner