Skip to main content

python-package-template

Documentation

Example Project Structure for a Python / PyPI Project

Installation

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 setup.py

  • 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

https://setuptools.readthedocs.io/en/latest/setuptools.html#command-reference

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

>>>
python setup.py sdist

Detailed instructions to distribute a setuptools project can be found at Packaging project tutorials. https://packaging.python.org/tutorials/packaging-projects/#generating-distribution-archives

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 setup.py is located:

>>>
python setup.py sdist bdist_wheel

This will generate distribution archives in the dist directory.

Uploading to test.pypi.org

test.pypi.org

Before you upload the generated archives make sure you’re registered on https://test.pypi.org/account/register/.

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 https://test.pypi.org/legacy/ dist/*

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

>>>
python -m pip install --index-url https://test.pypi.org/simple/ example_pkg

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

Credits

Patrick Shiel: github.com/patrickshiel

License

MIT License

Metadata

Release files for pyprojecttemplate 0.2.0

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

Source distribution (sdist)

Source distribution for pyprojecttemplate 0.2.0
File Size Uploaded
pyprojecttemplate-0.2.0.tar.gz 3.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for pyprojecttemplate 0.2.0
File Interpreter ABI Platform
pyprojecttemplate-0.2.0-py3.8.egg Legacy Egg format - - Details
pyprojecttemplate-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 12.3 kB

Release files / pyprojecttemplate-0.2.0.tar.gz

Download URL pyprojecttemplate-0.2.0.tar.gz
Size 3.4 kB
Tags Source
SHA-256 checksum
How to use checksums
003a0f16b9871697db4ad38a57be6d18556c6c37404178290a61fa158d644bc5
BLAKE2b-256 checksum
How to use checksums
7132ab8b9761a26759fd50ef1a7042d3d525e7f6b1ea4f50b6bda194992cc609
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

Release files / pyprojecttemplate-0.2.0-py3.8.egg

Download URL pyprojecttemplate-0.2.0-py3.8.egg
Size 4.7 kB
Tags Egg
SHA-256 checksum
How to use checksums
5f4c992e03b820fec58acf8aae4f9c8c29d9c95bbdb7d7c0d6b3e7dee54b8dea
BLAKE2b-256 checksum
How to use checksums
12c7a13371eaba329206f7ae7aacb2047b3b9fb23b9bf1728a14cbfe076ae9dc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

Release files / pyprojecttemplate-0.2.0-py3-none-any.whl

Download URL pyprojecttemplate-0.2.0-py3-none-any.whl
Size 4.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
5f7a8d982f67113b1e1f24ddc4dfc292b1fc0c8640766c6f1b9e54e57e4ff348
BLAKE2b-256 checksum
How to use checksums
1dff42328fcf47375bc93d368d0a57c9c962c95e438d1709a4fc7ce78069f81d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/42.0.2 requests-toolbelt/0.9.1 tqdm/4.40.2 CPython/3.8.0

Release history Release notifications | RSS feed

This release

0.2.0 This release

3 release files

0.1.0

2 release files

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