Skip to main content

Example Project Structure for a Python / PyPI Project

Project description


Example Project Structure for a Python / PyPI Project


Note that this supports Python 3 ONLY

Basic Usage

Warning eggs are deprecated in favor of wheels, and not supported by pip.

This project is a sample template used to aggregate the process of:

  • Laying out a python project
  • Using setuptools build system to
    • to facilitate packaging Python projects
    • Python package and module definitions
    • Distribution package metadata
    • Project installation

Outline the process to

  • Create Python Eggs - a single-file importable distribution format
  • Automatically include all packages in your source tree, without listing them individually in
  • Automatically generate wrapper scripts or Windows (console and GUI) .exe files for any number of “main” functions in your project. (Note: this is not a py2exe replacement; the .exe files rely on the local Python installation.)

Command Reference

For example, to produce a source distribution, simply invoke:

python sdist

Detailed instructions to distribute a setuptools project can be found at Packaging project tutorials.

Before you begin, make sure you have the latest versions of setuptools and wheel:

python -m pip install --user --upgrade setuptools wheel

To build a setuptools project, run this command from the same directory where is located:

python sdist bdist_wheel

This will generate distribution archives in the dist directory.

Uploading to

Before you upload the generated archives make sure you’re registered on

You will also need to verify your email to be able to upload any packages. You should install twine to be able to upload packages:

python -m pip install --user --upgrade twine

Now, to upload these archives, run:

python -m twine upload --repository-url dist/*

To install your newly uploaded package example_pkg, you can use pip:

python -m pip install --index-url example_pkg

If you have issues at any point, please refer to Packaging project tutorials for clarification.


Patrick Shiel:


MIT License

Project details

Download files

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

Files for pyprojecttemplate, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size pyprojecttemplate-0.2.0-py3.8.egg (4.7 kB) File type Egg Python version 3.8 Upload date Hashes View
Filename, size pyprojecttemplate-0.2.0-py3-none-any.whl (4.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size pyprojecttemplate-0.2.0.tar.gz (3.4 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page